add rx_time parameter and fill with *MACA_TIMESTAMP
This commit is contained in:
parent
c0b21702ed
commit
5012757673
3 changed files with 3 additions and 1 deletions
|
@ -53,6 +53,7 @@ struct packet {
|
||||||
uint8_t offset;
|
uint8_t offset;
|
||||||
uint8_t lqi;
|
uint8_t lqi;
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
uint32_t rx_time;
|
||||||
#if PACKET_STATS
|
#if PACKET_STATS
|
||||||
uint8_t seen;
|
uint8_t seen;
|
||||||
uint8_t post_tx;
|
uint8_t post_tx;
|
||||||
|
|
|
@ -615,6 +615,7 @@ void maca_isr(void) {
|
||||||
*MACA_CLRIRQ = (1 << maca_irq_di);
|
*MACA_CLRIRQ = (1 << maca_irq_di);
|
||||||
dma_rx->length = *MACA_GETRXLVL - 2; /* packet length does not include FCS */
|
dma_rx->length = *MACA_GETRXLVL - 2; /* packet length does not include FCS */
|
||||||
dma_rx->lqi = get_lqi();
|
dma_rx->lqi = get_lqi();
|
||||||
|
dma_rx->rx_time = *MACA_TIMESTAMP;
|
||||||
|
|
||||||
/* check if received packet needs an ack */
|
/* check if received packet needs an ack */
|
||||||
if(dma_rx->data[1] & 0x20) {
|
if(dma_rx->data[1] & 0x20) {
|
||||||
|
|
|
@ -48,7 +48,7 @@ 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 lqi 0x%02x", p->length, p->lqi);
|
printf("len 0x%02x lqi 0x%02x rx_time 0x%08x", p->length, p->lqi, (int)p->rx_time);
|
||||||
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");
|
printf("\n\r");
|
||||||
for(i=0; i < PER_ROW; i++, k++) {
|
for(i=0; i < PER_ROW; i++, k++) {
|
||||||
|
|
Loading…
Reference in a new issue