From 514b0f72f50b50b75ef855f008c888f29989d68e Mon Sep 17 00:00:00 2001 From: laforge Date: Wed, 20 Sep 2006 11:44:10 +0000 Subject: - Add OpenPICC register definition (and USB command handling) - Add automatic generation of include/compile.h with svn revision and compiletime - Add openpcd_compile_version structure to obtain version via USB - Move LED commands into new CMD_CLS_GENERIC family - Update TODO - Add support for large (2048 byte) request contexts in addition to 64byte - Shrink req_ctx size by collapsing rx and tx buffer into one - move definition of DFU_API_LOCATION to header file - Implement large req_ctx aware USB transmit / refill routines - Implement TX refilling for IRQ Endpoint - Print version information at startup time - move some generic req_ctx processing into usb_handler.c - Some further work on DFU (still not finished) - Only use '-Os' for DFU, use '-O2' for application code git-svn-id: https://svn.openpcd.org:2342/trunk@208 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- firmware/src/os/pio_irq.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'firmware/src/os/pio_irq.c') diff --git a/firmware/src/os/pio_irq.c b/firmware/src/os/pio_irq.c index dfe818c..14f51c2 100644 --- a/firmware/src/os/pio_irq.c +++ b/firmware/src/os/pio_irq.c @@ -50,7 +50,7 @@ static void pio_irq_demux(void) if (send_usb && !pirqs.usb_throttled) { struct req_ctx *irq_rctx; - irq_rctx = req_ctx_find_get(RCTX_STATE_FREE, + irq_rctx = req_ctx_find_get(0, RCTX_STATE_FREE, RCTX_STATE_PIOIRQ_BUSY); if (!irq_rctx) { /* we cannot disable the interrupt, since we have @@ -59,14 +59,14 @@ static void pio_irq_demux(void) } else { struct openpcd_hdr *opcdh; u_int32_t *regmask; - opcdh = (struct openpcd_hdr *) &irq_rctx->tx.data[0]; - regmask = (u_int32_t *) (&irq_rctx->tx.data[0] + sizeof(*opcdh)); + opcdh = (struct openpcd_hdr *) irq_rctx->data; + regmask = (u_int32_t *) (irq_rctx->data + sizeof(*opcdh)); opcdh->cmd = OPENPCD_CMD_PIO_IRQ; opcdh->reg = 0x00; opcdh->flags = 0x00; opcdh->val = 0x00; - irq_rctx->tx.tot_len = sizeof(*opcdh) + sizeof(u_int32_t); + irq_rctx->tot_len = sizeof(*opcdh) + sizeof(u_int32_t); req_ctx_set_state(irq_rctx, RCTX_STATE_UDP_EP3_PENDING); } } @@ -116,8 +116,7 @@ void pio_irq_unregister(u_int32_t pio) static int pio_irq_usb_in(struct req_ctx *rctx) { - struct openpcd_hdr *poh = (struct openpcd_hdr *) &rctx->rx.data[0]; - struct openpcd_hdr *pih = (struct openpcd_hdr *) &rctx->tx.data[0]; + struct openpcd_hdr *poh = (struct openpcd_hdr *) rctx->data; switch (poh->cmd) { case OPENPCD_CMD_PIO_IRQ: -- cgit v1.2.3