// USB/USART combined get char int _user_getc(void) { #ifdef USE_USART if (DataRdy1USART()) { return getc1USART(); } #endif return usb_getchar(); }
void gets1USART(char *buffer, unsigned char len) { char i; // Length counter unsigned char data; for(i=0;i<len;i++) // Only retrieve len characters { while(!DataRdy1USART());// Wait for data to be received data = getc1USART(); // Get a character from the USART // and save in the string *buffer = data; buffer++; // Increment the string pointer } }