int ve_recv_int() { char message[2]; while(!e_ischar_uart1()){} /* Wait until arrive a message */ while(e_getchar_uart1(message)==0); while(!e_ischar_uart1()){} /* Wait until arrive a message */ while(e_getchar_uart1(message + 1)==0); int m0 = message[0]; int m1 = message[1]; return (m1<<8) | (m0 & 0xFF); }
char recv_char() { char message; while(!e_ischar_uart1()){} /* Wait until arrive a message */ while(e_getchar_uart1(&message)==0); return message; }
int main() { e_init_port(); e_init_uart1(); int i; for (i = 0; i < 14; i++) { char c; while (!e_ischar_uart1()); e_getchar_uart1(&c); } while (1) { char c; while (!e_ischar_uart1()); e_getchar_uart1(&c); e_send_uart1_char(&c, 1); while (e_uart1_sending()); } return 0; }