Fixed bug of not including name. Also added extra tab on short strings.

This commit is contained in:
maniacbug 2011-06-27 21:01:58 -07:00
parent 92373ba7f5
commit 91df6f6df5
1 changed files with 5 additions and 2 deletions

View File

@ -210,7 +210,8 @@ void RF24::print_observe_tx(uint8_t value)
void RF24::print_byte_register(prog_char* name, uint8_t reg)
{
printf_P(PSTR("%S\t = 0x%02x\n\r"),read_register(reg));
char extra_tab = strlen_P(name) < 8 ? '\t' : 0;
printf_P(PSTR("%S\t%c = 0x%02x\n\r"),name,extra_tab,read_register(reg));
}
/******************************************************************/
@ -219,7 +220,9 @@ void RF24::print_address_register(prog_char* name, uint8_t reg)
{
uint8_t buffer[5];
read_register(reg,buffer,sizeof buffer);
printf_P(PSTR("%S\t = 0x"),name);
char extra_tab = strlen_P(name) < 8 ? '\t' : 0;
printf_P(PSTR("%S\t%c = 0x"),name,extra_tab);
uint8_t* bufptr = buffer + sizeof buffer;
while( bufptr-- > buffer )