1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-09-30 16:14:09 +03:00
Commit Graph

15 Commits

Author SHA1 Message Date
Werner Almesberger
d8363d853c tools/lib/misctxrx.c (wait_for_interrupt): enforce a minimum timeout of 10 ms
Seems that just one millisecond isn't enough to get a byte from
the USB device, even if the byte is already waiting in the endpoint
FIFO there.
2011-06-23 13:21:05 -03:00
Werner Almesberger
cb20c55231 tools/lib/misctxrx.c (wait_for_interrupt): don't fragment timeouts
usb_bulk_read may lose data when timing out. We therefore try to
minimize the number of times we time out.
2011-06-20 22:56:59 -03:00
Werner Almesberger
76707d6b37 tools/lib/misctxrx.c (flush_interrupts): don't fall back to reading IRQ_STATUS
We now implement atrf_interrupt_wait in all drivers and don't need
the dubious fallback anymore.
2011-06-20 20:48:15 -03:00
Werner Almesberger
b4a6e8ef46 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
2011-06-20 20:08:42 -03:00
Werner Almesberger
620709a20a libatrf: new function to reliably flush interrupts
- misctxrx.h (flush_interrupts), misctxrx.c: reliably flush interrupts
  on all drivers (with the exception of atnet talking to an atusb)
2011-06-20 17:21:40 -03:00
Werner Almesberger
09e5d28768 xxx 2011-04-12 19:17:43 -03:00
Werner Almesberger
1618868f9f libatrf: further modularized transmit power setting and exported conversion
- lib/misctxrx.c (tx_pwr_230, tx_pwr_231): declare tables as "const"
- lib/misctxrx.c (POWER_TABLE_SIZE, set_power_dBm): don't open-code the
  table size calculation
- lib/misctxrx.c (tx_power_table, set_power_dBm): moved transmit power
  table selection out of set_power_dBm
- include/misctxrx.h (tx_power_dBm2step, tx_power_step2dBm),
  lib/misctxrx.c (tx_power_dBm2step, tx_power_step2dBm, set_power_dBm):
  moved conversion functions out of set_power_dBm and made them globally
  available
2011-04-12 18:41:03 -03:00
Werner Almesberger
8934c062a9 tools/: moved function to set transmit power from atrf-txrx to libatrf
- atrf-txrx/atrf-txrx.c (tx_pwr_230, tx_pwr_231, set_power): moved to
  lib/misctxrx.c
- include/misctxrx.h, lib/misctxr.c (set_power_step, set_power_dBm):
  separated dBm to index conversion from the actual operation
- atrf-txrx/atrf-txrx.c (main): use new set_power_dBm instead of old
  set_power
2011-04-12 16:37:05 -03:00
Werner Almesberger
1fb05c221d misctxrx.c (wait_for_interrupt): let "ignore" control printing more tightly
When some interrupt(s) happened but the one(s) wait_for_interrupt was
waiting for weren't among them, it printed the list of interrupts
even if they were all in "ignore". This made sequences like RX_START
followed by TRX_END unnecessarily noisy.

Now, wait_for_interrupt only prints the pending interrupts if at
least one of them is not in "ignore".
2011-01-19 18:27:17 -03:00
Werner Almesberger
6ff235e8ea tools/lib/misctxrx.c (wait_for_interrupt): restore signal also after timeout 2011-01-10 13:52:57 -03:00
Werner Almesberger
1befc69e37 tools/lib/misctxrx.c: decode AMI and CCA_ED_DONE interrupts (231 only) 2011-01-09 19:38:33 -03:00
Werner Almesberger
bcd3691c8a The Great ATSPI Renaming, part 6: change atrf API from atspi_* to atrf_*
- include/atrf.h, lib/atrf.c (struct atspi_dsc): renamed to "struct
  atrf_dsc"
- include/atrf.h, lib/atrf.c (atspi_*): renamed all functions to atrf_*
- include/misctxrx.h, lib/misctxrx.c (wait_for_interrupt): updated for API
  name change
- atspi-id/atspi-id.c (show_usb_info, show_info, main),
  atspi-reset/atspi-reset.c (main), atspi-rssi/atspi-rssi.c (sweep, main),
  atspi-rssi/gui.h (gui), atspi-rssi/gui.c (sweep, gui),
  atspi-trim/atspi-trim.c (main), atspi-txrx/atspi-txrx.c (init_txrx,
  set_channel, set_power, receive, transmit, test_mode, main):
  updated for API name change
2010-11-11 10:10:13 -03:00
Werner Almesberger
cf23ac6128 The Great ATSPI Renaming, part 4: rename include/atspi.h to include/atrf.h
- include/atspi.h: renamed to include/atrf.h
- include/misctxrx.h, lib/atrf.c, lib/misctxrx.c, atspi-id/atspi-id.c,
  atspi-reset/atspi-reset.c, atspi-rssi/atspi-rssi.c, atspi-rssi/gui.c,
  atspi-rssi/gui.h, atspi-trim/atspi-trim.c, atspi-txrx/atspi-txrx.c:
  change  #include "atspi.h"  to  #include "atrf.h"
2010-11-11 08:58:47 -03:00
Werner Almesberger
c99ba2c769 atspi-txrx can now send repeatedly, cleans up on ^C, prints the power level.
if it differs by more than 0.01 dBm from the level specified
- tools/atspi-txrx/Makefile (LDLIBS): added -lm, for fabs()
- tools/atspi-txrx/atspi-txrx.c (transmit, usage, main): add optional
  command-line argument with the number of times to send the message
- tools/atspi-txrx/atspi-txrx.c (receive, transmit, die, main): return and
  clean up on ^C
- tools/tools/lib/misctxrx.c (wait_for_interrupt) return and raise SIGINT
  for the caller's signal handler on ^C
2010-09-14 17:12:03 -03:00
Werner Almesberger
2a245e1ee3 Make wait_for_interrupt available to all atspi tools.
- tools/atspi-txrx/atspi-txrx.c: cleaned up includes - we need stdint.h but
  we don't need atspi/ep0.h
- tools/atspi-txrx/atspi-txrx.c (wait_for_interrupt),
  tools/include/misctxrx.h (wait_for_interrupt), tools/lib/Makefile (OBJS),
  tools/lib/misctxrx.c (wait_for_interrupt): moved wait_for_interrupt from
  atspi-txrx to the atspi library, so that we can share it
2010-09-09 17:42:47 -03:00