1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2025-04-21 12:27:27 +03:00

tools/: major overhaul of wait_for_interrupt; uses atrf_interrupt_wait now

- include/misctxrx.h (wait_for_interrupt), lib/misctxrx.c
  (wait_for_interrupt): replaced sleep_us*timeout limiting mechanism
  with a single timeout value in milliseconds
- lib/misctxrx.c (wait_for_interrupt): use atrf_interrupt_wait instead
  of polling
- lib/misctxrx.c (wait_for_interrupt): cleaned up control flow
- lib/misctxrx.c (run, die, wait_for_interrupt): renamed variable "run"
  to more specific "sigint"
- atrf-txrx/atrf-txrx.c (ping_rx, ping): pass timeout in milliseconds,
  not deciseconds
- atrf-rssi/atrf-rssi.c (sweep), atrf-rssi/gui.c (sweep),
  atrf-txrx/atrf-txrx.c (init_txrx, receive_message, receive_pcap,
  receive, transmit, transmit_pattern, ping_tx, ping_rx),
  atrf-xmit/atrf-xmit.c (init_tx, init_rx, xfer_one),
  lib/cwtest.c (enter_test_mode_230, start_test_mode_231):
  updated use of wait_for_interrupt
This commit is contained in:
Werner Almesberger
2011-06-20 19:58:31 -03:00
parent 55354c7f91
commit b4a6e8ef46
7 changed files with 74 additions and 60 deletions

View File

@@ -54,7 +54,7 @@ static void init_tx(struct atrf_dsc *dsc, int trim, int channel, int power)
buf[i] = i;
atrf_buf_write(dsc, buf, sizeof(buf));
atrf_reg_write(dsc, REG_TRX_STATE, TRX_CMD_PLL_ON);
wait_for_interrupt(dsc, IRQ_PLL_LOCK, IRQ_PLL_LOCK, 10, 20);
wait_for_interrupt(dsc, IRQ_PLL_LOCK, IRQ_PLL_LOCK, 1);
}
@@ -62,7 +62,7 @@ static void init_rx(struct atrf_dsc *dsc, int trim, int channel)
{
init_common(dsc, trim, channel);
atrf_reg_write(dsc, REG_TRX_STATE, TRX_CMD_RX_ON);
wait_for_interrupt(dsc, IRQ_PLL_LOCK, IRQ_PLL_LOCK, 10, 20);
wait_for_interrupt(dsc, IRQ_PLL_LOCK, IRQ_PLL_LOCK, 1);
}
@@ -84,7 +84,7 @@ static int xfer_one(struct atrf_dsc *tx, struct atrf_dsc *rx)
atrf_slp_tr(tx, 1, 1);
#if 1
irq = wait_for_interrupt(rx, IRQ_TRX_END, IRQ_TRX_END | IRQ_RX_START,
1000, 0);
0);
#else
/*
* Just waiting for the maximum time is much faster than polling the