summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Mooney <charliemooney@chromium.org>2012-07-30 10:53:01 -0700
committerCharlie Mooney <charliemooney@chromium.org>2012-07-30 14:33:51 -0700
commit7adb0aad167779fce70fc167af4455d5f8e18ab6 (patch)
tree660ea15f8aee8b01346f218df9ca8227432905ed
parent30b2bd27f671529f2e9af341efb78204f787bbee (diff)
downloadchrome-ec-7adb0aad167779fce70fc167af4455d5f8e18ab6.tar.gz
Remove "Sticky" recovery mode on Daisy
Previously, if you used Esc + Reload + Power to reboot into recovery mode, you would be stuck in it until you manually rebooted the EC with "Reload + Power." This was because the button combo set a switch that was never un-set. To fix it, the keyboard_scan function now sets a host event, that is serviced once, and then cleared. As a result, the next time you reboot after triggering recovery mode, it should boot as before you triggered recovery mode. BUG=chrome-os-partner:10889 TEST=Boot device in normal mode. Press Esc + Reload + Power, and boot from usb. Power off the device and remove the usb media. Power on the device again, and there should be no recovery screens during the boot process. Next, repeat these same steps, but from starting in developer mode. After recovery, when you reboot, the device should return to developer mode. Change-Id: Idcb8dde6f8ba5f680f4d34e61ae0d12992281cbb Signed-off-by: Charlie Mooney <charliemooney@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/28710 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--chip/stm32/keyboard_scan.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/chip/stm32/keyboard_scan.c b/chip/stm32/keyboard_scan.c
index b7cad467c4..350439ef1e 100644
--- a/chip/stm32/keyboard_scan.c
+++ b/chip/stm32/keyboard_scan.c
@@ -44,9 +44,6 @@ static struct mutex scanning_enabled;
/* The keyboard state from the last read */
static uint8_t raw_state[KB_OUTPUTS];
-/* status of keyboard related switches */
-static uint8_t switches;
-
/* Mask with 1 bits only for keys that actually exist */
static const uint8_t *actual_key_mask;
@@ -356,8 +353,7 @@ int keyboard_scan_init(void)
check_keys_changed();
/* is recovery key pressed on cold startup ? */
- switches |= check_recovery_key() ?
- EC_SWITCH_KEYBOARD_RECOVERY : 0;
+ check_recovery_key();
return EC_SUCCESS;
}
@@ -432,7 +428,8 @@ void keyboard_put_char(uint8_t chr, int send_irq)
int keyboard_scan_recovery_pressed(void)
{
- return switches & EC_SWITCH_KEYBOARD_RECOVERY;
+ return host_get_events() &
+ EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY);
}
static int keyboard_get_scan(struct host_cmd_handler_args *args)
@@ -455,7 +452,7 @@ static int keyboard_get_info(struct host_cmd_handler_args *args)
r->rows = 8;
r->cols = KB_OUTPUTS;
- r->switches = switches;
+ r->switches = 0;
args->response_size = sizeof(*r);