From 4f10a91f8515fb3096d0817df7442925a43cafc9 Mon Sep 17 00:00:00 2001 From: Max Holliday Date: Wed, 15 Sep 2021 14:33:54 -0600 Subject: [PATCH] moving boot counter to main() and re-adding old pin names for SD_CS --- main.c | 13 +++++++------ ports/atmel-samd/boards/pycubed_mram_v04/pins.c | 1 + ports/atmel-samd/boards/pycubed_v04/pins.c | 1 + tools/ci_check_duplicate_usb_vid_pid.py | 2 ++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index db4051fab8..fed05677ae 100755 --- a/main.c +++ b/main.c @@ -321,12 +321,6 @@ STATIC bool run_code_py(safe_mode_t safe_mode) { } #endif - #ifdef CIRCUITPY_BOOT_COUNTER - common_hal_nvm_bytearray_get_bytes(&common_hal_mcu_nvm_obj,0,1,&value_out); - ++value_out; - common_hal_nvm_bytearray_set_bytes(&common_hal_mcu_nvm_obj,0,&value_out,1); - #endif - pyexec_result_t result; result.return_code = 0; @@ -807,6 +801,13 @@ int __attribute__((used)) main(void) { // Turn on RX and TX LEDs if we have them. init_rxtx_leds(); + #ifdef CIRCUITPY_BOOT_COUNTER + // Increment counter before possibly entering safe mode + common_hal_nvm_bytearray_get_bytes(&common_hal_mcu_nvm_obj,0,1,&value_out); + ++value_out; + common_hal_nvm_bytearray_set_bytes(&common_hal_mcu_nvm_obj,0,&value_out,1); + #endif + // Wait briefly to give a reset window where we'll enter safe mode after the reset. if (safe_mode == NO_SAFE_MODE) { safe_mode = wait_for_safe_mode_reset(); diff --git a/ports/atmel-samd/boards/pycubed_mram_v04/pins.c b/ports/atmel-samd/boards/pycubed_mram_v04/pins.c index a71fbdf204..76532c4323 100644 --- a/ports/atmel-samd/boards/pycubed_mram_v04/pins.c +++ b/ports/atmel-samd/boards/pycubed_mram_v04/pins.c @@ -6,6 +6,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_xSDCS), MP_ROM_PTR(&pin_PA27) }, { MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA27) }, { MP_ROM_QSTR(MP_QSTR_RELAY_A), MP_ROM_PTR(&pin_PB15) }, diff --git a/ports/atmel-samd/boards/pycubed_v04/pins.c b/ports/atmel-samd/boards/pycubed_v04/pins.c index a71fbdf204..76532c4323 100644 --- a/ports/atmel-samd/boards/pycubed_v04/pins.c +++ b/ports/atmel-samd/boards/pycubed_v04/pins.c @@ -6,6 +6,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_xSDCS), MP_ROM_PTR(&pin_PA27) }, { MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA27) }, { MP_ROM_QSTR(MP_QSTR_RELAY_A), MP_ROM_PTR(&pin_PB15) }, diff --git a/tools/ci_check_duplicate_usb_vid_pid.py b/tools/ci_check_duplicate_usb_vid_pid.py index 906eaae6f9..d850850149 100644 --- a/tools/ci_check_duplicate_usb_vid_pid.py +++ b/tools/ci_check_duplicate_usb_vid_pid.py @@ -33,6 +33,8 @@ DEFAULT_IGNORELIST = [ "circuitplayground_express", "circuitplayground_express_crickit", "circuitplayground_express_displayio", + "pycubed", + "pycubed_mram", "pycubed_v04", "pycubed_v05", "pycubed_mram_v04",