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

Added interrupt polling support for atusb.

- atrf/fw/include/atspi/ep0.h enum atspi_requests), atrf/fw/atspi/ep0.c
  (my_setup): new command ATSPI_POLL_INT to poll IRQ_RF
- atrf/fw/atspi/ep0.c (my_setup): ATSPI_BUILD sent one byte too many
- tools/lib/atusb.c (atusd_interrupt, atusb_driver): implemented interrupt
  polling
- tools/lib/atusd.c: added section title for the RF interrupt function
This commit is contained in:
Werner Almesberger
2010-09-09 20:22:45 -03:00
parent 4df6d2c2f9
commit b6a80ba3dd
4 changed files with 39 additions and 2 deletions

View File

@@ -187,6 +187,29 @@ static int atusb_buf_read(void *dsc, void *buf, int size)
}
/* ----- RF interrupt ------------------------------------------------------ */
static int atusd_interrupt(void *dsc)
{
usb_dev_handle *dev = dsc;
uint8_t buf;
int res;
if (error)
return -1;
res = usb_control_msg(dev, FROM_DEV, ATSPI_POLL_INT, 0, 0,
(void *) &buf, 1, 1000);
if (res < 0) {
fprintf(stderr, "ATSPI_POLL_INT: %d\n", res);
error = 1;
}
return buf;
}
/* ----- driver interface -------------------------------------------------- */
@@ -202,4 +225,5 @@ struct atspi_driver atusb_driver = {
.reg_read = atusb_reg_read,
.buf_write = atusb_buf_write,
.buf_read = atusb_buf_read,
.interrupt = atusd_interrupt,
};

View File

@@ -300,6 +300,9 @@ static int atusd_buf_read(void *handle, void *buf, int size)
}
/* ----- RF interrupt ------------------------------------------------------ */
static int atusd_interrupt(void *handle)
{
struct atusd_dsc *dsc = handle;