Supachai Vorapojpisut
/
le484_2016
Course project for LE484 at Thammasat University, class of 2016
Diff: main.cpp
- Revision:
- 11:8b9668e37646
- Parent:
- 6:da3c4393efee
- Child:
- 12:845639da2f03
diff -r da3c4393efee -r 8b9668e37646 main.cpp --- a/main.cpp Mon May 08 04:16:10 2017 +0000 +++ b/main.cpp Mon May 08 05:06:11 2017 +0000 @@ -10,6 +10,8 @@ RawSerial pc(USBTX, USBRX); // use USB-serial for testing purpose Mail<char, 2> mbx; // use Mail API to forward data +Thread ledThred; + /** * @brief ISR code: reception of XBee API frame @@ -25,14 +27,7 @@ * @brief Main code: initial serial RX handler, then wait for detected frame */ int main() { - pc.attach(rxHandler); - while (true) { - osEvent evt = mbx.get(); - if (evt.status == osEventMail) { - char *mail = (char*)evt.value.p; - pc.printf("Got %c\n", *mail); - mbx.free(mail); - } - } + ledThread.start(led1_thread); + while(1); }