Skip to content

Commit

Permalink
treat CPU reset as POR
Browse files Browse the repository at this point in the history
  • Loading branch information
dbuentello committed Sep 5, 2016
1 parent 31c441d commit 836d714
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions common/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,7 @@ inline static void wdt_reset(u32 clock_channel) {
WDT->CONFIG.reg = 0x7; // 31ms
WDT->CTRL.reg = WDT_CTRL_ENABLE;
}

inline static void sys_reset() {
NVIC_SystemReset();
}
2 changes: 1 addition & 1 deletion firmware/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void boot_delay_ms(int delay){
}

int main(void) {
if (PM->RCAUSE.reg & (PM_RCAUSE_POR | PM_RCAUSE_BOD12 | PM_RCAUSE_BOD33)) {
if (PM->RCAUSE.reg & (PM_RCAUSE_POR | PM_RCAUSE_BOD12 | PM_RCAUSE_BOD33 | PM_RCAUSE_SYST)) {
// On powerup, force a clean reset of the MT7620
pin_low(PIN_SOC_RST);
pin_out(PIN_SOC_RST);
Expand Down

0 comments on commit 836d714

Please sign in to comment.