summaryrefslogtreecommitdiff
path: root/supervisor/shared/safe_mode.c
diff options
context:
space:
mode:
Diffstat (limited to 'supervisor/shared/safe_mode.c')
-rw-r--r--supervisor/shared/safe_mode.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c
index 905a0c408..7630010d0 100644
--- a/supervisor/shared/safe_mode.c
+++ b/supervisor/shared/safe_mode.c
@@ -29,6 +29,9 @@
#include "mphalport.h"
#include "shared-bindings/digitalio/DigitalInOut.h"
+#if CIRCUITPY_ALARM
+#include "shared-bindings/alarm/ResetReason.h"
+#endif
#include "supervisor/serial.h"
#include "supervisor/shared/rgb_led_colors.h"
@@ -52,10 +55,12 @@ safe_mode_t wait_for_safe_mode_reset(void) {
current_safe_mode = safe_mode;
return safe_mode;
}
- if (common_hal_sleep_get_reset_reason() != RESET_REASON_POWER_VALID &&
- common_hal_sleep_get_reset_reason() != RESET_REASON_BUTTON) {
+#if CIRCUITPY_ALARM
+ if (common_hal_alarm_get_reset_reason() != RESET_REASON_POWER_ON &&
+ common_hal_alarm_get_reset_reason() != RESET_REASON_RESET_PIN) {
return NO_SAFE_MODE;
}
+#endif
port_set_saved_word(SAFE_MODE_DATA_GUARD | (MANUAL_SAFE_MODE << 8));
// Wait for a while to allow for reset.
temp_status_color(SAFE_MODE);