ir stuff working nicely. rx on interrupt. tx is blocking.

Fork of 4180_mP_WirelessPong_revB by Curtis Mulady

Files at this revision

API Documentation at this revision

Comitter:
cmulady
Date:
Sat Oct 06 02:46:01 2012 +0000
Parent:
13:17fd813ef7c9
Child:
15:21c512907cf6
Commit message:
bad luck ol mum;

Changed in this revision

XMIT_IR.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/XMIT_IR.lib	Sat Oct 06 01:44:47 2012 +0000
+++ b/XMIT_IR.lib	Sat Oct 06 02:46:01 2012 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/cmulady/code/XMIT_IR/#ae1d2167a10c
+http://mbed.org/users/cmulady/code/XMIT_IR/#2eb0a3a29b5b
--- 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);