diff options
author | Maximilien Cuony <maximilien@theglu.org> | 2016-06-06 18:49:25 +0200 |
---|---|---|
committer | Maximilien Cuony <maximilien@theglu.org> | 2016-06-06 18:49:25 +0200 |
commit | e2e1af13be32fe00f98135beb62617ea0bba7bc8 (patch) | |
tree | 5ff81acadb2f5b9d7fee2269d746253a1f6bad49 /src/glutt-o-logique | |
parent | 2e4b80bc0fdae03f6e00b76000c16d12682e0479 (diff) | |
download | glutte-o-matic-e2e1af13be32fe00f98135beb62617ea0bba7bc8.tar.gz glutte-o-matic-e2e1af13be32fe00f98135beb62617ea0bba7bc8.tar.bz2 glutte-o-matic-e2e1af13be32fe00f98135beb62617ea0bba7bc8.zip |
Fix warnings, add more warnings flags, normalize makefiles
Diffstat (limited to 'src/glutt-o-logique')
-rw-r--r-- | src/glutt-o-logique/Makefile | 44 | ||||
-rw-r--r-- | src/glutt-o-logique/audio.c | 2 | ||||
-rw-r--r-- | src/glutt-o-logique/common.c | 1 | ||||
-rw-r--r-- | src/glutt-o-logique/cw.c | 1 | ||||
-rw-r--r-- | src/glutt-o-logique/debug.c | 7 | ||||
-rw-r--r-- | src/glutt-o-logique/debug.h | 4 | ||||
-rw-r--r-- | src/glutt-o-logique/ds18b20/tm_stm32f4_onewire.h | 4 | ||||
-rw-r--r-- | src/glutt-o-logique/main.c | 2 | ||||
-rw-r--r-- | src/glutt-o-logique/pio.c | 2 | ||||
-rw-r--r-- | src/glutt-o-logique/temperature.c | 7 | ||||
-rw-r--r-- | src/glutt-o-logique/usart.c | 4 |
11 files changed, 61 insertions, 17 deletions
diff --git a/src/glutt-o-logique/Makefile b/src/glutt-o-logique/Makefile index 6762514..b7c2b9a 100644 --- a/src/glutt-o-logique/Makefile +++ b/src/glutt-o-logique/Makefile @@ -40,7 +40,24 @@ MCFLAGS=-mcpu=cortex-m4 -mthumb -mlittle-endian \ # COMPILE FLAGS DEFS=-DUSE_STDPERIPH_DRIVER -DSTM32F4XX -DARM_MATH_CM4 -D__FPU_PRESENT=1 -CFLAGS =-Wall -ggdb -std=c99 -c $(MCFLAGS) $(DEFS) $(INCLUDES) +CWARNS += -Wextra +CWARNS += -Wformat +CWARNS += -Wmissing-braces +CWARNS += -Wno-cast-align +CWARNS += -Wparentheses +CWARNS += -Wshadow +CWARNS += -Wno-sign-compare +CWARNS += -Wswitch +CWARNS += -Wuninitialized +CWARNS += -Wunknown-pragmas +CWARNS += -Wunused-function +CWARNS += -Wunused-label +CWARNS += -Wunused-parameter +CWARNS += -Wunused-value +CWARNS += -Wunused-variable +CWARNS += -Wmissing-prototypes + +CFLAGS =-Wall $(CWARNS) -ggdb -std=c99 -c $(MCFLAGS) $(DEFS) $(INCLUDES) # LINKER FLAGS LDSCRIPT= $(SRCDIR)/bsp/stm32_flash.ld LDFLAGS =-T $(LDSCRIPT) --specs=nosys.specs $(MCFLAGS) -Wl,-Map=$(BINDIR)/outp.map @@ -101,17 +118,20 @@ debug: LDFLAGS+=-g debug: release $(BINDIR)/$(BINHEX): $(BINDIR)/$(BINELF) - $(CP) -O ihex $< $@ + @$(CP) -O ihex $< $@ + @echo "[CP] $@" + @echo "[:)] Happiness :)" $(BINDIR)/$(BINELF): vc.h $(OBJECTS) - $(CC) $(LDFLAGS) $(OBJECTS) -o $@ - $(SIZE) $(BINDIR)/$(BINELF) + @$(CC) $(LDFLAGS) $(OBJECTS) -o $@ + @echo "[CC] $@" + @$(SIZE) $(BINDIR)/$(BINELF) dir_guard=@mkdir -p $(@D) obj/%.o: %.c $(HEADERS) $(dir_guard) - @echo [CC] $< + @echo "[CC] $<" @$(CC) $(CFLAGS) $< -o $@ obj/%.o: %.s $(HEADERS) @@ -120,14 +140,16 @@ obj/%.o: %.s $(HEADERS) @$(CC) $(CFLAGS) $< -o $@ vc.h: ../../.git/logs/HEAD - echo "// This file is generated by Makefile." > vc.h - echo "// Do not edit this file!" >> vc.h - git log -1 --format="format:#define GIT_VERSION \"%h\"" >> vc.h - echo >> vc.h - echo >> vc.h + @echo "// This file is generated by Makefile." > vc.h + @echo "// Do not edit this file!" >> vc.h + @git log -1 --format="format:#define GIT_VERSION \"%h\"" >> vc.h + @echo >> vc.h + @echo >> vc.h + @echo [EC] vc.h clean: - rm -f $(OBJECTS) $(BINDIR)/$(BINELF) $(BINDIR)/$(BINHEX) + @rm -f $(OBJECTS) $(BINDIR)/$(BINELF) $(BINDIR)/$(BINHEX) + @echo "[RM] Cleanuped °o°" # Connect to openocd's gdb server on port 3333 deploy: $(BINDIR)/$(BINELF) diff --git a/src/glutt-o-logique/audio.c b/src/glutt-o-logique/audio.c index bf41169..0576d30 100644 --- a/src/glutt-o-logique/audio.c +++ b/src/glutt-o-logique/audio.c @@ -29,7 +29,7 @@ static void audio_write_register(uint8_t address, uint8_t value); -void audio_initialize_platform(int plln, int pllr, int i2sdiv, int i2sodd, int rate) { +void audio_initialize_platform(int plln, int pllr, int i2sdiv, int i2sodd, int __attribute__ ((unused)) rate) { GPIO_InitTypeDef GPIO_InitStructure; diff --git a/src/glutt-o-logique/common.c b/src/glutt-o-logique/common.c index d089091..ed3a3a8 100644 --- a/src/glutt-o-logique/common.c +++ b/src/glutt-o-logique/common.c @@ -24,6 +24,7 @@ #include <stm32f4xx.h> #include "GPIO/usart.h" +#include "Core/common.h" void hard_fault_handler_c(uint32_t *hardfault_args) { diff --git a/src/glutt-o-logique/cw.c b/src/glutt-o-logique/cw.c index c362f6a..417359f 100644 --- a/src/glutt-o-logique/cw.c +++ b/src/glutt-o-logique/cw.c @@ -23,6 +23,7 @@ */ #include "GPIO/usart.h" +#include "Audio/cw.h" // Function to display message in GUI, unused on STM32 firmware void cw_message_sent(const char* str) { diff --git a/src/glutt-o-logique/debug.c b/src/glutt-o-logique/debug.c index 2e33a32..0c12c8b 100644 --- a/src/glutt-o-logique/debug.c +++ b/src/glutt-o-logique/debug.c @@ -69,9 +69,10 @@ void debug_print(const char* str) } #else -void debug_send_command(int command, void *message) { } -void put_char(char c) { } -void debug_print(const char* str) { } +void USART3_IRQHandler(void); +void debug_send_command(int __attribute__ ((unused))command, void __attribute__ ((unused))*message) { } +void put_char(char __attribute__ ((unused))c) { } +void debug_print(const char __attribute__ ((unused))*str) { } #endif diff --git a/src/glutt-o-logique/debug.h b/src/glutt-o-logique/debug.h index 6215e5f..59d0a84 100644 --- a/src/glutt-o-logique/debug.h +++ b/src/glutt-o-logique/debug.h @@ -43,5 +43,9 @@ send_command(0x05, m); /* Print a string to the OpenOCD console */ void debug_print(const char* str); + +void debug_send_command(int, void*); +void put_char(char); + #endif // __DEBUG_H_ diff --git a/src/glutt-o-logique/ds18b20/tm_stm32f4_onewire.h b/src/glutt-o-logique/ds18b20/tm_stm32f4_onewire.h index 9b14109..f906566 100644 --- a/src/glutt-o-logique/ds18b20/tm_stm32f4_onewire.h +++ b/src/glutt-o-logique/ds18b20/tm_stm32f4_onewire.h @@ -290,6 +290,10 @@ uint8_t TM_OneWire_CRC8(uint8_t* addr, uint8_t len); /**
* @}
*/
+
+int TM_OneWire_Verify(TM_OneWire_t*);
+void TM_OneWire_TargetSetup(TM_OneWire_t*, uint8_t);
+void TM_OneWire_FamilySkipSetup(TM_OneWire_t*);
/* C++ detection */
#ifdef __cplusplus
diff --git a/src/glutt-o-logique/main.c b/src/glutt-o-logique/main.c index 6d4597e..8152926 100644 --- a/src/glutt-o-logique/main.c +++ b/src/glutt-o-logique/main.c @@ -26,6 +26,8 @@ #include "leds.h" +void init(void); + void init() { /* Initialise the onboard peripherals * Four LEDs and one push-button diff --git a/src/glutt-o-logique/pio.c b/src/glutt-o-logique/pio.c index c003881..b389a0b 100644 --- a/src/glutt-o-logique/pio.c +++ b/src/glutt-o-logique/pio.c @@ -125,7 +125,7 @@ void pio_set_fsm_signals(struct fsm_input_signals_t* sig) *sig = pio_signals; } -void read_fsm_input_task(void *pvParameters) +void read_fsm_input_task(void __attribute__ ((unused))*pvParameters) { while (1) { pio_signals.qrp = diff --git a/src/glutt-o-logique/temperature.c b/src/glutt-o-logique/temperature.c index b9f7d87..2ca5f5c 100644 --- a/src/glutt-o-logique/temperature.c +++ b/src/glutt-o-logique/temperature.c @@ -42,6 +42,11 @@ const TickType_t _temperature_delay = 60000 / portTICK_PERIOD_MS; // 60s static TM_OneWire_t tm_onewire; +void ds18b20_init(void); +int ds18b20_gettemp(float*); +int ds18b20_gettemp_one(float*); + + void ds18b20_init() { RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE); @@ -97,7 +102,7 @@ int ds18b20_gettemp(float *temperature) { return status; } -void temperature_task(void *pvParameters) { +void temperature_task(void __attribute__ ((unused))*pvParameters) { while (1) { diff --git a/src/glutt-o-logique/usart.c b/src/glutt-o-logique/usart.c index 4bef27a..0b02ec5 100644 --- a/src/glutt-o-logique/usart.c +++ b/src/glutt-o-logique/usart.c @@ -39,6 +39,10 @@ const uint16_t GPIOA_PIN_USART2_TX = GPIO_Pin_2; #include "../common/includes/GPIO/usart.h" +void USART2_IRQHandler(void); +void USART3_IRQHandler(void); + + void usart_init() { // ============== PC DEBUG USART =========== RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE); |