From 2fbc2e057ea32de6a33b7d681976e309f10e0822 Mon Sep 17 00:00:00 2001 From: Ondrej Jirman Date: Mon, 2 Aug 2021 10:10:03 +0200 Subject: [PATCH] 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. --- firmware/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/firmware/main.c b/firmware/main.c index 0e7d6ad..b782101 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -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