moving boot counter to main() and re-adding old pin names for SD_CS

This commit is contained in:
Max Holliday 2021-09-15 14:33:54 -06:00
parent 5b69aa0a58
commit 4f10a91f85
4 changed files with 11 additions and 6 deletions

13
main.c
View File

@ -321,12 +321,6 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
} }
#endif #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; pyexec_result_t result;
result.return_code = 0; result.return_code = 0;
@ -807,6 +801,13 @@ int __attribute__((used)) main(void) {
// Turn on RX and TX LEDs if we have them. // Turn on RX and TX LEDs if we have them.
init_rxtx_leds(); 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. // Wait briefly to give a reset window where we'll enter safe mode after the reset.
if (safe_mode == NO_SAFE_MODE) { if (safe_mode == NO_SAFE_MODE) {
safe_mode = wait_for_safe_mode_reset(); safe_mode = wait_for_safe_mode_reset();

View File

@ -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_SCK), MP_ROM_PTR(&pin_PA13) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) }, { 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_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_SD_CS), MP_ROM_PTR(&pin_PA27) },
{ MP_ROM_QSTR(MP_QSTR_RELAY_A), MP_ROM_PTR(&pin_PB15) }, { MP_ROM_QSTR(MP_QSTR_RELAY_A), MP_ROM_PTR(&pin_PB15) },

View File

@ -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_SCK), MP_ROM_PTR(&pin_PA13) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) }, { 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_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_SD_CS), MP_ROM_PTR(&pin_PA27) },
{ MP_ROM_QSTR(MP_QSTR_RELAY_A), MP_ROM_PTR(&pin_PB15) }, { MP_ROM_QSTR(MP_QSTR_RELAY_A), MP_ROM_PTR(&pin_PB15) },

View File

@ -33,6 +33,8 @@ DEFAULT_IGNORELIST = [
"circuitplayground_express", "circuitplayground_express",
"circuitplayground_express_crickit", "circuitplayground_express_crickit",
"circuitplayground_express_displayio", "circuitplayground_express_displayio",
"pycubed",
"pycubed_mram",
"pycubed_v04", "pycubed_v04",
"pycubed_v05", "pycubed_v05",
"pycubed_mram_v04", "pycubed_mram_v04",