Enabled warnings, and cleaned up warnings. Updated pingpair makefile for recent makefile improvements

This commit is contained in:
maniacbug 2011-04-24 11:34:05 -07:00
parent 5b632f3740
commit e188242a86
7 changed files with 15 additions and 10 deletions

View File

@ -219,14 +219,14 @@ void RF24::printDetails(void)
uint8_t buffer[5]; uint8_t buffer[5];
uint8_t status = read_register(RX_ADDR_P0,buffer,5); uint8_t status = read_register(RX_ADDR_P0,buffer,5);
print_status(status); print_status(status);
printf("RX_ADDR_P0 = 0x",buffer); printf("RX_ADDR_P0 = 0x");
uint8_t *bufptr = buffer + 5; uint8_t *bufptr = buffer + 5;
while( bufptr-- > buffer ) while( bufptr-- > buffer )
printf("%02x",*bufptr); printf("%02x",*bufptr);
printf("\n\r"); printf("\n\r");
status = read_register(RX_ADDR_P1,buffer,5); status = read_register(RX_ADDR_P1,buffer,5);
printf("RX_ADDR_P1 = 0x",buffer); printf("RX_ADDR_P1 = 0x");
bufptr = buffer + 5; bufptr = buffer + 5;
while( bufptr-- > buffer ) while( bufptr-- > buffer )
printf("%02x",*bufptr); printf("%02x",*bufptr);
@ -241,7 +241,7 @@ void RF24::printDetails(void)
printf("\n\r"); printf("\n\r");
status = read_register(TX_ADDR,buffer,5); status = read_register(TX_ADDR,buffer,5);
printf("TX_ADDR = 0x",buffer); printf("TX_ADDR = 0x");
bufptr = buffer + 5; bufptr = buffer + 5;
while( bufptr-- > buffer ) while( bufptr-- > buffer )
printf("%02x",*bufptr); printf("%02x",*bufptr);

View File

@ -139,8 +139,8 @@ CXXINCS = -I$(ARDUINO_CORE) -I$(ARDUINO_LIB)
#CSTANDARD = -std=gnu99 #CSTANDARD = -std=gnu99
CDEBUG = -g$(DEBUG) CDEBUG = -g$(DEBUG)
#CWARN = -Wall -Wstrict-prototypes #CWARN = -Wall -Wstrict-prototypes
#CWARN = -Wall # show all warnings CWARN = -Wall # show all warnings
CWARN = -w # suppress all warnings #CWARN = -w # suppress all warnings
CMAP = -Wl,-Map,output.map CMAP = -Wl,-Map,output.map
####CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums ####CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
CTUNING = -ffunction-sections -fdata-sections CTUNING = -ffunction-sections -fdata-sections
@ -198,6 +198,7 @@ build: elf hex
output/$(PROJECT_NAME).cpp: $(PROJECT_NAME).pde output/$(PROJECT_NAME).cpp: $(PROJECT_NAME).pde
test -d output || mkdir output test -d output || mkdir output
echo "#include <WProgram.h>" > $@ echo "#include <WProgram.h>" > $@
echo "#line 1 \"$<\"" >> $@
cat $< >> $@ cat $< >> $@
elf: output/$(PROJECT_NAME).elf elf: output/$(PROJECT_NAME).elf

View File

@ -29,7 +29,7 @@
RF24 radio(8,9); RF24 radio(8,9);
// sets the role of this unit in hardware. Connect to GND to be the 'pong' receiver // 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; const int role_pin = 7;
// //
@ -137,7 +137,7 @@ void loop(void)
// Take the time, and send it. This will block until complete // Take the time, and send it. This will block until complete
unsigned long time = millis(); unsigned long time = millis();
printf("Now sending %lu...",time); printf("Now sending %lu...",time);
bool ok = radio.write( &time, sizeof(unsigned long) ); radio.write( &time, sizeof(unsigned long) );
// Now, continue listening // Now, continue listening
radio.startListening(); radio.startListening();

View File

@ -21,6 +21,8 @@
int serial_putc( char c, FILE *t ) int serial_putc( char c, FILE *t )
{ {
Serial.write( c ); Serial.write( c );
return c;
} }
void printf_begin(void) void printf_begin(void)

View File

@ -140,8 +140,8 @@ CXXINCS = -I$(ARDUINO_CORE) -I$(ARDUINO_LIB)
#CSTANDARD = -std=gnu99 #CSTANDARD = -std=gnu99
CDEBUG = -g$(DEBUG) CDEBUG = -g$(DEBUG)
#CWARN = -Wall -Wstrict-prototypes #CWARN = -Wall -Wstrict-prototypes
#CWARN = -Wall # show all warnings CWARN = -Wall # show all warnings
CWARN = -w # suppress all warnings #CWARN = -w # suppress all warnings
CMAP = -Wl,-Map,output.map CMAP = -Wl,-Map,output.map
####CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums ####CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
CTUNING = -ffunction-sections -fdata-sections CTUNING = -ffunction-sections -fdata-sections

View File

@ -21,6 +21,8 @@
int serial_putc( char c, FILE *t ) int serial_putc( char c, FILE *t )
{ {
Serial.write( c ); Serial.write( c );
return c;
} }
void printf_begin(void) void printf_begin(void)

View File

@ -201,7 +201,7 @@ void loop(void)
// Take the time, and send it. This will block until complete // Take the time, and send it. This will block until complete
unsigned long time = millis(); unsigned long time = millis();
printf("Now sending %lu...",time); printf("Now sending %lu...",time);
bool ok = radio.write( &time, sizeof(unsigned long) ); radio.write( &time, sizeof(unsigned long) );
// Now, continue listening // Now, continue listening
radio.startListening(); radio.startListening();