X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Farm%2Fdrv%2Fadc_at91.c;h=3ebbfa75be80dd25d186b8f0cb606b74f4006c58;hb=bdcc52e5f18159cadc413c53dd14ef468a6de376;hp=59fd1c6893b6f62a602ce48f41fb28f2efbec420;hpb=211f1718bc7a3553323733eea821a477decf0cc7;p=bertos.git diff --git a/bertos/cpu/arm/drv/adc_at91.c b/bertos/cpu/arm/drv/adc_at91.c index 59fd1c68..3ebbfa75 100644 --- a/bertos/cpu/arm/drv/adc_at91.c +++ b/bertos/cpu/arm/drv/adc_at91.c @@ -35,31 +35,36 @@ * * This ADC module should be use both whit kernel or none. * If you are using a kernel, the adc drive does not wait the finish of - * conversion but use a singal every time a required conversion are - * ended. This signal wake up a process that return a result of + * conversion but use a singal every time a required conversion are + * ended. This signal wake up a process that return a result of * conversion. Otherwise, if you not use a kernl, this module wait * whit a loop the finishing of conversion. * * * \version $Id$ - * + * * \author Daniele Basile */ -#include "adc_at91.h" -#include +#include "adc_at91.h" +#include "cfg/cfg_adc.h" +#include "cfg/cfg_kern.h" #include #include -#include +// Define logging setting (for cfg/log.h module). +#define LOG_LEVEL ADC_LOG_LEVEL +#define LOG_VERBOSITY ADC_LOG_VERBOSITY +#include + +#include -#include "appconfig.h" +#include #if CONFIG_KERNEL #include - #include #include #include @@ -172,23 +177,23 @@ INLINE void adc_hw_init(void) #endif /* \} */ - TRACEMSG("prescaler[%ld], stup[%ld], shtim[%ld]\n",ADC_COMPUTED_PRESCALER,ADC_COMPUTED_STARTUPTIME,ADC_COMPUTED_SHTIME); + LOG_INFO("prescaler[%ld], stup[%ld], shtim[%ld]\n",ADC_COMPUTED_PRESCALER, ADC_COMPUTED_STARTUPTIME, ADC_COMPUTED_SHTIME); //Apply computed prescaler value ADC_MR &= ~ADC_PRESCALER_MASK; ADC_MR |= ((ADC_COMPUTED_PRESCALER << ADC_PRESCALER_SHIFT) & ADC_PRESCALER_MASK); - TRACEMSG("prescaler[%ld]\n", (ADC_COMPUTED_PRESCALER << ADC_PRESCALER_SHIFT) & ADC_PRESCALER_MASK); + LOG_INFO("prescaler[%ld]\n", (ADC_COMPUTED_PRESCALER << ADC_PRESCALER_SHIFT) & ADC_PRESCALER_MASK); //Apply computed start up time ADC_MR &= ~ADC_STARTUP_MASK; ADC_MR |= ((ADC_COMPUTED_STARTUPTIME << ADC_STARTUP_SHIFT) & ADC_STARTUP_MASK); - TRACEMSG("sttime[%ld]\n", (ADC_COMPUTED_STARTUPTIME << ADC_STARTUP_SHIFT) & ADC_STARTUP_MASK); + LOG_INFO("sttime[%ld]\n", (ADC_COMPUTED_STARTUPTIME << ADC_STARTUP_SHIFT) & ADC_STARTUP_MASK); //Apply computed sample and hold time ADC_MR &= ~ADC_SHTIME_MASK; ADC_MR |= ((ADC_COMPUTED_SHTIME << ADC_SHTIME_SHIFT) & ADC_SHTIME_MASK); - TRACEMSG("shtime[%ld]\n", (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 //Register and enable irq for adc.