X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Flpc%2Fao_adc_lpc.c;h=6324155977a7a4a538bf3cdbd051e274fae42a33;hp=e1aae0e484d5c726910185e5c15907c41a5932f6;hb=80affca535c5c43a5d9963dfafc74f9675c9b155;hpb=e11fcc299f4a1a0461a3442ca13f8984d76c30ff diff --git a/src/lpc/ao_adc_lpc.c b/src/lpc/ao_adc_lpc.c index e1aae0e4..63241559 100644 --- a/src/lpc/ao_adc_lpc.c +++ b/src/lpc/ao_adc_lpc.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -111,23 +112,7 @@ void lpc_adc_isr(void) } AO_DATA_PRESENT(AO_DATA_ADC); - if (ao_data_present == AO_DATA_ALL) { -#if HAS_MS5607 - ao_data_ring[ao_data_head].ms5607_raw = ao_ms5607_current; -#endif -#if HAS_MMA655X - ao_data_ring[ao_data_head].mma655x = ao_mma655x_current; -#endif -#if HAS_HMC5883 - ao_data_ring[ao_data_head].hmc5883 = ao_hmc5883_current; -#endif -#if HAS_MPU6000 - ao_data_ring[ao_data_head].mpu6000 = ao_mpu6000_current; -#endif - ao_data_ring[ao_data_head].tick = ao_tick_count; - ao_data_head = ao_data_ring_next(ao_data_head); - ao_wakeup((void *) &ao_data_head); - } + ao_data_fill(ao_data_head); ao_adc_ready = 1; } @@ -146,7 +131,7 @@ ao_adc_poll(void) } static void -ao_adc_dump(void) __reentrant +ao_adc_dump(void) { struct ao_data packet; #ifndef AO_ADC_DUMP @@ -160,13 +145,13 @@ ao_adc_dump(void) __reentrant #else printf("tick: %5u", packet.tick); d = (int16_t *) (&packet.adc); - for (i = 0; i < AO_NUM_ADC; i++) + for (i = 0; i < AO_ADC_NUM; i++) printf (" %2d: %5d", i, d[i]); printf("\n"); #endif } -__code struct ao_cmds ao_adc_cmds[] = { +const struct ao_cmds ao_adc_cmds[] = { { ao_adc_dump, "a\0Display current ADC values" }, { 0, NULL }, };