Hi!
I need to include a specific .h for each board. How can I know, in compiling time, which board is being compiled?
Something like:
#ifdef BOARD_A #include "board-a.h" #endif
Thanks!
Pedro.
Hi!
I need to include a specific .h for each board. How can I know, in compiling time, which board is being compiled?
Something like:
#ifdef BOARD_A #include "board-a.h" #endif
Thanks!
Pedro.
Hi,
In nRF Connect SDK you can use the CONFIG_BOARD_<BOARD_NAME> config, which comes from the selected build target. For example, for nRF52 DK you can use:
#ifdef CONFIG_BOARD_NRF52DK_NRF52832 #include "board-nrf52dk.h" #endif
This configuration is defined in the Kconfig.board file for each board, also for custom boards, for example: zephyr/boards/arm/nrf52dk_nrf52832/Kconfig.board.
Best regards,
Marte
Hi,
In nRF Connect SDK you can use the CONFIG_BOARD_<BOARD_NAME> config, which comes from the selected build target. For example, for nRF52 DK you can use:
#ifdef CONFIG_BOARD_NRF52DK_NRF52832 #include "board-nrf52dk.h" #endif
This configuration is defined in the Kconfig.board file for each board, also for custom boards, for example: zephyr/boards/arm/nrf52dk_nrf52832/Kconfig.board.
Best regards,
Marte
Thank you Marte!
It's exactly what I needed.
Kind regards,
Pedro.