Why by default NRFX_ATOMIC_USE_BUILT_IN is not set in SDK 17.1.0 ?

Hi,

In nrf_atomic.c :

#ifndef NRF_ATOMIC_USE_BUILD_IN
#if (defined(__GNUC__) && defined(WIN32))
    #define NRF_ATOMIC_USE_BUILD_IN 1
#else
    #define NRF_ATOMIC_USE_BUILD_IN 0
#endif
#endif // NRF_ATOMIC_USE_BUILD_IN



In nrfx_atomic.c :

#ifndef NRFX_ATOMIC_USE_BUILT_IN
    #define NRFX_ATOMIC_USE_BUILT_IN 0
#endif // NRFX_ATOMIC_USE_BUILT_IN


On any nrf52 buit_in are possible. Why not use it buy default ?
It is not set in any exemples.

Parents
  • Hello, 

    I'm not able to give a definite answer for why it was implemented this way because it was added a long time ago. Perhaps it was to ensure consistent behavior across our supported toolchains. This implementation at least ensures that STREX/LDREX instructions are being used on our M4s regardless of which compiler you use. 

    Best regards,

    Vidar 

Reply
  • Hello, 

    I'm not able to give a definite answer for why it was implemented this way because it was added a long time ago. Perhaps it was to ensure consistent behavior across our supported toolchains. This implementation at least ensures that STREX/LDREX instructions are being used on our M4s regardless of which compiler you use. 

    Best regards,

    Vidar 

Children
No Data
Related