Use the directory written in the lineedit as base directory for the file dialog
[bertos.git] / bertos / cpu / arm / drv / adc_at91.c
index 3ebbfa75be80dd25d186b8f0cb606b74f4006c58..46ba341370ceb03e1bd4f2e9acbb4b406ee5d4ae 100644 (file)
@@ -30,7 +30,6 @@
  *
  * -->
  *
- *
  * \brief ADC hardware-specific implementation
  *
  * This ADC module should be use both whit kernel or none.
  *
  *
  * \version $Id$
- *
  * \author Daniele Basile <asterix@develer.com>
  */
 
 
 #include "adc_at91.h"
 
+#include <cpu/irq.h>
+
 #include "cfg/cfg_adc.h"
-#include "cfg/cfg_kern.h"
+#include "cfg/cfg_proc.h"
+#include "cfg/cfg_signal.h"
 #include <cfg/macros.h>
 #include <cfg/compiler.h>
 
-// Define logging setting (for cfg/log.h module).
+// Define log settings for cfg/log.h.
 #define LOG_LEVEL         ADC_LOG_LEVEL
-#define LOG_VERBOSITY     ADC_LOG_VERBOSITY
+#define LOG_FORMAT        ADC_LOG_FORMAT
 #include <cfg/log.h>
 
 #include <drv/adc.h>
 
 #include <io/arm.h>
 
-#if CONFIG_KERNEL
+#if CONFIG_KERN
        #include <cfg/module.h>
        #include <kern/proc.h>
        #include <kern/signal.h>
                ADC_IER = BV(ADC_DRDY);
        }
 
-#endif /* CONFIG_KERNEL */
+#endif /* CONFIG_KERN */
 
 
 /**
@@ -131,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
@@ -195,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