Skip to content

Commit ce1f8cc

Browse files
nika-nordicNordicBuilder
authored andcommitted
samples: direct_test_mode: align to DFE GPIO equal to 7
Some devices has `7` DFE GPIOs rather than `8`. Signed-off-by: Nikodem Kastelik <[email protected]>
1 parent b3b0e20 commit ce1f8cc

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

samples/bluetooth/direct_test_mode/src/dtm_hw.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,13 @@ const int8_t nrf_power_value[] = {
112112
/* Run a macro 'fn' on each available DFE GPIO index, from 0 to
113113
* MAX_DFE_GPIO-1, with the given parenthesized separator.
114114
*/
115-
#define FOR_EACH_DFE_GPIO(fn, sep) \
116-
FOR_EACH(fn, sep, 0, 1, 2, 3, 4, 5, 6, 7)
115+
#if DTM_HW_MAX_DFE_GPIO == 8
116+
#define FOR_EACH_DFE_GPIO(fn, sep) FOR_EACH(fn, sep, 0, 1, 2, 3, 4, 5, 6, 7)
117+
#elif DTM_HW_MAX_DFE_GPIO == 7
118+
#define FOR_EACH_DFE_GPIO(fn, sep) FOR_EACH(fn, sep, 0, 1, 2, 3, 4, 5, 6)
119+
#else
120+
#error "Unsupported DFE GPIO count"
121+
#endif
117122

118123
/* The number of dfegpio[n]-gpios properties which are set. */
119124
#define DFE_GPIO_NUM (FOR_EACH_DFE_GPIO(HAS_DFE_GPIO, (+)))

samples/bluetooth/direct_test_mode/src/dtm_hw.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ extern "C" {
1717
#endif
1818

1919
/* Number of PSEL_DFEGPIO[n] registers in the radio peripheral. */
20+
#if defined(RADIO_PSEL_DFEGPIO_MaxCount)
21+
#define DTM_HW_MAX_DFE_GPIO RADIO_PSEL_DFEGPIO_MaxCount
22+
#else
2023
#define DTM_HW_MAX_DFE_GPIO 8
24+
#endif
2125

2226
/* Indicates that GPIO pin is not connected to the radio */
2327
#define DTM_HW_DFE_PSEL_NOT_SET 0xFF

west.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ manifest:
6565
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html
6666
- name: zephyr
6767
repo-path: sdk-zephyr
68-
revision: pull/2930/head
68+
revision: 63b28baebfc909e707d34c9d41f5fd4ef7aa47c7
6969
import:
7070
# In addition to the zephyr repository itself, NCS also
7171
# imports the contents of zephyr/west.yml at the above

0 commit comments

Comments
 (0)