Check that no key is pressed right after setting up IC interrupt and before going to sleep

This commit is contained in:
Ondrej Jirman 2023-02-17 14:00:32 +01:00
parent 0899765c07
commit 4b3d885b61
1 changed files with 6 additions and 0 deletions

View File

@ -2075,6 +2075,12 @@ void main(void)
// pin state against the P6 latch for output
p6_changed = 0;
P6 = P6;
// last check that nothing is pressed currently
// if it is, we need to abort the sleep
if (keyscan_idle_is_pressed()) {
p6_changed = 1;
continue;
}
P0_ICEN = BIT(5);
ICIE = 1;