suikan4github / murasaki

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

Early EXTI call system failure. #124

Closed suikan4github closed 4 years ago

suikan4github commented 4 years ago

Describe the bug If EXTI is raised before the corresponding Exti class object is created, an assertion failed inside the ExtiCallbackRepositorySingleton class.

This is a system problem. CubeIDE cannot disable the EXTI at the system time. As a result, main() enables EXTI before the system interrupt handler is ready.

Expected behavior There is two way to solve this problem.

The simplest way is to remove the assertion. This works fine, but cannot detect more serious error like unhandled EXTI.

The other way is to block the EXTI handling until the first Exti::Wait is called. We can assume Exti::Wait is called after all Exti class objects are created.

To implement the second way, we can make a switch "ready_" as static, private variable of the Exti class. By default, it is false. And turn true by calling "Wait" member function. By adding isReady member function, external entities can refer to the status.

suikan4github commented 4 years ago

Merged to develop. Ready to release.