get the newlines straight in packet_print
This commit is contained in:
parent
a04a69480b
commit
fece5269c7
|
@ -7,7 +7,7 @@
|
|||
|
||||
#define LED LED_RED
|
||||
|
||||
#define PAYLOAD_LEN 16
|
||||
#define PAYLOAD_LEN 120
|
||||
#define DELAY 400000
|
||||
|
||||
void fill_packet(volatile packet_t *p) {
|
||||
|
|
|
@ -31,16 +31,17 @@ void print_packet(volatile packet_t *p) {
|
|||
volatile uint8_t i,j,k;
|
||||
#define PER_ROW 16
|
||||
if(p) {
|
||||
printf("len 0x%02x\n\r",p->length);
|
||||
printf("len 0x%02x",p->length);
|
||||
for(j=0, k=0; j <= ((p->length)%PER_ROW); j++) {
|
||||
printf("\n\r");
|
||||
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 + p->offset]);
|
||||
}
|
||||
printf("\n\r");
|
||||
}
|
||||
}
|
||||
out:
|
||||
printf("\n\r");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue