suikan4github / murasaki

STM32 HAL class library
MIT License
17 stars 3 forks source link

xPortIsInsideInterrupt() is not provided for ARMv6-M #152

Closed suikan4github closed 1 year ago

suikan4github commented 1 year ago

Describe the bug Build is failed for STM32 MCU with ARMv6-M ( CORTEC-M0/M0+ ).

The FreeRTOS in CubeMX doesn't provide the xPortIsInsideInterrupt() function to detect the context. This is the root cause of bug. In the previous version, Murasaki was providing the custom context detect routine. This routine was removed by Issue #148.

Expected behavior It is better to provide a custom detection function again. For the ARMv7-M core, we can use the xPortIsInsideInterrupt() funcniton.

murasaki::isInsideInterrupt()
{
#if ARMv6-M
    return __get_IPSR() != 0 ;
#else
   return xPortIsInsideInterrupt();
#endif 
}
suikan4github commented 1 year ago

Merged to develop. Ready to release.