From 1ac5190ea52d8b42e7ee4eaf6d287124411e3af8 Mon Sep 17 00:00:00 2001 From: fruchti Date: Sat, 18 Jul 2020 17:09:33 +0200 Subject: [PATCH] Enable extra warnings --- build-number.txt | 2 +- makefile | 2 +- src/ltp1245.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build-number.txt b/build-number.txt index 68d5f38..2e9c1e1 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -553 +558 diff --git a/makefile b/makefile index 1400615..be02aa3 100644 --- a/makefile +++ b/makefile @@ -23,7 +23,7 @@ endif CFLAGS = -mcpu=cortex-m3 -mthumb \ -Os -fno-common -Werror \ -nostartfiles \ - -Wall -Xlinker --gc-sections \ + -Wall -Wextra -Xlinker --gc-sections \ -D$(H_DEVICE) -D_DEFAULT_SOURCE -T$(LD_SCRIPT) \ -Wl,-Map=$(BUILD_DIR)/$(PROJECT).map -std=c99 \ $(addprefix -I,$(SOURCE_DIRS) $(INCLUDE_DIRS)) $(DEBUG_FLAGS) diff --git a/src/ltp1245.c b/src/ltp1245.c index 7454508..5ca134a 100644 --- a/src/ltp1245.c +++ b/src/ltp1245.c @@ -413,7 +413,7 @@ void ADC1_2_IRQHandler(void) // Find first temperature higher than the measured one int lower_entry = 0; - for(int i = 1; i < sizeof(READINGS) / sizeof(READINGS[0]); i++) + for(unsigned int i = 1; i < sizeof(READINGS) / sizeof(READINGS[0]); i++) { if(adc >= READINGS[i]) { @@ -421,7 +421,7 @@ void ADC1_2_IRQHandler(void) break; } } - int higher_entry = lower_entry + 1; + unsigned int higher_entry = lower_entry + 1; int temp = lower_entry * 5 - 40; // Temperature in °C // Interpolate linearly