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