Skip to content

Commit 2128d60

Browse files
committed
enable most warning option, fix all warnings
1 parent 6b3f70d commit 2128d60

File tree

6 files changed

+29
-12
lines changed

6 files changed

+29
-12
lines changed

Makefile

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ RM = rm -rf
5252
BMP_PORT ?= $(shell ls -1 /dev/cu.usbmodem????????1 | head -1)
5353
GDB_BMP = $(GDB) -ex 'target extended-remote $(BMP_PORT)' -ex 'monitor swdp_scan' -ex 'attach 1'
5454

55-
#*********************************
55+
#---------------------------------
5656
# Select the board to build
57-
#*********************************
57+
#---------------------------------
5858
BOARD_LIST = $(sort $(subst src/boards/,,$(wildcard src/boards/*)))
5959

6060
ifeq ($(filter $(BOARD),$(BOARD_LIST)),)
@@ -125,6 +125,7 @@ C_SRC += $(SDK_PATH)/libraries/util/nrf_assert.c
125125

126126
# UART or USB Serial
127127
ifeq ($(MCU_SUB_VARIANT),nrf52)
128+
128129
C_SRC += $(SDK_PATH)/libraries/uart/app_uart.c
129130
C_SRC += $(SDK_PATH)/drivers_nrf/uart/nrf_drv_uart.c
130131
C_SRC += $(SDK_PATH)/drivers_nrf/common/nrf_drv_common.c
@@ -223,15 +224,24 @@ CFLAGS += \
223224
-fstack-usage \
224225
-fno-strict-aliasing \
225226
-Wall \
227+
-Wextra \
226228
-Werror \
227229
-Wfatal-errors \
228-
-Wextra
230+
-Werror-implicit-function-declaration \
231+
-Wfloat-equal \
232+
-Wundef \
233+
-Wshadow \
234+
-Wwrite-strings \
235+
-Wsign-compare \
236+
-Wmissing-format-attribute \
237+
-Wno-endif-labels \
238+
-Wunreachable-code
229239

230240
# Suppress warning caused by SDK
231-
CFLAGS += -Wno-error=unused-parameter -Wno-error=expansion-to-defined
241+
CFLAGS += -Wno-unused-parameter -Wno-expansion-to-defined
232242

233243
# TinyUSB tusb_hal_nrf_power_event
234-
CFLAGS += -Wno-error=cast-function-type
244+
CFLAGS += -Wno-cast-function-type
235245

236246
# Defined Symbol (MACROS)
237247
CFLAGS += -D__HEAP_SIZE=0

lib/sdk11/components/libraries/bootloader_dfu/dfu_transport_ble.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ static void service_error_handler(uint32_t nrf_error)
967967
}
968968

969969

970-
static void ascii_to_utf8(ble_srv_utf8_str_t * p_utf8, char * p_ascii)
970+
static void ascii_to_utf8(ble_srv_utf8_str_t * p_utf8, const char * p_ascii)
971971
{
972972
p_utf8->length = (uint16_t)strlen(p_ascii);
973973
p_utf8->p_str = (uint8_t *)p_ascii;

src/boards.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ void led_state(uint32_t state)
295295
} else if (temp_color_active) {
296296
final_color = (uint8_t*)&rgb_color;
297297
}
298-
#if LED_NEOPIXEL || defined(LED_RGB_RED_PIN)
298+
#if defined(LED_NEOPIXEL) || defined(LED_RGB_RED_PIN)
299299
if (final_color != NULL) {
300300
neopixel_write(final_color);
301301
}

src/nrfx_config.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@
66
#define NRFX_POWER_DEFAULT_CONFIG_IRQ_PRIORITY 7
77

88
#define NRFX_CLOCK_ENABLED 0
9-
109
#define NRFX_NVMC_ENABLED 1
1110

11+
#define NRFX_PRS_ENABLED 0
12+
13+
#define NRFX_PWM_ENABLED 0
14+
#define NRFX_PWM0_ENABLED 0
15+
#define NRFX_PWM1_ENABLED 0
16+
#define NRFX_PWM2_ENABLED 0
17+
#define NRFX_PWM3_ENABLED 0
18+
1219
// UART
1320
#ifdef NRF52832_XXAA
21+
1422
#define NRFX_UART_ENABLED 1
1523
#define NRFX_UART0_ENABLED 1
1624

src/sdk_config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@
7878
#define UART_DEFAULT_CONFIG_IRQ_PRIORITY 7
7979
#define UART_EASY_DMA_SUPPORT 1
8080
#define UART_LEGACY_SUPPORT 1
81+
#define UART_CONFIG_LOG_ENABLED 0
8182

8283
#define UART0_ENABLED 1
8384
#define UART0_CONFIG_USE_EASY_DMA 0
8485

86+
8587
//==========================================================
8688
// <e> APP_UART_ENABLED - app_uart - UART driver
8789
//==========================================================

src/usb/uf2/ghostfat.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,7 @@ int write_block(uint32_t block_no, uint8_t *data, bool quiet, WriteState *state)
311311

312312
if ((bl->flags & UF2_FLAG_NOFLASH) || bl->payloadSize > 256 || (bl->targetAddr & 0xff) ||
313313
bl->targetAddr < USER_FLASH_START || bl->targetAddr + bl->payloadSize > USER_FLASH_END) {
314-
#if USE_DBG_MSC
315-
if (!quiet)
316-
logval("invalid target addr", bl->targetAddr);
317-
#endif
314+
318315
NRF_LOG_WARNING("Skip block at %x", bl->targetAddr);
319316
// this happens when we're trying to re-flash CURRENT.UF2 file previously
320317
// copied from a device; we still want to count these blocks to reset properly

0 commit comments

Comments
 (0)