Skip to content

Commit 9c1aabc

Browse files
nordic-krchcarlescufi
authored andcommitted
[nrf fromtree] modules: hal_nordic: nrfx: Add MDK flags based on the devicetree
Parse DT information regarding NFCT pins and pass it as compiler flags which are used by the MDK startup code. Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no> Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no> (cherry picked from commit c07bbb7)
1 parent 039ff37 commit 9c1aabc

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

modules/hal_nordic/nrfx/CMakeLists.txt

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,20 @@ endif()
204204
dt_nodelabel(uicr_path NODELABEL "uicr")
205205
if(DEFINED uicr_path)
206206
dt_prop(nfct_pins_as_gpios PATH ${uicr_path} PROPERTY "nfct-pins-as-gpios")
207-
if(${nfct_pins_as_gpios})
208-
zephyr_library_compile_definitions(
209-
NRF_CONFIG_NFCT_PINS_AS_GPIOS
210-
)
211-
endif()
212-
213207
dt_prop(gpio_as_nreset PATH ${uicr_path} PROPERTY "gpio-as-nreset")
214-
if(${gpio_as_nreset})
215-
zephyr_library_compile_definitions(
216-
NRF_CONFIG_GPIO_AS_PINRESET
217-
)
218-
endif()
208+
endif()
209+
210+
dt_nodelabel(nfct_path NODELABEL "nfct")
211+
if(DEFINED nfct_path AND NOT nfct_pins_as_gpios)
212+
dt_prop(nfct_pins_as_gpios PATH ${nfct_path} PROPERTY "nfct-pins-as-gpios")
213+
endif()
214+
215+
if(${nfct_pins_as_gpios})
216+
zephyr_library_compile_definitions(NRF_CONFIG_NFCT_PINS_AS_GPIOS)
217+
endif()
218+
219+
if(${gpio_as_nreset})
220+
zephyr_library_compile_definitions(NRF_CONFIG_GPIO_AS_PINRESET)
219221
endif()
220222

221223
dt_nodelabel(tampc_path NODELABEL "tampc")

0 commit comments

Comments
 (0)