X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=bertos%2Fcpu%2Farm%2Fdrv%2Fadc_at91.c;h=46ba341370ceb03e1bd4f2e9acbb4b406ee5d4ae;hb=1fc71821dbce1d85a5d5227bd9e6580b573e8eba;hp=dbeb6117ffbc57e7da78be8bd5913e376bd30310;hpb=36e34ca0af43a27f0092cc5217192b1c4a0ba104;p=bertos.git diff --git a/bertos/cpu/arm/drv/adc_at91.c b/bertos/cpu/arm/drv/adc_at91.c index dbeb6117..46ba3413 100644 --- a/bertos/cpu/arm/drv/adc_at91.c +++ b/bertos/cpu/arm/drv/adc_at91.c @@ -47,8 +47,11 @@ #include "adc_at91.h" +#include + #include "cfg/cfg_adc.h" -#include "cfg/cfg_kern.h" +#include "cfg/cfg_proc.h" +#include "cfg/cfg_signal.h" #include #include @@ -61,7 +64,7 @@ #include -#if CONFIG_KERNEL +#if CONFIG_KERN #include #include #include @@ -104,7 +107,7 @@ ADC_IER = BV(ADC_DRDY); } -#endif /* CONFIG_KERNEL */ +#endif /* CONFIG_KERN */ /** @@ -129,16 +132,16 @@ INLINE uint16_t adc_hw_read(void) { ASSERT(!(ADC_SR & ADC_EOC_MASK)); - #if CONFIG_KERNEL + #if CONFIG_KERN adc_process = proc_current(); #endif // Start convertion ADC_CR = BV(ADC_START); - #if CONFIG_KERNEL + #if CONFIG_KERN // Ensure IRQs enabled. - ASSERT(IRQ_ENABLED()); + IRQ_ASSERT_ENABLED(); sig_wait(SIG_ADC_COMPLETE); #else //Wait in polling until is done @@ -193,7 +196,7 @@ INLINE void adc_hw_init(void) ADC_MR |= ((ADC_COMPUTED_SHTIME << ADC_SHTIME_SHIFT) & ADC_SHTIME_MASK); LOG_INFO("shtime[%ld]\n", (ADC_COMPUTED_SHTIME << ADC_SHTIME_SHIFT) & ADC_SHTIME_MASK); - #if CONFIG_KERNEL + #if CONFIG_KERN //Register and enable irq for adc. adc_enable_irq(); #endif