summaryrefslogtreecommitdiff
path: root/cc3200/misc/mperror.c
diff options
context:
space:
mode:
Diffstat (limited to 'cc3200/misc/mperror.c')
-rw-r--r--cc3200/misc/mperror.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/cc3200/misc/mperror.c b/cc3200/misc/mperror.c
index a1c35421e..85ed0a646 100644
--- a/cc3200/misc/mperror.c
+++ b/cc3200/misc/mperror.c
@@ -56,8 +56,6 @@
#define MPERROR_HEARTBEAT_ON_MS (80)
#define MPERROR_HEARTBEAT_OFF_MS (4920)
-#define MPERROR_SAFE_BOOT_REG_IDX (0)
-
/******************************************************************************
DECLARE PRIVATE DATA
******************************************************************************/
@@ -102,7 +100,7 @@ void mperror_init0 (void) {
mperror_heart_beat.beating = false;
}
-void mperror_check_reset_cause (void) {
+void mperror_bootloader_check_reset_cause (void) {
// if we are recovering from a WDT reset, trigger
// a hibernate cycle for a clean boot
if (MAP_PRCMSysResetCauseGet() == PRCM_WDT_RESET) {
@@ -115,6 +113,10 @@ void mperror_check_reset_cause (void) {
UtilsDelay(800);
HWREG(0x4402F024) &= 0xF7FFFFFF;
+ // since the reset cause will be changed, we must store the right reason
+ // so that the application knows we booting the next time
+ PRCMSignalWDTReset();
+
MAP_PRCMHibernateWakeupSourceEnable(PRCM_HIB_SLOW_CLK_CTR);
// set the sleep interval to 10ms
MAP_PRCMHibernateIntervalSet(330);
@@ -136,21 +138,6 @@ void mperror_signal_error (void) {
}
}
-void mperror_request_safe_boot (void) {
- MAP_PRCMOCRRegisterWrite(MPERROR_SAFE_BOOT_REG_IDX, 1);
-}
-
-void mperror_clear_safe_boot (void) {
- MAP_PRCMOCRRegisterWrite(MPERROR_SAFE_BOOT_REG_IDX, 0);
-}
-
-// returns the last state of the safe boot request and clears the register
-bool mperror_safe_boot_requested (void) {
- bool ret = MAP_PRCMOCRRegisterRead(MPERROR_SAFE_BOOT_REG_IDX);
- mperror_clear_safe_boot();
- return ret;
-}
-
void mperror_enable_heartbeat (void) {
mperror_heart_beat.enabled = true;
}