Skip to content

Commit 4f10a91

Browse files
committed
moving boot counter to main() and re-adding old pin names for SD_CS
1 parent 5b69aa0 commit 4f10a91

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

main.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,6 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
321321
}
322322
#endif
323323

324-
#ifdef CIRCUITPY_BOOT_COUNTER
325-
common_hal_nvm_bytearray_get_bytes(&common_hal_mcu_nvm_obj,0,1,&value_out);
326-
++value_out;
327-
common_hal_nvm_bytearray_set_bytes(&common_hal_mcu_nvm_obj,0,&value_out,1);
328-
#endif
329-
330324
pyexec_result_t result;
331325

332326
result.return_code = 0;
@@ -807,6 +801,13 @@ int __attribute__((used)) main(void) {
807801
// Turn on RX and TX LEDs if we have them.
808802
init_rxtx_leds();
809803

804+
#ifdef CIRCUITPY_BOOT_COUNTER
805+
// Increment counter before possibly entering safe mode
806+
common_hal_nvm_bytearray_get_bytes(&common_hal_mcu_nvm_obj,0,1,&value_out);
807+
++value_out;
808+
common_hal_nvm_bytearray_set_bytes(&common_hal_mcu_nvm_obj,0,&value_out,1);
809+
#endif
810+
810811
// Wait briefly to give a reset window where we'll enter safe mode after the reset.
811812
if (safe_mode == NO_SAFE_MODE) {
812813
safe_mode = wait_for_safe_mode_reset();

ports/atmel-samd/boards/pycubed_mram_v04/pins.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
66
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA13) },
77
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) },
88
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA14) },
9+
{ MP_ROM_QSTR(MP_QSTR_xSDCS), MP_ROM_PTR(&pin_PA27) },
910
{ MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA27) },
1011

1112
{ MP_ROM_QSTR(MP_QSTR_RELAY_A), MP_ROM_PTR(&pin_PB15) },

ports/atmel-samd/boards/pycubed_v04/pins.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
66
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA13) },
77
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) },
88
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA14) },
9+
{ MP_ROM_QSTR(MP_QSTR_xSDCS), MP_ROM_PTR(&pin_PA27) },
910
{ MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA27) },
1011

1112
{ MP_ROM_QSTR(MP_QSTR_RELAY_A), MP_ROM_PTR(&pin_PB15) },

tools/ci_check_duplicate_usb_vid_pid.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
"circuitplayground_express",
3434
"circuitplayground_express_crickit",
3535
"circuitplayground_express_displayio",
36+
"pycubed",
37+
"pycubed_mram",
3638
"pycubed_v04",
3739
"pycubed_v05",
3840
"pycubed_mram_v04",

0 commit comments

Comments
 (0)