2019-10-13 12:42 AM
2019-10-13 07:36 AM
Wake up from the keypress and continue sampling the button state if it's long enought high/low , wake up else go back to sleep after the button is released.
2019-10-13 06:35 PM
it seems that it will wakeup until key released for stm8, what if stm32?
2019-10-13 08:48 PM
Then it's configured to detect and wakeup on wrong edge of signal (rising/falling), or if not possible to configure such option you need to modify the hardware.
2019-10-13 09:58 PM
wakeup edge of signal (rising/falling) is exit edge? or i have to write time detect in interrupt handler
2019-10-13 11:58 PM
What I mean your button is either grounding when pressed or pulling up to 3.3v/5v when pressed, if the button is grounding, then you need to detect falling edge of the signal to wake up, if the button is pulling high you need to detect rising edge of the signal.
And yes after wake up from initial pressing of the button you need to run timer or some code which samples the button state, so you then know if the button was pressed for 5 seconds or released quicker, I don't think there is any other way.