firmware: Implement scanning block

This allows to disable the keyboard. The firmware will never scan
for keys pressed in this mode, and it will powerdown the MCU most of the
time.
This commit is contained in:
Ondrej Jirman 2021-08-02 10:10:03 +02:00
parent 41418cdc14
commit 2fbc2e057e

View file

@ -1903,6 +1903,13 @@ void main(void)
}
#endif
// do nothing if scanning is blocked
if (cfg & REG_SYS_CONFIG_SCAN_BLOCK) {
if (scan_active)
keyscan_idle();
continue;
}
// if active scanning is not active and port 6 change was
// detected, and some key is still pressed, enter active
// scanning mode