From 5b632f374085b17d8614fb3c13fb3d79bae9a9ff Mon Sep 17 00:00:00 2001 From: maniacbug Date: Sun, 24 Apr 2011 11:24:21 -0700 Subject: [PATCH 1/2] Updated vim modeline --- RF24.cpp | 2 +- RF24.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RF24.cpp b/RF24.cpp index 91b5a2b..e38ee66 100644 --- a/RF24.cpp +++ b/RF24.cpp @@ -450,5 +450,5 @@ void RF24::openReadingPipe(uint8_t child, uint64_t value) write_register(EN_RXADDR,en_rx); } } -// vim:ai sts=2 sw=2 ft=cpp +// vim:ai:cin:sts=2 sw=2 ft=cpp diff --git a/RF24.h b/RF24.h index 0975fdf..4c4e653 100644 --- a/RF24.h +++ b/RF24.h @@ -347,5 +347,5 @@ public: */ #endif // __RF24_H__ -// vim:ai sts=2 sw=2 ft=cpp +// vim:ai:cin:sts=2 sw=2 ft=cpp From e188242a8687c2880dbb60b394308a6dd25c254e Mon Sep 17 00:00:00 2001 From: maniacbug Date: Sun, 24 Apr 2011 11:34:05 -0700 Subject: [PATCH 2/2] Enabled warnings, and cleaned up warnings. Updated pingpair makefile for recent makefile improvements --- RF24.cpp | 6 +++--- examples/pingpair/makefile | 5 +++-- examples/pingpair/pingpair.pde | 4 ++-- examples/pingpair/printf.h | 2 ++ examples/starping/makefile | 4 ++-- examples/starping/printf.h | 2 ++ examples/starping/starping.pde | 2 +- 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/RF24.cpp b/RF24.cpp index e38ee66..6c042b9 100644 --- a/RF24.cpp +++ b/RF24.cpp @@ -219,14 +219,14 @@ void RF24::printDetails(void) uint8_t buffer[5]; uint8_t status = read_register(RX_ADDR_P0,buffer,5); print_status(status); - printf("RX_ADDR_P0 = 0x",buffer); + printf("RX_ADDR_P0 = 0x"); uint8_t *bufptr = buffer + 5; while( bufptr-- > buffer ) printf("%02x",*bufptr); printf("\n\r"); status = read_register(RX_ADDR_P1,buffer,5); - printf("RX_ADDR_P1 = 0x",buffer); + printf("RX_ADDR_P1 = 0x"); bufptr = buffer + 5; while( bufptr-- > buffer ) printf("%02x",*bufptr); @@ -241,7 +241,7 @@ void RF24::printDetails(void) printf("\n\r"); status = read_register(TX_ADDR,buffer,5); - printf("TX_ADDR = 0x",buffer); + printf("TX_ADDR = 0x"); bufptr = buffer + 5; while( bufptr-- > buffer ) printf("%02x",*bufptr); diff --git a/examples/pingpair/makefile b/examples/pingpair/makefile index 55a4885..a1c6d4c 100644 --- a/examples/pingpair/makefile +++ b/examples/pingpair/makefile @@ -139,8 +139,8 @@ CXXINCS = -I$(ARDUINO_CORE) -I$(ARDUINO_LIB) #CSTANDARD = -std=gnu99 CDEBUG = -g$(DEBUG) #CWARN = -Wall -Wstrict-prototypes -#CWARN = -Wall # show all warnings -CWARN = -w # suppress all warnings +CWARN = -Wall # show all warnings +#CWARN = -w # suppress all warnings CMAP = -Wl,-Map,output.map ####CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums CTUNING = -ffunction-sections -fdata-sections @@ -198,6 +198,7 @@ build: elf hex output/$(PROJECT_NAME).cpp: $(PROJECT_NAME).pde test -d output || mkdir output echo "#include " > $@ + echo "#line 1 \"$<\"" >> $@ cat $< >> $@ elf: output/$(PROJECT_NAME).elf diff --git a/examples/pingpair/pingpair.pde b/examples/pingpair/pingpair.pde index 3a1cf41..b0b3f0e 100644 --- a/examples/pingpair/pingpair.pde +++ b/examples/pingpair/pingpair.pde @@ -29,7 +29,7 @@ RF24 radio(8,9); // sets the role of this unit in hardware. Connect to GND to be the 'pong' receiver -// Leave open to be the 'pong' receiver. +// Leave open to be the 'ping' transmitter const int role_pin = 7; // @@ -137,7 +137,7 @@ void loop(void) // Take the time, and send it. This will block until complete unsigned long time = millis(); printf("Now sending %lu...",time); - bool ok = radio.write( &time, sizeof(unsigned long) ); + radio.write( &time, sizeof(unsigned long) ); // Now, continue listening radio.startListening(); diff --git a/examples/pingpair/printf.h b/examples/pingpair/printf.h index 52e0c89..63501e4 100644 --- a/examples/pingpair/printf.h +++ b/examples/pingpair/printf.h @@ -21,6 +21,8 @@ int serial_putc( char c, FILE *t ) { Serial.write( c ); + + return c; } void printf_begin(void) diff --git a/examples/starping/makefile b/examples/starping/makefile index 42aa4e0..935d5dc 100644 --- a/examples/starping/makefile +++ b/examples/starping/makefile @@ -140,8 +140,8 @@ CXXINCS = -I$(ARDUINO_CORE) -I$(ARDUINO_LIB) #CSTANDARD = -std=gnu99 CDEBUG = -g$(DEBUG) #CWARN = -Wall -Wstrict-prototypes -#CWARN = -Wall # show all warnings -CWARN = -w # suppress all warnings +CWARN = -Wall # show all warnings +#CWARN = -w # suppress all warnings CMAP = -Wl,-Map,output.map ####CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums CTUNING = -ffunction-sections -fdata-sections diff --git a/examples/starping/printf.h b/examples/starping/printf.h index 52e0c89..63501e4 100644 --- a/examples/starping/printf.h +++ b/examples/starping/printf.h @@ -21,6 +21,8 @@ int serial_putc( char c, FILE *t ) { Serial.write( c ); + + return c; } void printf_begin(void) diff --git a/examples/starping/starping.pde b/examples/starping/starping.pde index f3c4e9c..828b07d 100644 --- a/examples/starping/starping.pde +++ b/examples/starping/starping.pde @@ -201,7 +201,7 @@ void loop(void) // Take the time, and send it. This will block until complete unsigned long time = millis(); printf("Now sending %lu...",time); - bool ok = radio.write( &time, sizeof(unsigned long) ); + radio.write( &time, sizeof(unsigned long) ); // Now, continue listening radio.startListening();