Made a new debounce routine using a timer, thank you for the suggestion jimmo!
I needed to wait for the user to press and release the button as I was getting bounce after the release also. After the debounce is handled it calls my function to put the board to sleep, first enabling the wake up on rising edge of PA0 pin using:
Code: Select all
stm.mem32[stm.PWR + stm.PWR_CSR] |= 1 << 8
machine.deepsleep()
Thanks for the help everyone!