Only check for recovery key if reset was triggered by reset pin

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:8573
TEST=manual

1) Hold down refresh key and type 'reboot' from EC console.  Console
should not show "[KB recovery key pressed at init!]"

2) Press power+esc+refresh.  Console SHOULD show the message.

3) Press power+esc.  Console should NOT show the message.

Change-Id: I642a7667b81c8d90c9490b23ce0f3519364427e4
This commit is contained in:
Randall Spangler
2012-04-04 12:16:14 -07:00
parent afe7cda377
commit 206476570d

View File

@@ -13,6 +13,7 @@
#include "lpc.h"
#endif
#include "registers.h"
#include "system.h"
#include "task.h"
#include "timer.h"
#include "uart.h"
@@ -355,9 +356,13 @@ int keyboard_scan_init(void)
* key mask properly */
actual_key_mask = actual_key_masks[0];
/* Initialize raw state and check if the recovery key is pressed. */
/* Initialize raw state */
update_key_state();
recovery_key_pressed = check_recovery_key();
/* If we're booting due to a reset-pin-caused reset, check if the
* recovery key is pressed. */
if (system_get_reset_cause() == SYSTEM_RESET_RESET_PIN)
recovery_key_pressed = check_recovery_key();
return EC_SUCCESS;
}