Skip to content

Commit 297e70e

Browse files
committed
Check and handle unsupported modulation rates
1 parent 848be1d commit 297e70e

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

MyConfig.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,11 @@
543543
* - NRF5_BLE_1MBPS for 1Mbps BLE modulation
544544
*/
545545
#ifndef MY_NRF5_ESB_MODE
546+
#ifdef NRF5_250KBPS
546547
#define MY_NRF5_ESB_MODE (NRF5_250KBPS)
548+
#else
549+
#define MY_NRF5_ESB_MODE (NRF5_1MBPS)
550+
#endif
547551
#endif
548552

549553
/**

hal/transport/NRF5_ESB/driver/Radio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ typedef enum {
6565
typedef enum {
6666
NRF5_1MBPS = RADIO_MODE_MODE_Nrf_1Mbit,
6767
NRF5_2MBPS = RADIO_MODE_MODE_Nrf_2Mbit,
68+
#ifdef RADIO_MODE_MODE_Nrf_250Kbit
6869
NRF5_250KBPS = RADIO_MODE_MODE_Nrf_250Kbit, // Deprecated!!!
70+
#endif
6971
NRF5_BLE_1MBPS = RADIO_MODE_MODE_Ble_1Mbit,
7072
} nrf5_mode_e;
7173

hal/transport/NRF5_ESB/driver/Radio_ESB.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,12 @@ static inline uint8_t NRF5_ESB_byte_time()
547547
return (3);
548548
} else if (MY_NRF5_ESB_MODE == NRF5_2MBPS) {
549549
return (2);
550-
} else if (MY_NRF5_ESB_MODE == NRF5_250KBPS) {
550+
}
551+
#ifdef NRF5_250KBPS
552+
else if (MY_NRF5_ESB_MODE == NRF5_250KBPS) {
551553
return (5);
552554
}
555+
#endif
553556
}
554557

555558
extern "C" {

0 commit comments

Comments
 (0)