Page 1 of 1

preemptive irq

Posted: Wed Oct 07, 2015 11:38 am
by enrico.dallavia
Hi,
I want to manage irq in a different manner beside EXTI, is it possible?
I saw a piece of code from another topic in the forum, like

CH_IRQ_HANDLER(USART1_IRQHandler) {
CH_IRQ_PROLOGUE();
my_code();
CH_IRQ_EPILOGUE();
}

and NVICEnableVector(USART1_IRQn,CORTEX_PRIORITY_MASK(1));

if I want to stick the irq to a generic GPIO pin (GPIOE pin 3) and perform a "long" time task inside my_code() (accessing SPI, do few readings) while the other threads are frozen before the instruction when the interrupt is rised. Is it possible with chibios?

Thanks