For robots and stuff
Diff: CC1101/CC1101-Threads.cpp
- Revision:
- 2:c42a035d71ed
- Parent:
- 1:05a48c038381
diff -r 05a48c038381 -r c42a035d71ed CC1101/CC1101-Threads.cpp --- a/CC1101/CC1101-Threads.cpp Sun Dec 28 06:28:42 2014 +0000 +++ b/CC1101/CC1101-Threads.cpp Wed Dec 31 22:16:01 2014 +0000 @@ -46,12 +46,16 @@ osSignalWait(START_THREAD, osWaitForever); while(1) { - osEvent evt = instance->_tx_data.get(); + + osSignalWait(START_THREAD, osWaitForever); + + /* osEvent evt = instance->_tx_data.get(); if (evt.status == osEventMail) { RTP_t *mail = (RTP_t*)evt.value.p; instance->put_pck(mail->payload, mail->size); // send the packet over air } + */ } } @@ -64,6 +68,11 @@ // receiving operations while(1) { + + osSignalWait(START_THREAD, osWaitForever); + + + /* osSignalWait(NEW_DATA, osWaitForever); // set the limit for max bytes to put in the buffer every time @@ -81,18 +90,19 @@ instance->_rx_data.put(data); // send the data over the serial connection -#if DEBUG_MODE > 0 + #if DEBUG_MODE > 0 std::printf(" ==============\r\n"); for (int i=0; i < rxlength; i++) { std::printf(" | 0x%02X |\r\n", instance->buffer[i]); } std::printf(" ==============\r\n"); -#endif + #endif } } else { std::printf("Receiving packet failure\r\n"); } instance->_spi->frequency(5000000); + */ } } \ No newline at end of file