mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-22 14:30:35 +02:00
tools/atrf-txrx/atrf-txrx.c (rtt_master): start transition to RX_ON while sending
This allows us to turn around faster.
This commit is contained in:
parent
852aaf1b66
commit
945aa04d9d
@ -494,8 +494,6 @@ static void rtt_slave_hmac(struct atrf_dsc *dsc)
|
|||||||
n = atrf_rx(dsc, buf, sizeof(buf), 0, NULL);
|
n = atrf_rx(dsc, buf, sizeof(buf), 0, NULL);
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
exit(1);
|
exit(1);
|
||||||
// uncomment if master doesn't turn around fast enough
|
|
||||||
//usleep(10*1000);
|
|
||||||
atrf_tx(dsc, buf, n-2);
|
atrf_tx(dsc, buf, n-2);
|
||||||
}
|
}
|
||||||
atrf_rx_mode(dsc, 0);
|
atrf_rx_mode(dsc, 0);
|
||||||
@ -518,9 +516,17 @@ static void rtt_master(struct atrf_dsc *dsc, int packets, int size)
|
|||||||
atrf_buf_write(dsc, buf, size+2);
|
atrf_buf_write(dsc, buf, size+2);
|
||||||
gettimeofday(&t0, NULL);
|
gettimeofday(&t0, NULL);
|
||||||
atrf_reg_write(dsc, REG_TRX_STATE, TRX_CMD_TX_START);
|
atrf_reg_write(dsc, REG_TRX_STATE, TRX_CMD_TX_START);
|
||||||
wait_for_interrupt(dsc, IRQ_TRX_END,
|
|
||||||
IRQ_TRX_END | IRQ_PLL_LOCK, 10);
|
/* prepare transition to RX_ON while still sending */
|
||||||
|
while ((atrf_reg_read(dsc, REG_TRX_STATUS) & TRX_STATUS_MASK)
|
||||||
|
== TRX_STATUS_TRANSITION);
|
||||||
atrf_reg_write(dsc, REG_TRX_STATE, TRX_CMD_RX_ON);
|
atrf_reg_write(dsc, REG_TRX_STATE, TRX_CMD_RX_ON);
|
||||||
|
|
||||||
|
/* wait for transmission to end */
|
||||||
|
wait_for_interrupt(dsc, IRQ_TRX_END,
|
||||||
|
IRQ_TRX_END | IRQ_RX_START | IRQ_PLL_LOCK | IRQ_AMI, 1);
|
||||||
|
|
||||||
|
/* wait for reception */
|
||||||
irq = wait_for_interrupt(dsc, IRQ_TRX_END,
|
irq = wait_for_interrupt(dsc, IRQ_TRX_END,
|
||||||
IRQ_TRX_END | IRQ_RX_START | IRQ_PLL_LOCK | IRQ_AMI, 1000);
|
IRQ_TRX_END | IRQ_RX_START | IRQ_PLL_LOCK | IRQ_AMI, 1000);
|
||||||
if (irq) {
|
if (irq) {
|
||||||
|
Loading…
Reference in New Issue
Block a user