diff --git a/Makefile b/Makefile index d6054c7..9fde372 100644 --- a/Makefile +++ b/Makefile @@ -230,8 +230,13 @@ CFLAGS += \ -Wall \ -Werror \ -Wfatal-errors \ + -Wextra -CFLAGS += -Wno-error=unused-parameter +# Suppress warning caused by SDK +CFLAGS += -Wno-error=unused-parameter -Wno-error=expansion-to-defined + +# TinyUSB tusb_hal_nrf_power_event +CFLAGS += -Wno-error=cast-function-type # Defined Symbol (MACROS) CFLAGS += -D__HEAP_SIZE=0 diff --git a/src/usb/uf2/compile_date.h b/src/usb/uf2/compile_date.h index d16f4ad..7175c83 100644 --- a/src/usb/uf2/compile_date.h +++ b/src/usb/uf2/compile_date.h @@ -50,22 +50,22 @@ SOFTWARE. : 12u /*Dec*/ ) #define __DAY_INT__ ( \ - (__DATE__ [4u] == ' ' ? 0u : __DATE__ [4u] - '0') * 10u \ + (__DATE__ [4u] == ' ' ? 0 : __DATE__ [4u] - '0') * 10u \ + (__DATE__ [5u] - '0') ) // __TIME__ expands to an eight-character string constant // "23:59:01", or (if cannot determine time) "??:??:??" #define __HOUR_INT__ ( \ - (__TIME__ [0u] == '?' ? 0u : __TIME__ [0u] - '0') * 10u \ - + (__TIME__ [1u] == '?' ? 0u : __TIME__ [1u] - '0') ) + (__TIME__ [0u] == '?' ? 0 : __TIME__ [0u] - '0') * 10u \ + + (__TIME__ [1u] == '?' ? 0 : __TIME__ [1u] - '0') ) #define __MINUTE_INT__ ( \ - (__TIME__ [3u] == '?' ? 0u : __TIME__ [3u] - '0') * 10u \ - + (__TIME__ [4u] == '?' ? 0u : __TIME__ [4u] - '0') ) + (__TIME__ [3u] == '?' ? 0 : __TIME__ [3u] - '0') * 10u \ + + (__TIME__ [4u] == '?' ? 0 : __TIME__ [4u] - '0') ) #define __SECONDS_INT__ ( \ - (__TIME__ [6u] == '?' ? 0u : __TIME__ [6u] - '0') * 10u \ - + (__TIME__ [7u] == '?' ? 0u : __TIME__ [7u] - '0') ) + (__TIME__ [6u] == '?' ? 0 : __TIME__ [6u] - '0') * 10u \ + + (__TIME__ [7u] == '?' ? 0 : __TIME__ [7u] - '0') ) #define __DOSDATE__ ( \ diff --git a/src/usb/uf2/ghostfat.c b/src/usb/uf2/ghostfat.c index 498c61e..28f1e0a 100644 --- a/src/usb/uf2/ghostfat.c +++ b/src/usb/uf2/ghostfat.c @@ -214,11 +214,11 @@ void read_block(uint32_t block_no, uint8_t *data) { // WARNING -- code presumes only one NULL .content for .UF2 file // and all non-NULL .content fit in one sector // and requires it be the last element of the array - for (int i = 1; i < NUM_FILES * 2 + 4; ++i) { + for (uint32_t i = 1; i < NUM_FILES * 2 + 4; ++i) { data[i] = 0xff; } } - for (int i = 0; i < 256; ++i) { // Generate the FAT chain for the firmware "file" + for (uint32_t i = 0; i < 256; ++i) { // Generate the FAT chain for the firmware "file" uint32_t v = sectionIdx * 256 + i; if (UF2_FIRST_SECTOR <= v && v <= UF2_LAST_SECTOR) ((uint16_t *)(void *)data)[i] = v == UF2_LAST_SECTOR ? 0xffff : v + 1; @@ -237,7 +237,7 @@ void read_block(uint32_t block_no, uint8_t *data) { remainingEntries--; } - for (int i = DIRENTRIES_PER_SECTOR * sectionIdx; + for (uint32_t i = DIRENTRIES_PER_SECTOR * sectionIdx; remainingEntries > 0 && i < NUM_FILES; i++, d++) {