diff --git a/Makefile b/Makefile index 0c11ef5..f9349d1 100644 --- a/Makefile +++ b/Makefile @@ -52,9 +52,9 @@ RM = rm -rf BMP_PORT ?= $(shell ls -1 /dev/cu.usbmodem????????1 | head -1) GDB_BMP = $(GDB) -ex 'target extended-remote $(BMP_PORT)' -ex 'monitor swdp_scan' -ex 'attach 1' -#********************************* +#--------------------------------- # Select the board to build -#********************************* +#--------------------------------- BOARD_LIST = $(sort $(subst src/boards/,,$(wildcard src/boards/*))) ifeq ($(filter $(BOARD),$(BOARD_LIST)),) @@ -125,6 +125,7 @@ C_SRC += $(SDK_PATH)/libraries/util/nrf_assert.c # UART or USB Serial ifeq ($(MCU_SUB_VARIANT),nrf52) + C_SRC += $(SDK_PATH)/libraries/uart/app_uart.c C_SRC += $(SDK_PATH)/drivers_nrf/uart/nrf_drv_uart.c C_SRC += $(SDK_PATH)/drivers_nrf/common/nrf_drv_common.c @@ -223,15 +224,24 @@ CFLAGS += \ -fstack-usage \ -fno-strict-aliasing \ -Wall \ + -Wextra \ -Werror \ -Wfatal-errors \ - -Wextra + -Werror-implicit-function-declaration \ + -Wfloat-equal \ + -Wundef \ + -Wshadow \ + -Wwrite-strings \ + -Wsign-compare \ + -Wmissing-format-attribute \ + -Wno-endif-labels \ + -Wunreachable-code # Suppress warning caused by SDK -CFLAGS += -Wno-error=unused-parameter -Wno-error=expansion-to-defined +CFLAGS += -Wno-unused-parameter -Wno-expansion-to-defined # TinyUSB tusb_hal_nrf_power_event -CFLAGS += -Wno-error=cast-function-type +CFLAGS += -Wno-cast-function-type # Defined Symbol (MACROS) CFLAGS += -D__HEAP_SIZE=0 diff --git a/lib/sdk11/components/libraries/bootloader_dfu/dfu_transport_ble.c b/lib/sdk11/components/libraries/bootloader_dfu/dfu_transport_ble.c index 89c2096..d731d31 100644 --- a/lib/sdk11/components/libraries/bootloader_dfu/dfu_transport_ble.c +++ b/lib/sdk11/components/libraries/bootloader_dfu/dfu_transport_ble.c @@ -967,7 +967,7 @@ static void service_error_handler(uint32_t nrf_error) } -static void ascii_to_utf8(ble_srv_utf8_str_t * p_utf8, char * p_ascii) +static void ascii_to_utf8(ble_srv_utf8_str_t * p_utf8, const char * p_ascii) { p_utf8->length = (uint16_t)strlen(p_ascii); p_utf8->p_str = (uint8_t *)p_ascii; diff --git a/src/boards.c b/src/boards.c index fa68ddd..b4d7ede 100644 --- a/src/boards.c +++ b/src/boards.c @@ -295,7 +295,7 @@ void led_state(uint32_t state) } else if (temp_color_active) { final_color = (uint8_t*)&rgb_color; } - #if LED_NEOPIXEL || defined(LED_RGB_RED_PIN) + #if defined(LED_NEOPIXEL) || defined(LED_RGB_RED_PIN) if (final_color != NULL) { neopixel_write(final_color); } diff --git a/src/nrfx_config.h b/src/nrfx_config.h index 419dc19..b626e00 100644 --- a/src/nrfx_config.h +++ b/src/nrfx_config.h @@ -6,11 +6,19 @@ #define NRFX_POWER_DEFAULT_CONFIG_IRQ_PRIORITY 7 #define NRFX_CLOCK_ENABLED 0 - #define NRFX_NVMC_ENABLED 1 +#define NRFX_PRS_ENABLED 0 + +#define NRFX_PWM_ENABLED 0 +#define NRFX_PWM0_ENABLED 0 +#define NRFX_PWM1_ENABLED 0 +#define NRFX_PWM2_ENABLED 0 +#define NRFX_PWM3_ENABLED 0 + // UART #ifdef NRF52832_XXAA + #define NRFX_UART_ENABLED 1 #define NRFX_UART0_ENABLED 1 diff --git a/src/sdk_config.h b/src/sdk_config.h index 51d9e92..50e8196 100644 --- a/src/sdk_config.h +++ b/src/sdk_config.h @@ -78,10 +78,12 @@ #define UART_DEFAULT_CONFIG_IRQ_PRIORITY 7 #define UART_EASY_DMA_SUPPORT 1 #define UART_LEGACY_SUPPORT 1 +#define UART_CONFIG_LOG_ENABLED 0 #define UART0_ENABLED 1 #define UART0_CONFIG_USE_EASY_DMA 0 + //========================================================== // APP_UART_ENABLED - app_uart - UART driver //========================================================== diff --git a/src/usb/uf2/ghostfat.c b/src/usb/uf2/ghostfat.c index 28f1e0a..e6a2c67 100644 --- a/src/usb/uf2/ghostfat.c +++ b/src/usb/uf2/ghostfat.c @@ -311,10 +311,7 @@ int write_block(uint32_t block_no, uint8_t *data, bool quiet, WriteState *state) if ((bl->flags & UF2_FLAG_NOFLASH) || bl->payloadSize > 256 || (bl->targetAddr & 0xff) || bl->targetAddr < USER_FLASH_START || bl->targetAddr + bl->payloadSize > USER_FLASH_END) { -#if USE_DBG_MSC - if (!quiet) - logval("invalid target addr", bl->targetAddr); -#endif + NRF_LOG_WARNING("Skip block at %x", bl->targetAddr); // this happens when we're trying to re-flash CURRENT.UF2 file previously // copied from a device; we still want to count these blocks to reset properly