void TIMER1_IRQHandler(void) { RTC_timeMs++; //add the ms counter for fake RTCC TIM_ClearIntPending(LPC_TIM1, TIM_MR0_INT); } |
char UART2_Getchar() { timed_out = 0; long y; long delay; char cout; long time_delay; time_delay = 0; printf("ms while = %d\n", RTC_timeMs); time_delay = RTC_timeMs; while( ((LPC_UART2->LSR & LSR_RDR) == 0) && (RTC_timeMs < time_delay+25) ) // Nothing received so just block { } cout = LPC_UART2->RBR; // Read Receiver buffer register //After 100msec if nothing receive = break() and error printf("ms while1 = %d\n", RTC_timeMs); return cout; } |