diff options
author | Myles Watson <mylesgw@chromium.org> | 2015-02-19 15:58:31 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-03-02 21:37:13 +0000 |
commit | 1f6f5d5333c34ddcb8337defa93f2c3ad3705c02 (patch) | |
tree | db26b8277044d56a440341423651593ad54f7343 /chip/nrf51/gpio.c | |
parent | 65f049b977016273f93491f0d8b2c2d0a7549819 (diff) | |
download | chrome-ec-1f6f5d5333c34ddcb8337defa93f2c3ad3705c02.tar.gz |
nrf51: Reset clean up.
Use the values from the datasheet to report the reset reason.
TEST=hard reset, soft reset, wake from sleep with a GPIO
BRANCH=NONE
BUG=None
Signed-off-by: Myles Watson <mylesgw@chromium.org>
Change-Id: I2a45741c9c17f0c2e4eb4b8b12d3231f407244dd
Reviewed-on: https://chromium-review.googlesource.com/254112
Tested-by: Myles Watson <mylesgw@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Myles Watson <mylesgw@chromium.org>
Diffstat (limited to 'chip/nrf51/gpio.c')
-rw-r--r-- | chip/nrf51/gpio.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/chip/nrf51/gpio.c b/chip/nrf51/gpio.c index 40f5f03593..ccb453d0c2 100644 --- a/chip/nrf51/gpio.c +++ b/chip/nrf51/gpio.c @@ -126,7 +126,9 @@ void gpio_pre_init(void) int is_warm = 0; int i; - if (NRF51_POWER_RESETREAS & (1 << 2)) { + if (NRF51_POWER_RESETREAS & + (NRF51_POWER_RESETREAS_OFF | /* GPIO Wake */ + NRF51_POWER_RESETREAS_LPCOMP)) { /* This is a warm reboot */ is_warm = 1; } @@ -144,8 +146,7 @@ void gpio_pre_init(void) continue; /* - * If this is a warm reboot, don't set the output levels or - * we'll shut off the AP. + * If this is a warm reboot, don't set the output levels again. */ if (is_warm) flags &= ~(GPIO_LOW | GPIO_HIGH); |