I am trying to detach/queue an external interrupt on EXTI-4 and EXTI-5, so that they do not wake the processor during a critical stop mode deepsleep time of (for example) 1340ms.
During this time-out I want to go into stop mode with RTC for low power purposes.
On a previous processor, the ATMega328, I was able to detach an interrupt function in a way that it was handled after the lowpower sleep.
using just detachInterrupt().
Now, on the STM32L0, the interrupt wakes the processor (I can look at the RTC subSeconds to track time), but due to the limit of minimum 1000ms sleep, I cannot go back to sleep for the remaining milliseconds, in most cases (after 340ms)
Does anyone know how to detach, but still queue the interrupt (I still want it to set the ISR_Flag) while in stop mode so that I can sleep the full 1340ms and then handle the interrupt? I am unsuccessful using detachInterrupt().
Or does anyone know a way to sleep for less then 1000ms in stop mode?
Code: Select all
STM32LowPower lp;
Code: Select all
lp.attachInterruptWakeup(SENSOR_L, detect_Sensor_L, RISING);
lp.attachInterruptWakeup(SENSOR_R, detect_Sensor_R, RISING);
Code: Select all
lp.deepSleep(1340);
Sensor_R is on PIN PA5 (EXTI-5)
Code: Select all
void detect_Sensor_L()
{
ISR_Flag_S1 = true;
}
void detect_Sensor_R()
{
ISR_Flag_S2 = true;
}