Project

General

Profile

Revision 244

changed macros a bit to only compile what i want

View differences:

test7.c
33 33
int ser_test_poll(unsigned short base_addr, unsigned char tx, unsigned long bits,
34 34
                    unsigned long stop, long parity, unsigned long rate,
35 35
                    int stringc, char *strings[]) {
36
    /* To be completed */
37
	return 1;
36
	int ret = SUCCESS;
37
    if((ret = ser_test_set(base_addr, bits, stop, parity, rate))) return ret;
38
	if(tx == 0){
39
		char c;
40
		if((ret = uart_get_char(base_addr, &c))) return ret;
41
		while(c != '.'){
42
			printf("%c", c);
43
			if((ret = uart_get_char(base_addr, &c))) return ret;
44
		}
45
	}else{
46
		for(int i = 0; i < stringc; ++i){
47
			int j = 0;
48
			while(stringc[i][j] != 0)
49
				if((ret = uart_send_char(base_addr, stringc[i][j]))) return ret;
50
			if(i+1 != stringc) if((ret = uart_send_char(base_addr, ' '))) return ret;
51
		}
52
		if((ret = uart_send_char(base_addr, '.'))) return ret;
53
	}
54
	return SUCCESS;
38 55
}
39 56

  
40 57
int ser_test_int(/* details to be provided */) {

Also available in: Unified diff