Hi,
I would like to use a fast interrupt to use with the GPT driver without OS (os-less).
I can't declare a fast interrupt with CH_FAST_INTERRUPT_HANDLER as it belong to RT kernel.
I can declare a "normal" interrupt with OSAL_IRQ_HANDLER() (defined in osal.h), but there is no OSAL_FAST_IRQ_HANDLER().
or maybe, i missed somting ?
Thanks
Fast interrupt with OS-Less
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: Fast interrupt with OS-Less
Hi,
The macro is missing in OSAL but a fast interrupt handler is a normal void function, declare it as:
BTW, it is missing because it is not required by HAL.
Giovanni
The macro is missing in OSAL but a fast interrupt handler is a normal void function, declare it as:
Code: Select all
void VectorXX(void) {
}
BTW, it is missing because it is not required by HAL.
Giovanni
Re: Fast interrupt with OS-Less
Thank you Giovanni.
And for readers who want to write their own interrupt handler with ChibiOS drivers, like me:
- Don't forget to declare the SUPPRESS_ISR macro. (in my case, the timer4: STM32_TIM4_SUPPRESS_ISR)
- Don't forget to clear the status register flag in your ISR
- Don't forget to not put NULL in callback driver declaration!
So, in my case, i need a timer4 fast interrupt for stm32 platform:
(i put this in my osalconf.h, as in main.c it makes compilation warnings)
My fast ISR:
My GPTConfig declaration for TIM4:
And for readers who want to write their own interrupt handler with ChibiOS drivers, like me:
- Don't forget to declare the SUPPRESS_ISR macro. (in my case, the timer4: STM32_TIM4_SUPPRESS_ISR)
- Don't forget to clear the status register flag in your ISR
- Don't forget to not put NULL in callback driver declaration!
So, in my case, i need a timer4 fast interrupt for stm32 platform:
(i put this in my osalconf.h, as in main.c it makes compilation warnings)
Code: Select all
#define STM32_TIM4_SUPPRESS_ISR
My fast ISR:
Code: Select all
void VectorB8(void) // STM32_TIM4_HANDLER
{
(&GPTD4)->tim->SR = 0; // clear interrupt flag
// your code here
}
My GPTConfig declaration for TIM4:
Code: Select all
static const GPTConfig gpt4cfg = {
1000000, // frequency
1, // callback func. Don't put NULL here!
0,
0
};
Who is online
Users browsing this forum: No registered users and 12 guests