Tweak blink and treat SWD reset like reset button

This commit is contained in:
Scott Shawcroft 2021-07-14 16:45:47 -07:00
parent e0919c4b9c
commit 4d3a355f0a
No known key found for this signature in database
GPG Key ID: 0DFD512649C052DA
2 changed files with 6 additions and 3 deletions

View File

@ -176,8 +176,8 @@ void supervisor_bluetooth_init(void) {
}
while (diff < 1000) {
#ifdef CIRCUITPY_STATUS_LED
// Blink on for 100, off for 100, on for 100, off for 100 and on for 200
bool led_on = ble_mode != 0 || (diff % 150) <= 75;
// Blink on for 50 and off for 100
bool led_on = ble_mode != 0 || (diff % 150) <= 50;
if (led_on) {
new_status_color(0x0000ff);
} else {

View File

@ -55,12 +55,15 @@ safe_mode_t wait_for_safe_mode_reset(void) {
port_set_saved_word(SAFE_MODE_DATA_GUARD);
current_safe_mode = safe_mode;
return safe_mode;
} else {
current_safe_mode = 0;
}
const mcu_reset_reason_t reset_reason = common_hal_mcu_processor_get_reset_reason();
if (reset_reason != RESET_REASON_POWER_ON &&
reset_reason != RESET_REASON_RESET_PIN &&
reset_reason != RESET_REASON_UNKNOWN) {
reset_reason != RESET_REASON_UNKNOWN &&
reset_reason != RESET_REASON_SOFTWARE) {
return NO_SAFE_MODE;
}
port_set_saved_word(SAFE_MODE_DATA_GUARD | (MANUAL_SAFE_MODE << 8));