So to compare:
Bela Button
Short P9.27 to ground
Short press action: by default stops running Bela program, this action can be changed or disabled
Long press (2 seconds): graceful shutdown, calls cleanup function
PWR_BUT
Short P9.09 to ground
Long press (8 seconds): graceful shutdown, calls cleanup function ??
Pressing while Bela is shutdown while power is connected starts it up again
Is this correct? Does the PWR_BUT also call cleanup() in render.cpp? I'd like to use that function to trigger autosaving of parameters when a gracefull shutdown is triggered.
Ideally I'd like to have a button that is able to both shut down and boot up the Bela. The PWR_BUT seems to be able to do this, however pressing 8 seconds is a bit too much. The TPS65217C datasheets mentions the 8 seconds, and it seems like that time cannot be changed.
I have a momentary DPDT switch with one side connecting P9.27 to ground when pressed. Now I wonder if I connect the other side of the switch to P9.09 I get the best of both behaviours:
- When the Bela is turned on pressing 2+ seconds triggers a graceful shutdown (if one where to press for more than 8 seconds, the Bela would already be shutting down anyway)
- When the Bela is turned off pressing will boot the Bela