From ce55822680b3b4005f370bbd735d50402cd48925 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 4 Jan 2021 15:50:09 -0600 Subject: Fix size of memset in board_reset_user_neopixels() --- supervisor/shared/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'supervisor') diff --git a/supervisor/shared/board.c b/supervisor/shared/board.c index 30603aa66..6d648510e 100644 --- a/supervisor/shared/board.c +++ b/supervisor/shared/board.c @@ -36,7 +36,7 @@ void board_reset_user_neopixels(const mcu_pin_obj_t* pin, size_t count) { // Turn off on-board NeoPixel string uint8_t empty[count * 3]; - memset(empty, 0, count); + memset(empty, 0, count * 3); digitalio_digitalinout_obj_t neopixel_pin; common_hal_digitalio_digitalinout_construct(&neopixel_pin, pin); common_hal_digitalio_digitalinout_switch_to_output(&neopixel_pin, false, -- cgit v1.2.3 From 255ffa979cd62063bcbabbc64e3c4fb8d1c0f216 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 Jan 2021 22:16:58 -0500 Subject: avoid inline compile errors --- py/circuitpy_defns.mk | 8 ++++++++ supervisor/shared/translate.c | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'supervisor') diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index d6d192a95..8e8751036 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -58,6 +58,14 @@ BASE_CFLAGS = \ # -H +# Set a global CIRCUITPY_DEBUG flag. +# Don't just call it "DEBUG": too many libraries use plain DEBUG. +ifneq ($(DEBUG),) +CFLAGS += -DCIRCUITPY_DEBUG=$(DEBUG) +else +CFLAGS += -DCIRCUITPY_DEBUG=0 +endif + ### # Handle frozen modules. diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate.c index 44544c98d..8bd3c5acd 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate.c @@ -122,7 +122,12 @@ char* decompress(const compressed_string_t* compressed, char* decompressed) { return decompressed; } -inline __attribute__((always_inline)) const compressed_string_t* translate(const char* original) { +inline +// gcc10 -flto has issues with this being always_inline for debug builds. +#if CIRCUITPY_DEBUG < 1 + __attribute__((always_inline)) +#endif +const compressed_string_t* translate(const char* original) { #ifndef NO_QSTR #define QDEF(id, str) #define TRANSLATION(id, firstbyte, ...) if (strcmp(original, id) == 0) { static const compressed_string_t v = { .data = firstbyte, .tail = { __VA_ARGS__ } }; return &v; } else -- cgit v1.2.3 From 9e9291777f5fe3bb6f1545c62cb7285268f61cda Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Mon, 11 Jan 2021 16:09:05 -0500 Subject: Update created code.py file formatting. --- supervisor/shared/filesystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'supervisor') diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index 88603be0c..184c67b5f 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -74,7 +74,7 @@ static void make_sample_code_file(FATFS *fatfs) { #if CIRCUITPY_FULL_BUILD FIL fs; UINT char_written = 0; - const byte buffer[] = "print('Hello World!')\n"; + const byte buffer[] = "print("Hello World!")\n"; //Create or modify existing code.py file f_open(fatfs, &fs, "/code.py", FA_WRITE | FA_CREATE_ALWAYS); f_write(&fs, buffer, sizeof(buffer) - 1, &char_written); -- cgit v1.2.3 From 09596ddca208b2bd337c5e6650e61d1ff972dad4 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Mon, 11 Jan 2021 16:26:27 -0500 Subject: Adding escape characters. --- supervisor/shared/filesystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'supervisor') diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index 184c67b5f..618dc796b 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -74,7 +74,7 @@ static void make_sample_code_file(FATFS *fatfs) { #if CIRCUITPY_FULL_BUILD FIL fs; UINT char_written = 0; - const byte buffer[] = "print("Hello World!")\n"; + const byte buffer[] = "print(\"Hello World!\")\n"; //Create or modify existing code.py file f_open(fatfs, &fs, "/code.py", FA_WRITE | FA_CREATE_ALWAYS); f_write(&fs, buffer, sizeof(buffer) - 1, &char_written); -- cgit v1.2.3