Skip to content

Commit 64a9e1d

Browse files
committed
mdk: Add option to avoid replacing MDK peripheral addresses
In very rare cases, somebody wants to include the nrf.h for simulation without replacing the hard real HW addresses from the MDK with the ones for simulation. Add an option (macro) to enable this use case. Note this option (NRF_H_NO_BSIM_REDEFS) should be used with great care. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
1 parent 0aebb20 commit 64a9e1d

File tree

1 file changed

+6
-1
lines changed
  • src/nrfx/mdk_replacements

1 file changed

+6
-1
lines changed

src/nrfx/mdk_replacements/nrf.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
/* Include the real nrf.h */
1616
#include <mdk/nrf.h>
1717

18-
/* For BSIM we require redefining the pointers to the peripherals. */
18+
#if !defined(NRF_H_NO_BSIM_REDEFS)
19+
/* In the HW models, peripherals registers are not mapped in the same addresses as in
20+
* the real HW so we need to correct them.
21+
* For the very special cases in which one wants the real HW addresses after
22+
* including nrf.h, define NRF_H_NO_BSIM_REDEFS before including *any* header */
1923
#include "nrf_bsim_redef.h"
24+
#endif
2025

2126
#endif

0 commit comments

Comments
 (0)