X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=modules%2Fhardware%2Fadc%2Fadc.c;h=bc4c12291d60c424cfb167081e20071dabba44d7;hp=a40d73022c149574ba042945235f76b3525b4487;hb=8a0b4d5c16a9a304515b42f56ff321c2cdd27eb6;hpb=ccc6954bb046671b9e28c5806db5121c1eef49c0 diff --git a/modules/hardware/adc/adc.c b/modules/hardware/adc/adc.c index a40d730..bc4c122 100644 --- a/modules/hardware/adc/adc.c +++ b/modules/hardware/adc/adc.c @@ -33,7 +33,7 @@ static void (*adc_event)(int16_t) = NULL; /** * Initialisation of ADC internal registers - * Can be called for a wake up after a shutdown command + * Can be called for a wake up after a shutdown command */ void adc_init(void) { @@ -82,7 +82,12 @@ void adc_register_event(void (*f)(int16_t)) * Interrupt function, other interrupts are disabled during its * execution. */ -SIGNAL(SIG_ADC) +#ifndef ADC_vect +#if defined(SIG_ADC) +#define ADC_vect SIG_ADC +#endif +#endif +SIGNAL(ADC_vect) { int16_t result; @@ -90,7 +95,7 @@ SIGNAL(SIG_ADC) return; result = ADC; - + /* sign extension to fill the 16 bits when negative * (for the 16 bits output format, the output is * already right.) */ @@ -98,7 +103,7 @@ SIGNAL(SIG_ADC) && !(g_adc_previous_config & ADC_MODE_16_BITS) && (result & 0x0200) ) result |= 0xFE00; - + adc_event(result); }