Support brownout to safe mode. Fixes #870
This commit is contained in:
parent
6479cb0806
commit
f38ce1060c
@ -203,9 +203,16 @@ safe_mode_t port_init(void) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// if (PM->RCAUSE.bit.BOD33 == 1 || PM->RCAUSE.bit.BOD12 == 1) {
|
#ifdef SAMD21
|
||||||
// return BROWNOUT;
|
if (PM->RCAUSE.bit.BOD33 == 1 || PM->RCAUSE.bit.BOD12 == 1) {
|
||||||
// }
|
return BROWNOUT;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef SAMD51
|
||||||
|
if (RSTC->RCAUSE.bit.BODVDD == 1 || RSTC->RCAUSE.bit.BODCORE == 1) {
|
||||||
|
return BROWNOUT;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (board_requests_safe_mode()) {
|
if (board_requests_safe_mode()) {
|
||||||
return USER_SAFE_MODE;
|
return USER_SAFE_MODE;
|
||||||
|
Loading…
Reference in New Issue
Block a user