From f16a4754bae32bcbfb575749c829490a3ae66795 Mon Sep 17 00:00:00 2001 From: Max Holliday Date: Fri, 17 Sep 2021 14:40:16 -0600 Subject: [PATCH] changed boot counter #ifdef to safer #if --- main.c | 4 ++-- py/circuitpy_mpconfig.h | 6 +++++- tools/ci_check_duplicate_usb_vid_pid.py | 2 -- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index fed05677ae..2f39b0eb37 100755 --- a/main.c +++ b/main.c @@ -107,7 +107,7 @@ #include "shared-bindings/wifi/__init__.h" #endif -#ifdef CIRCUITPY_BOOT_COUNTER +#if CIRCUITPY_BOOT_COUNTER #include "shared-bindings/nvm/ByteArray.h" uint8_t value_out = 0; #endif @@ -801,7 +801,7 @@ int __attribute__((used)) main(void) { // Turn on RX and TX LEDs if we have them. init_rxtx_leds(); - #ifdef CIRCUITPY_BOOT_COUNTER + #if 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; diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 803fc1dbdf..2ec0d2a849 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -554,7 +554,11 @@ void supervisor_run_background_tasks_if_tick(void); #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" #endif diff --git a/tools/ci_check_duplicate_usb_vid_pid.py b/tools/ci_check_duplicate_usb_vid_pid.py index d850850149..6f15a28c46 100644 --- a/tools/ci_check_duplicate_usb_vid_pid.py +++ b/tools/ci_check_duplicate_usb_vid_pid.py @@ -35,9 +35,7 @@ DEFAULT_IGNORELIST = [ "circuitplayground_express_displayio", "pycubed", "pycubed_mram", - "pycubed_v04", "pycubed_v05", - "pycubed_mram_v04", "pycubed_mram_v05", "pygamer", "pygamer_advance",