asdf
Dependencies: NokiaLCD XMIT_IR mbed
Fork of 4180_mP_WirelessPong_revC by
Diff: main.cpp
- Revision:
- 14:68f7cefd7359
- Parent:
- 13:17fd813ef7c9
- Child:
- 15:21c512907cf6
--- a/main.cpp Sat Oct 06 01:44:47 2012 +0000 +++ b/main.cpp Sat Oct 06 02:46:01 2012 +0000 @@ -125,7 +125,7 @@ while(true) { //If data available - Print data directly to USB port (for debug) - /*osEvent evt = rx_data_mailbox.get(); + osEvent evt = rx_data_mailbox.get(); while(evt.status == osEventMail) { char* mail = (char*)evt.value.p; //if((*mail)==0x02) pc.printf("\n"); @@ -135,11 +135,12 @@ rx_data_mailbox.free(mail); evt = rx_data_mailbox.get(); - }*/ + } - char* data; + /*char* data; while(ir_tx.ReadPacket(data)==0) pc.printf("0x%02X.",*data); + */ //Do not return until we have more data //Thread::signal_wait(0x1); @@ -214,15 +215,16 @@ //Handle Reception of RX data (mail it to appropriate thread) -void ISR_UARTRX(void) +void ISR_UARTRX() { //get RX data (and prevent ISR from looping forever uint32_t RBR = LPC_UART1->RBR; //write letter and put in mailbox - char* mail = ir_tx.ir_data_mailbox.alloc(); + char* mail = rx_data_mailbox.alloc(); mail[0] = (char)RBR; - ir_tx.ir_data_mailbox.put(mail); + rx_data_mailbox.put(mail); + //Let message handler run (*threadptr_irstuff).signal_set(0x1);