Minor fixes.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 11 Oct 2011 17:16:54 +0000 (17:16 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 11 Oct 2011 17:16:54 +0000 (17:16 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5157 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/cortex-m3/drv/adc_sam3.c
boards/sam3x-ek/hw/hw_adc.h

index 303689f10ce7745118603f5393ed06d1801e7615..f9fdc132ce2f251e1e967bc8ee552d6cf222fbbc 100644 (file)
@@ -59,7 +59,7 @@
 
 
 /* We use event to signal the end of conversion */
-static Event data_ready;
+static Event adc_data_ready;
 /* The last converted data */
 static uint32_t data;
 
@@ -76,11 +76,10 @@ static uint32_t data;
  */
 static DECLARE_ISR(adc_conversion_end_irq)
 {
-       data = 0;
        if (ADC_ISR & BV(ADC_DRDY))
        {
                data = ADC_LDATA;
-               event_do(&data_ready);
+               event_do(&adc_data_ready);
        }
 }
 
@@ -101,7 +100,7 @@ void adc_hw_select_ch(uint8_t ch)
 uint16_t adc_hw_read(void)
 {
        ADC_CR = BV(ADC_START);
-       event_wait(&data_ready);
+       event_wait(&adc_data_ready);
        return(data);
 }
 
@@ -114,13 +113,13 @@ void adc_hw_init(void)
        IRQ_ASSERT_ENABLED();
 
        /* Initialize the dataready event */
-       event_initGeneric(&data_ready);
+       event_initGeneric(&adc_data_ready);
 
        /* Clock ADC peripheral */
        pmc_periphEnable(ADC_ID);
 
         /* Reset adc controller */
-       ADC_CR = ADC_SWRST;
+       ADC_CR |= BV(ADC_SWRST);
 
        /*
         * Set adc mode register:
index 4f0bc243b088f721887be86de77e00a6a6eacb14..1b9cc38d6b3a7d944022da762d3970493da41adc 100644 (file)
@@ -47,7 +47,7 @@
 INLINE void hw_enableTempRead(void)
 {
 
-       ADC_ACR = BV(ADC_TSON);
+       ADC_ACR |= BV(ADC_TSON);
 }