Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years ago.
Uasge of InterruptManager with mbedOS 5.6.5 and following
Recently I switched to mbedOS 5.6.5 and noticed that when using InterruptManager class, the ompiler informs me about soon to be deprecate code, originating from CallChain class.
Is there a new intended way to interact with InterruptManager class, or will that class also be deprecated in the future.
Background is, I thought it to be a nifty way to implement callbacks for currently not implemented Interrupt callbacks, therefore would like to further use it.
For the moment I use it to implement a callback to handle RTC_Alarm interrupts on STM32F7 controllers.
short example for RTC Alarm IRQn
InterruptManager::get()->add_handler(_instance, &STM32F7_RTC::RTC_AlarmIRQHandler, RTC_Alarm_IRQn);
Hi Christian B*,
the deprecated message has not yet been released , I would believe you are using master branch of mbed-os.
I would like to understand better your use case. As I read the code snippet above, you are registering IRQ handler to a class method. To have that functional, you need to do all the magic for RTC alarm to be triggered.
What interrupt manager does in this case, it registers your handler to NVIC (NVIC_SetVector) and then once it jumps to its internal handler, would invoke your callback. No chaining or other features you use?
_instance is this pointer, and STM32F7_RTC::RTC_AlarmIRQHandler is a method of that class ?
posted by Martin Kojtal 29 Nov 2017Hello Martin Kojital,
thank you for your reply.
Currently I'm using the ST HAL to onfigure the RTC and set up a condition to trigger the Alarm interrupt on Channel A on given condition. The STM32F7_RTC::RTC_AlarmIRQHandler method then is supposed to check which Channel (A / B) raised the interrupt flag and then handles that interrupt by redirecting to a channel specific memberfunction.
In this case I do not ue InterruptChaining, at least not for now. Maybe later on.
As you already guessed, _instance is a pointer of STM32F7_RTC,pointing to itself, since I implemented STM32F7_RTC as a singleton.
The actual question I'd like to see answered would be, if possible at this point, what's supposed to happen with CallChain class. Will it be replaced by another class, so InterruptManager-class will still work, but will no longer use CallChain-class, or will it be removed without replacement?
PS.: The mbed-os version im using is mbed-os-5.6.5 (https://github.com/ARMmbed/mbed-os/releases/tag/mbed-os-5.6.5)
posted by Christian B*** 29 Nov 2017