Skip to content

alarm.exit_and_deep_sleep_until_alarms() not exiting sleep when interrupted #7081

@billedluh

Description

@billedluh

I have a simple setup with an RP2040 feather controlling some neopixels and am trying to get it to reliably deep sleep when not in use. I have a vibration switch between GND and A2, and am sleeping until the vibration switch gets triggered using

pin_alarm = alarm.pin.PinAlarm(pin=board.A2, value=False, pull=True)
alarm.exit_and_deep_sleep_until_alarms(pin_alarm)

This works great and my current consumption goes from ~28mA to ~2mA once it gets to sleep. But if I happen to trigger the vibration switch while it's in the process of going to sleep it seems to go unresponsive. Current consumption still goes down to ~2 but it no longer wakes until I toggle reset. Ive confirmed that the pull-up resistor is getting configured correctly (I see 3.3v on pin A2).

This problem is extremely reproducible on this setup, if I give it an extra second after the current has dropped down it seems to wake every time, but if I spam the vibe switch while it's getting ready to sleep it pretty consistently gets locked up.

Everything works as expected when connected to serial and using simulated deep sleep.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions