This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

WFI internals

Hello :) For the code below, why are we defining the _wfi while in the code we only use _WFI() for addressing the function? Also once we use _asm volatile ("wfi); isnt the syntax still in C ? I presumed that using _asm we need to write the rest of the code in assembly language? I would appreciate peoples response.

 #define __WFI                             __wfi
    
    
    /** \brief  Wait For Interrupt
    
        Wait For Interrupt is a hint instruction that suspends execution
        until one of a number of events occurs.
     */
    __attribute__((always_inline)) __STATIC_INLINE void __WFI(void)
    {
      __ASM volatile ("wfi");
    }
Related