Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Where could macros be defined if there is only a definition in a header but the macro isnt doing anything?

So im trying to setup some interrupts on the Arduino BLE 33 board, and im looking at Nordics header files for their nrfx drivers.

There is a file called nrfx_glue.h which i’ve attached that creates a bunch of macros but the macros dont do anything.

So im wondering what exactly theyre doing,

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

here is an example of some of the macros:

/**
 * @brief Macro for setting the priority of a specific IRQ.
 *
 * @param irq_number IRQ number.
 * @param priority   Priority to be set.
 */
#define NRFX_IRQ_PRIORITY_SET(irq_number, priority)
/**
 * @brief Macro for enabling a specific IRQ.
 *
 * @param irq_number IRQ number.
#define NRFX_IRQ_ENABLE(irq_number)

/**
 * @brief Macro for checking if a specific IRQ is enabled.
 *
 * @param irq_number IRQ number.
 *
 * @retval true  If the IRQ is enabled.


 * @retval false Otherwise.

 */


#define NRFX_IRQ_IS_ENABLED(irq_number)

ive tried searching around in the directories and i cant find anything, or on the internet. Just seems weird to make a macro that doesnt do anything unless theyre redefining it?

Heres the header file on github:
https://github.com/NordicSemiconductor/nrfx/blob/master/templates/nrfx_glue.h

>Solution :

It’s a template file according to its comment in the file.

You can find a real implementation for example at https://github.com/nrfconnect/sdk-zephyr/blob/main/modules/hal_nordic/nrfx/nrfx_glue.h.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading