1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-22 14:38:26 +02:00
ben-wpan/atusb
Werner Almesberger 42483d67b4 atusb/fw/: added improved support for interrupt synchronization
At an interrupt barrier, the host must be able to ensure that no
interrupt generated before reaching the barrier is still pending and
will be delivered after crossing the barrier.

For this, we introduce the following concept:

- interrupts have a serial number. This number is sent to the host
  on EP 1 (currently bulk) to signal the interrupt, instead of the
  zero byte we used previously.

- the new request ATUSB_SPI_WRITE2_SYNC returns the interrupt
  serial number from after the register write (the register write
  itself is the interrupt barrier).

- the host can now check if the serial indicated from bulk and the
  serial from ATUSB_SPI_WRITE2_SYNC are the same. If yes, interrupts
  are synchronized. If not, it has to wait for the interrupt to be
  signaled on EP 1.

We should also consider the case that the interrupt serial has gotten
ahead of ATUSB_SPI_WRITE2_SYNC. But that seems to happen rarely. In
any case, it's something for the host driver to worry about, not for
the firmware.

- board.h (irq_serial), board_app.c (irq_serial, INT0_vect): count
  the interrupt serial number and return it when signaling the
  interrupt
- include/atusb/ep0.h (ATUSB_SPI_WRITE2_SYNC), ep0.c (my_setup):
  new request ATUSB_SPI_WRITE2_SYNC that does a register write, then
  returns the interrupt serial
2011-07-07 15:51:07 -03:00
..
cam Updates CAM processes of various sub-projects 2011-02-21 23:31:04 -03:00
fw atusb/fw/: added improved support for interrupt synchronization 2011-07-07 15:51:07 -03:00
atrf.sch atusb/: swapped C10 and C13 in schematics, to match layout 2011-05-27 04:29:01 -03:00
atusb.brd atusb: include the position of fiducials in atusb-pos.csv (for fab) 2011-06-07 16:51:26 -03:00
atusb.cmp atusb: enlarged USB positioning pin hole; general cleanup 2011-03-31 03:27:11 -03:00
atusb.pro atusb: added two fiducial marks 2011-03-23 13:08:48 -03:00
atusb.sch atusb/: swapped C10 and C13 in schematics, to match layout 2011-05-27 04:29:01 -03:00
Makefile atusb: include the position of fiducials in atusb-pos.csv (for fab) 2011-06-07 16:51:26 -03:00
README-PCB atusb: enlarged USB positioning pin hole; general cleanup 2011-03-31 03:27:11 -03:00
README-SMT atusb: enlarged USB positioning pin hole; general cleanup 2011-03-31 03:27:11 -03:00
usb.sch atusb/: swapped C10 and C13 in schematics, to match layout 2011-05-27 04:29:01 -03:00