Fix serial console output & add more boards

This commit is contained in:
microDev 2020-09-12 17:46:52 +05:30
parent 305bed6d9e
commit 4da478382d
7 changed files with 18 additions and 6 deletions

View File

@ -29,4 +29,8 @@
#define MICROPY_HW_BOARD_NAME "BastWiFi" #define MICROPY_HW_BOARD_NAME "BastWiFi"
#define MICROPY_HW_MCU_NAME "ESP32S2" #define MICROPY_HW_MCU_NAME "ESP32S2"
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0)
#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n"
#define AUTORESET_DELAY_MS 500 #define AUTORESET_DELAY_MS 500

View File

@ -31,4 +31,8 @@
#define MICROPY_HW_NEOPIXEL (&pin_GPIO45) #define MICROPY_HW_NEOPIXEL (&pin_GPIO45)
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0)
#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n"
#define AUTORESET_DELAY_MS 500 #define AUTORESET_DELAY_MS 500

View File

@ -33,6 +33,6 @@
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0)
#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up." #define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n"
#define AUTORESET_DELAY_MS 500 #define AUTORESET_DELAY_MS 500

View File

@ -33,6 +33,6 @@
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0)
#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up." #define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n"
#define AUTORESET_DELAY_MS 500 #define AUTORESET_DELAY_MS 500

View File

@ -34,6 +34,6 @@
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0)
#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up." #define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n"
#define AUTORESET_DELAY_MS 500 #define AUTORESET_DELAY_MS 500

View File

@ -29,6 +29,10 @@
#define MICROPY_HW_BOARD_NAME "FeatherS2" #define MICROPY_HW_BOARD_NAME "FeatherS2"
#define MICROPY_HW_MCU_NAME "ESP32S2" #define MICROPY_HW_MCU_NAME "ESP32S2"
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0)
#define BOARD_USER_SAFE_MODE_ACTION "pressing boot button at start up.\n"
#define AUTORESET_DELAY_MS 500 #define AUTORESET_DELAY_MS 500
// Doesn't work with this on. // Doesn't work with this on.

View File

@ -72,7 +72,7 @@ safe_mode_t wait_for_safe_mode_reset(void) {
// Blink on for 100, off for 100, on for 100, off for 100 and on for 200 // Blink on for 100, off for 100, on for 100, off for 100 and on for 200
common_hal_digitalio_digitalinout_set_value(&status_led, diff > 100 && diff / 100 != 2 && diff / 100 != 4); common_hal_digitalio_digitalinout_set_value(&status_led, diff > 100 && diff / 100 != 2 && diff / 100 != 4);
#endif #endif
#ifdef CIRCUITPY_BOOT_BUTTON #ifdef CIRCUITPY_BOOT_BUTTON
if (!common_hal_digitalio_digitalinout_get_value(&boot_button)) { if (!common_hal_digitalio_digitalinout_get_value(&boot_button)) {
return USER_SAFE_MODE; return USER_SAFE_MODE;
} }
@ -120,11 +120,11 @@ void print_safe_mode_message(safe_mode_t reason) {
// Output a user safe mode string if it's set. // Output a user safe mode string if it's set.
serial_write_compressed(translate("You requested starting safe mode by ")); serial_write_compressed(translate("You requested starting safe mode by "));
serial_write_compressed(translate(BOARD_USER_SAFE_MODE_ACTION)); serial_write_compressed(translate(BOARD_USER_SAFE_MODE_ACTION));
serial_write_compressed(translate("\nTo exit, please reset the board without ")); serial_write_compressed(translate("To exit, please reset the board without "));
serial_write_compressed(translate(BOARD_USER_SAFE_MODE_ACTION)); serial_write_compressed(translate(BOARD_USER_SAFE_MODE_ACTION));
serial_write("\n");
#else #else
// fallthrough // fallthrough
serial_write_compressed(translate("CircuitPython is in safe mode with status being USER_SAFE_MODE but no specific reason was provided.\n"));
#endif #endif
return; return;
case MANUAL_SAFE_MODE: case MANUAL_SAFE_MODE: