suikan4github / murasaki

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

Make interrupt callback program automatic. #119

Closed suikan4github closed 4 years ago

suikan4github commented 4 years ago

Is your feature request related to a problem? Please describe. Currently, the interrupt call back has to be filled by the application programmer. This is far from what the programmer wants to do. We have to make it easier.

Describe the solution you'd like We should introduce a class that registers the object which waits for interrupt.

For each call back an interrupt call back is called, this registry is scanned and if appropriate object found, it should be called. The appropriate member function is obvious inside interrupt callback.

By registering the object at the constructor calling time, the interrupt registration becomes automatic, from the viewpoint of the programmer.

Describe alternatives you've considered The interrupt registry class must be a singleton, to avoid the global variable from the peripheral classes.

suikan4github commented 4 years ago

Merged to develop. Ready to release.