The old code could accidently acknowledge interrupts that appeared
between the read and the write in UxINTx &= mask.
- atu2.c (handle_ep): writing to UEINTX implies a race-free "and"
- atu2.c (usb_poll): writing to UDINT implies a race-free "and"
- board.c (board_init), board_app.h (timer_init), board_app.c
(timer_init): moved timer initialization from board_init to
new function timer_init
- atusb.c (main): call timer_init
This allows us to do other things as well, e.g., change state.
- ep0.c (ep0_init), usb/dfu.c (dfu_init): use user_setup
- usb/atu2.c (usb_poll): no need to reset user_setup - the user's
reset function can do that
- usb/usb.h (user_setups), usb/usb.c (handle_setup): removed
user_setups
- usb/usb.h (user_set_interface), usb/usb.c (user_set_interface,
handle_setup): callback for SET_INTERFACE
The measured values are:
board idle, looping 9 mA
LED on + 5 mA
TX CW (+3 dBm) +14 mA
------
28 mA
======
Adding a margin of 12 mA, we get 40 mA. DFU used 30 mA so far, the
application 50 mA.
- board.h (BOARD_MAX_mA): define maximum USB bus current
- descr.c (config_descriptor), usb/dfu.c (config_descriptor):
use BOARD_MAX_mA for bMaxPower instead of hard-coding values
- ep0.c (ep0_init), usb/dfu.c (dfu_init): set user_setups[0] instead
of user_setup
- usb/atu2.c (usb_poll): reset user_setup on bus reset
- usb/usb.h (user_setups), usb/usb.c (user_setups): array of
interface-specific setup functions
- usb/usb.c (handle_setup): in SET_INTERFACE, select setup function
from user_setups according to interface
- usb/usb.c (handle_setup): if user_setup is not set (e.g., the
optional SET_INTERFACE was never issued), fall back to user_setups[0]
- atrf-xmit.c (xfer_one): also check that also the sender has no
pending interrupts before we start sending
- atrf-xmit.c (xfer_one): interrupt poll loop (now disabled) checked
the sender, not the receiver. oops.
- atrf-xmit.c (xfer_one): upon reception, check that the sender has
finished (IRQ_TRX_END) as well
- spi.h (spi_off), spi.c: disable the UART
- spi.c (spi_initialized, spi_begin, spi_init): initialize the UART
if necessary
- board_app.c (gpio): call spi_off to disable the UART instead of
open-coding the operation
- board_app.c (gpio): don't explicitly re-enable the UART but defer it
to the next communication
The SMT fab was looking there for the positions (alas, in vain).
Seems as good a place as any.
- atusb.brd: bumped file version to 20110607 (didn't change the version
printed on the layout since the layout itself didn't change)
- atusb.brd: changed fiducials from "virtual" to "normal+insert", to
include them in the position report
- atusb.brd: renamed the fiducials to give them unique names
- Makefile: bumped fab files version to 20110607
The fab was looking there for the positions (alas, in vain). Seems as
good a place as any.
- atben.brd: bumped file version to 20110607 (didn't change the version
printed on the layout since the layout itself didn't change)
- atben.brd: changed fiducials from "virtual" to "insert+place", to
include them in the position report
- atben.brd: renamed the fiducials to give them unique names
- Makefile: bumped fab files version to 20110607
This way, we can also spot issues in the digital interface leading to
mis-configurations. E.g., this one would be a defective SLP_TR line
in atusb:
http://downloads.qi-hardware.com/people/werner/wpan/tmp/jagged.png
- prod/Makefile, prod/Common: removed "-T +0.5" to use both offsets
- prod/Makefile (spectrum): print a direction indication before
running atrf-path
- gui.c (old_term, restore_term, raw, get_key): raw and non-blocking
console input
- gui,c (gui): accept console input in addition to keypressed in the
SDL window
- atrf-gpio.c (usage): added newline after synopsis
- atrf-gpio.c (usage): description of option -p was missing
- atrf-gpio.c (main): invocation without patterns/commands is now an
error
- atrf-gpio.c: added section titles
- atrf-gpio.c (DEFAULT_DELAY_MS, reg_op, usage): the "delay" command
now accept an optional delay argument
- atrf-gpio.c (old_term, restore_term, raw, pass_fail): make standard
input non-blocking and raw, and poll for pass/fail input
- atrf-gpio.c (usage, main): new option -c to cycle through the
pattern sequence, waiting for pass/fail input
- atrf-gpio.c (reg_op, usage): new command "delay" to add a 10 ms
delay
- atrf-gpio.c (reg_op, usage): new command "frame" to write one
byte to the frame buffer
- atrf-gpio.c (reg_op, usage): new command "reset" to reset the
transceiver (via atrf_reset_rf)
- atrf-gpio.c (reg_op, usage): new command "slp_tr" to pulse SLP_TR
(via atrf_slp_tr)
- atrf-gpio.c (reg_op, usage): register read can now be followed by a
mask value
ATUSB can't use sleep mode because that would cut the AVR's clock.
The old SiLabs-based boards would not have that issue, but there,
the SLP_TR method is unproven. Besides, reset is as fast on USB.
This, while being slightly unsystematic, reduces the risk of confusing
"1" (one) and "l" (lower-case ell).
- tools/atrf-gpio/atben.c (do_atben), tools/atrf-gpio/atusb.c
(do_atusb): treat 'o' as an alias of 'l'
- tools/atrf-gpio/atrf-gpio.c (usage): list 'o' as alternative for 'l'
- atusb.c (name): clarified that PC3 is unconnected
- atusb.c (gpio): "dir" and "data" were swapped
- atusb.c (gpio): complain if ATUSB_GPIO returns the wrong amount of data
- atusb.c (dump, main): show the pin configuration as well
- atusb.c (dump): show "-" for values where we don't expect a specific
result
- atusb.c (dump): removed extra newline on mismatch
reset_rf now resets all GPIOs to their default state. This way, we
can easily recover from an incomplete or incorrect use of ATUSB_GPIO.
- atusb.c (main), board.c (reset_rf): moved call to spi_init into
reset_rf
- board.c (reset_rf, board_init): moved GPIO setup to reset_rf
- board.c (reset_rf): set GPIOs to reset defaults
- board.h (gpio), board.c: read/modify/write all settings of GPIO
ports
- include/atusb/ep0.h (enum atspi_requests): added new request
ATUSB_GPIO
- ep0.c (my_setup): ATUSB_GPIO reads/reconfigures a GPIO port