Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of stm-spirit1-rf-driver by
Diff: source/SimpleSpirit1.cpp
- Revision:
- 39:75481c4c6655
- Parent:
- 37:bc043030b55a
- Child:
- 40:343254875d89
diff -r 5deec3ab2025 -r 75481c4c6655 source/SimpleSpirit1.cpp
--- a/source/SimpleSpirit1.cpp Wed Nov 23 07:00:33 2016 +0100
+++ b/source/SimpleSpirit1.cpp Thu Nov 24 08:47:27 2016 +0100
@@ -563,12 +563,20 @@
/* The IRQ_VALID_SYNC is used to notify a new packet is coming */
if(x_irq_status.IRQ_VALID_SYNC) {
- _is_receiving = true;
- _spirit_rx_err = false;
- CLEAR_RXBUF();
+ /* betzw - NOTE: there is a race condition between Spirit1 receiving packets and
+ * the MCU trying to send a packet, which gets resolved in favor of
+ * sending.
+ */
+ if(_spirit_tx_started) {
#ifdef DEBUG_IRQ
- debug_if(_spirit_tx_started, "\n\rAssert failed in: %s (%d)\n\r", __func__, __LINE__);
+ uint32_t *tmp = (uint32_t*)&x_irq_status;
+ debug("\n\r%s (%d): irq=%x", __func__, __LINE__, *tmp);
#endif
- start_rx_timeout();
+ } else {
+ _is_receiving = true;
+ _spirit_rx_err = false;
+ CLEAR_RXBUF();
+ start_rx_timeout();
+ }
}
}
