From d69199e563d5342de7d052cd7f012ae357649324 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Fri, 23 Dec 2011 01:07:48 +0100 Subject: [PATCH] Fix all warnings (except table.c and ff.c). Turn off "unused function" warnings --- firmware/Makefile.inc | 2 +- firmware/applications/final/config.c | 1 + firmware/applications/final/flame_rgb.c | 2 +- firmware/basic/config.c | 1 + firmware/filesystem/execute.c | 2 +- firmware/filesystem/execute.h | 2 +- firmware/filesystem/select.c | 4 ++-- firmware/filesystem/select.h | 4 ++-- firmware/filesystem/util.c | 9 ++++++--- firmware/funk/openbeacon.c | 2 ++ firmware/lcd/display.c | 2 +- 11 files changed, 19 insertions(+), 12 deletions(-) diff --git a/firmware/Makefile.inc b/firmware/Makefile.inc index 2db9163..a0d7fa9 100644 --- a/firmware/Makefile.inc +++ b/firmware/Makefile.inc @@ -42,7 +42,7 @@ CPU_TYPE = cortex-$(CORTEX_TYPE) # Compiler settings, parameters and flags ########################################################################## -CFLAGS = -std=c99 -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -DRAMCODE=$(RAMCODE) -fno-builtin +CFLAGS = -std=c99 -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -DRAMCODE=$(RAMCODE) -fno-builtin -Wno-unused-function LDFLAGS = -nostartfiles diff --git a/firmware/applications/final/config.c b/firmware/applications/final/config.c index 5aecf3b..e096a8d 100644 --- a/firmware/applications/final/config.c +++ b/firmware/applications/final/config.c @@ -8,6 +8,7 @@ #include "lcd/display.h" #include "filesystem/ff.h" +#include "filesystem/execute.h" #include diff --git a/firmware/applications/final/flame_rgb.c b/firmware/applications/final/flame_rgb.c index 3ea22e1..fc17301 100644 --- a/firmware/applications/final/flame_rgb.c +++ b/firmware/applications/final/flame_rgb.c @@ -189,7 +189,7 @@ void init_flame_rgb(void) { flameRGBSetI2C(FLAME_I2C_CR_GRPPWM, 0x00); // overall dimming - rgbDataSize = readTextFile("FLAME.RGB", rgbData, 24); + rgbDataSize = readTextFile("FLAME.RGB", (char *)rgbData, 24); enableConfig(CFG_TYPE_FLAME,1); } diff --git a/firmware/basic/config.c b/firmware/basic/config.c index f933b52..fa58120 100644 --- a/firmware/basic/config.c +++ b/firmware/basic/config.c @@ -3,6 +3,7 @@ #include "lcd/display.h" #include "lcd/print.h" +#include "lcd/backlight.h" #include "filesystem/ff.h" #include "basic/random.h" #include "basic/config.h" diff --git a/firmware/filesystem/execute.c b/firmware/filesystem/execute.c index 7546e74..8111e8e 100644 --- a/firmware/filesystem/execute.c +++ b/firmware/filesystem/execute.c @@ -89,7 +89,7 @@ uint8_t execute_file (const char * fname){ /**************************************************************************/ -void executeSelect(char *ext){ +void executeSelect(const char *ext){ char filename[15]; filename[0]='0'; filename[1]=':'; diff --git a/firmware/filesystem/execute.h b/firmware/filesystem/execute.h index 50a9a53..f421664 100644 --- a/firmware/filesystem/execute.h +++ b/firmware/filesystem/execute.h @@ -2,6 +2,6 @@ #define _EXECUTE_H_ uint8_t execute_file (const char * fname); -void executeSelect(char *ext); +void executeSelect(const char *ext); #endif diff --git a/firmware/filesystem/select.c b/firmware/filesystem/select.c index d6512b6..07399f1 100644 --- a/firmware/filesystem/select.c +++ b/firmware/filesystem/select.c @@ -8,7 +8,7 @@ #define FLEN 13 -int getFiles(char files[][FLEN], uint8_t count, uint16_t skip, char *ext) +int getFiles(char files[][FLEN], uint8_t count, uint16_t skip, const char *ext) { DIR dir; /* Directory object */ FILINFO Finfo; @@ -45,7 +45,7 @@ int getFiles(char files[][FLEN], uint8_t count, uint16_t skip, char *ext) } #define PERPAGE 7 -int selectFile(char *filename, char *extension) +int selectFile(char *filename, const char *extension) { int skip = 0; char key; diff --git a/firmware/filesystem/select.h b/firmware/filesystem/select.h index 966d135..8347840 100644 --- a/firmware/filesystem/select.h +++ b/firmware/filesystem/select.h @@ -4,7 +4,7 @@ #define FLEN 13 -int getFiles(char files[][FLEN], uint8_t count, uint16_t skip, char *ext); -int selectFile(char *filename, char *extension); +int getFiles(char files[][FLEN], uint8_t count, uint16_t skip, const char *ext); +int selectFile(char *filename, const char *extension); #endif diff --git a/firmware/filesystem/util.c b/firmware/filesystem/util.c index d0d7244..f4ace01 100644 --- a/firmware/filesystem/util.c +++ b/firmware/filesystem/util.c @@ -1,5 +1,9 @@ #include #include +#include +#include "at45db041d.h" +#include "lcd/print.h" +#include "usb/usbmsc.h" FATFS FatFs; /* File system object for logical drive */ @@ -29,10 +33,9 @@ const uint8_t init2[] = {0x80, 0x00, 0x29, 0x37, 0x4d, 0x45, 0x20, 0x20, 0x20, 0x20, 0x46, 0x41, 0x54, 0x20, 0x20, 0x20, 0x20, 0x20}; -inline void format_formatDF(void) -{ +inline void format_formatDF(void) { int i; - char buf[512]; + BYTE buf[512]; memset(buf, 0, 512); for(i=0; i<100; i++) dataflash_write(buf, i, 1); diff --git a/firmware/funk/openbeacon.c b/firmware/funk/openbeacon.c index e634f91..3ee67bc 100644 --- a/firmware/funk/openbeacon.c +++ b/firmware/funk/openbeacon.c @@ -1,4 +1,5 @@ #include +#include #include "funk/openbeacon.h" #include "funk/nrf24l01p.h" #include "basic/byteorder.h" @@ -6,6 +7,7 @@ #include "filesystem/ff.h" #include "basic/uuid.h" #include "basic/config.h" +#include "basic/random.h" #include "SECRETS" diff --git a/firmware/lcd/display.c b/firmware/lcd/display.c index 5824c7c..2e60e08 100644 --- a/firmware/lcd/display.c +++ b/firmware/lcd/display.c @@ -270,7 +270,7 @@ void lcdDisplay(void) { unsigned char br=0xFF, bg=0xFF, bb=0xFF; unsigned char frame_r=0x00, frame_g=0x00, frame_b=0x80; uint16_t color,framecolor,backcolor; - uint16_t x,y,i; + uint16_t x,y; bool px; uint16_t actualcolor; color = ((r&0xF8) << 8) | ((g&0xFC)<<3) | ((b&0xF8) >> 3);