condense print_packet output
This commit is contained in:
parent
667b238148
commit
8421031d4a
|
@ -32,16 +32,15 @@ void print_packet(volatile packet_t *p) {
|
|||
#define PER_ROW 16
|
||||
if(p) {
|
||||
printf("len 0x%02x\n\r",p->length);
|
||||
for(j=0, k=0; j < ((p->length)%PER_ROW)-1; j++) {
|
||||
for(j=0, k=0; j <= ((p->length)%PER_ROW); j++) {
|
||||
for(i=0; i < PER_ROW; i++, k++) {
|
||||
if(k >= (p->length + 1) ) { goto out; } /* + 1 since first byte is len+2 */
|
||||
printf("%02x ",p->data[j*PER_ROW+i]);
|
||||
}
|
||||
printf("\n\r");
|
||||
}
|
||||
out:
|
||||
printf("\n\r");
|
||||
}
|
||||
out:
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue