From 899f2d18f36e4539e7b384a6a5813e477e936cb0 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sat, 2 Apr 2011 02:18:33 +0200 Subject: [PATCH] enable alls warnings, treat them as errors --- firmware/Makefile | 2 +- firmware/src/edubrm.c | 13 ++++++------- firmware/src/edubrm.h | 11 +++++++++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/firmware/Makefile b/firmware/Makefile index 044e8ac..4210dc1 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -1,4 +1,4 @@ -CFLAGS = -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv1p30_LPC13xx -Iinc -O0 -g3 -Wall -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m3 -mthumb +CFLAGS = -Wall -Werror -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv1p30_LPC13xx -Iinc -O0 -g3 -Wall -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m3 -mthumb LDFLAGS = -nostdlib -Xlinker -Map=obj/edubrm.map --gc-sections -mcpu=cortex-m3 -mthumb -T obj/debug.ld LIST = $(shell cd src/ ; ls *.c) OBJS = $(addprefix obj/,$(LIST:.c=.o)) diff --git a/firmware/src/edubrm.c b/firmware/src/edubrm.c index 6277e53..e12655e 100644 --- a/firmware/src/edubrm.c +++ b/firmware/src/edubrm.c @@ -19,7 +19,7 @@ #define mainLED_BIT ( 7 ) -void VCOM_Brm2Usb(void) { +void VCOM_Brm2Usb() { /* static char serBuf [USB_CDC_BUFSIZE]; int numBytesRead, numAvailByte; @@ -28,7 +28,7 @@ void VCOM_Brm2Usb(void) { serBuf[0] = 'A'; numBytesRead = 1; -/* ser_AvailChar (&numAvailByte); + ser_AvailChar (&numAvailByte); if (numAvailByte > 0) { if (CDC_DepInEmpty) { numBytesRead = ser_Read (&serBuf[0], &numAvailByte); @@ -37,7 +37,6 @@ void VCOM_Brm2Usb(void) { USB_WriteEP (CDC_DEP_IN, (unsigned char *)&serBuf[0], numBytesRead); } -/* } */ @@ -46,7 +45,7 @@ void VCOM_Brm2Usb(void) { static char cmdInbuffer[256]; int cmdInbufferIndex = 0; -int checkForCommand(void) { +int checkForCommand() { int i=0; for (i=0;iDIR |= ( 0x0 << mainLED_BIT ); } -void toggleLED( ){ +void toggleLED() { ulLEDState = !ulLEDState; LPC_GPIO0->MASKED_ACCESS[ ( 1 << mainLED_BIT) ] = ( ulLEDState << mainLED_BIT ); } void sendToUSB(char *string) { - USB_WriteEP (CDC_DEP_IN, string, strlen(string)); + USB_WriteEP (CDC_DEP_IN, (unsigned char *)string, strlen(string)); } @@ -92,7 +91,7 @@ void commandReceived(char * receivedCommand) { -void VCOM_Usb2Brm(void) { +void VCOM_Usb2Brm() { static char serBuf [32]; int numBytesToRead, numBytesRead, numAvailByte; int i=0; diff --git a/firmware/src/edubrm.h b/firmware/src/edubrm.h index 2ecf6a3..30e9469 100644 --- a/firmware/src/edubrm.h +++ b/firmware/src/edubrm.h @@ -3,4 +3,15 @@ #define VERSION "0.0000001 pre-alpha\n" + +void VCOM_Brm2Usb(); +int checkForCommand(); +void enableLED(); +void disableLED(); +void toggleLED(); +void sendToUSB(char *string); +void commandReceived(char * receivedCommand); +void VCOM_Usb2Brm(); + + #endif