changed boot counter #ifdef to safer #if

This commit is contained in:
Max Holliday 2021-09-17 14:40:16 -06:00
parent 818020d4c9
commit f16a4754ba
3 changed files with 7 additions and 5 deletions

4
main.c
View File

@ -107,7 +107,7 @@
#include "shared-bindings/wifi/__init__.h" #include "shared-bindings/wifi/__init__.h"
#endif #endif
#ifdef CIRCUITPY_BOOT_COUNTER #if CIRCUITPY_BOOT_COUNTER
#include "shared-bindings/nvm/ByteArray.h" #include "shared-bindings/nvm/ByteArray.h"
uint8_t value_out = 0; uint8_t value_out = 0;
#endif #endif
@ -801,7 +801,7 @@ 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 #if CIRCUITPY_BOOT_COUNTER
// Increment counter before possibly entering safe mode // Increment counter before possibly entering safe mode
common_hal_nvm_bytearray_get_bytes(&common_hal_mcu_nvm_obj,0,1,&value_out); common_hal_nvm_bytearray_get_bytes(&common_hal_mcu_nvm_obj,0,1,&value_out);
++value_out; ++value_out;

View File

@ -554,7 +554,11 @@ void supervisor_run_background_tasks_if_tick(void);
#define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt" #define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt"
#if !defined(CIRCUITPY_INTERNAL_NVM_SIZE) && defined(CIRCUITPY_BOOT_COUNTER) #ifndef CIRCUITPY_BOOT_COUNTER
#define CIRCUITPY_BOOT_COUNTER 0
#endif
#if !defined(CIRCUITPY_INTERNAL_NVM_SIZE) && CIRCUITPY_BOOT_COUNTER != 0
#error "boot counter requires CIRCUITPY_NVM enabled" #error "boot counter requires CIRCUITPY_NVM enabled"
#endif #endif

View File

@ -35,9 +35,7 @@ DEFAULT_IGNORELIST = [
"circuitplayground_express_displayio", "circuitplayground_express_displayio",
"pycubed", "pycubed",
"pycubed_mram", "pycubed_mram",
"pycubed_v04",
"pycubed_v05", "pycubed_v05",
"pycubed_mram_v04",
"pycubed_mram_v05", "pycubed_mram_v05",
"pygamer", "pygamer",
"pygamer_advance", "pygamer_advance",