summaryrefslogtreecommitdiff
path: root/firmware/src/picc/adc.c
diff options
context:
space:
mode:
authorlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-09-20 11:44:10 +0000
committerlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-09-20 11:44:10 +0000
commit514b0f72f50b50b75ef855f008c888f29989d68e (patch)
tree4a48031e2d2e95512ae3dc868301b5314c317081 /firmware/src/picc/adc.c
parent20b657d7d20508b2a5fedf2e7a59a30e3d9a2fa4 (diff)
- 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
Diffstat (limited to 'firmware/src/picc/adc.c')
-rw-r--r--firmware/src/picc/adc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/firmware/src/picc/adc.c b/firmware/src/picc/adc.c
index c78f89d..f350a49 100644
--- a/firmware/src/picc/adc.c
+++ b/firmware/src/picc/adc.c
@@ -74,7 +74,7 @@ static void adc_irq(void)
if (sr & AT91C_ADC_ENDRX) {
/* rctx full, get rid of it */
DEBUGADC("sending rctx (val=%s) ",
- hexdump(rctx->tx.data[4], 2));
+ hexdump(rctx->data[4], 2));
req_ctx_set_state(rctx, RCTX_STATE_UDP_EP2_PENDING);
adc_state.state = ADC_NONE;
@@ -115,8 +115,7 @@ u_int16_T adc_read_pll_dem(void)
static int adc_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[0];
switch (poh->cmd) {
case OPENPCD_CMD_ADC_READ:
@@ -129,9 +128,8 @@ static int adc_usb_in(struct req_ctx *rctx)
adc_state.state = ADC_READ_CONTINUOUS_USB;
adc_state.rctx = rctx;
- memcpy(pih, poh, sizeof(*pih));
- rctx->tx.tot_len = sizeof(*pih) + poh->val * 2;
- AT91F_PDC_SetRx(AT91C_BASE_PDC_ADC, rctx->rx.data, poh->val);
+ rctx->tot_len = sizeof(*poh) + poh->val * 2;
+ AT91F_PDC_SetRx(AT91C_BASE_PDC_ADC, rctx->data, poh->val);
AT91F_PDC_EnableRx(AT91C_BASE_PDC_ADC);
AT91F_ADC_EnableChannel(AT91C_BASE_ADC, OPENPICC_ADC_CH_FIELDSTR);
AT91F_ADC_EnableIt(AT91C_BASE_ADC, AT91C_ADC_ENDRX |
personal git repositories of Harald Welte. Your mileage may vary