1 - THIS WORKS:
- create button pin with IRQ_RISING callback1
- in callback1: start timer, remove irq, add new IRQ_FALLING callback2
- in callback2: if timer>1s THEN remove irq, add wake_on_ext0 + deepsleep ELSE reset callback
2 - THIS DOESN'T WORK
- create button pin with IRQ_RISING callback1
- in callback start 1s timer with callback2
- in callback2: if button is still down, remove irq, add wake_on_ext0 + deepsleep
Is there a better approach to doing the second version? I have attempted to disable interrupts as a test but that makes no difference