Пример #1
0
__u32 serial_gets_nommu(char* buf, __u32 n)
{
	__u32 i;
	char c;
	
	for (i=0; i<n; i++) {
		c = serial_get_char_nommu();
		if (c == 0)
			break;
		buf[i] = c;
	}
	return i+1;
}
Пример #2
0
__u32 serial_gets_nommu(char* buf, __u32 n)
{
	__u32 i = 0;
	char c = '\0';
	
	if(0 == serial_inited_flag){
	    return FAIL;
	}

	for (i=0; i<n; i++) {
		c = serial_get_char_nommu();
		if (c == 0)
			break;
		buf[i] = c;
	}
	return i+1;
}