Skip to content

Commit f16a475

Browse files
committed
changed boot counter #ifdef to safer #if
1 parent 818020d commit f16a475

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
#include "shared-bindings/wifi/__init__.h"
108108
#endif
109109

110-
#ifdef CIRCUITPY_BOOT_COUNTER
110+
#if CIRCUITPY_BOOT_COUNTER
111111
#include "shared-bindings/nvm/ByteArray.h"
112112
uint8_t value_out = 0;
113113
#endif
@@ -801,7 +801,7 @@ int __attribute__((used)) main(void) {
801801
// Turn on RX and TX LEDs if we have them.
802802
init_rxtx_leds();
803803

804-
#ifdef CIRCUITPY_BOOT_COUNTER
804+
#if CIRCUITPY_BOOT_COUNTER
805805
// Increment counter before possibly entering safe mode
806806
common_hal_nvm_bytearray_get_bytes(&common_hal_mcu_nvm_obj,0,1,&value_out);
807807
++value_out;

py/circuitpy_mpconfig.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,11 @@ void supervisor_run_background_tasks_if_tick(void);
554554

555555
#define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt"
556556

557-
#if !defined(CIRCUITPY_INTERNAL_NVM_SIZE) && defined(CIRCUITPY_BOOT_COUNTER)
557+
#ifndef CIRCUITPY_BOOT_COUNTER
558+
#define CIRCUITPY_BOOT_COUNTER 0
559+
#endif
560+
561+
#if !defined(CIRCUITPY_INTERNAL_NVM_SIZE) && CIRCUITPY_BOOT_COUNTER != 0
558562
#error "boot counter requires CIRCUITPY_NVM enabled"
559563
#endif
560564

tools/ci_check_duplicate_usb_vid_pid.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
"circuitplayground_express_displayio",
3636
"pycubed",
3737
"pycubed_mram",
38-
"pycubed_v04",
3938
"pycubed_v05",
40-
"pycubed_mram_v04",
4139
"pycubed_mram_v05",
4240
"pygamer",
4341
"pygamer_advance",

0 commit comments

Comments
 (0)