My design on EXTI on STM32F205:
Code: Select all
{EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOA, cbExtImpulsi},
{EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOA, cbExtImpulsi},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOB, cbExtImpulsi},
{EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOB, cbExtImpulsi},
{EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOB, cbExtImpulsi},
{EXT_CH_MODE_RISING_EDGE | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOB, cbExtImpulsi},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL}
As you noticed same call back for all the lines.
Question : EXTi Callback interrupt are served simultaneously if i have multiple EXTI lines firing an int ?
-Affermative :
what can i do to avoid this behave ? ( of course rewriting my code with 1 to 1 relation between EXT line and cb)
-Negative :
Inside my cb i have something like :
Code: Select all
/** encoder[idx].vtLimit is type VirtualTimer * **/
/** idx is related to the EXTI channel firing the int **/
chSysLockFromIsr();
if( chVTIsArmedI(encoder[idx].vtLimit ) ) chVTResetI(encoder[idx].vtLimit );
chVTSetI(encoder[idx].vtLimit , MS2ST(1000), cbEncoderTimeout , & encoder[idx] );
chSysUnlockFromIsr();
Why it hangs on chVTSetI ??