Fix log message. Add define for temperature sensor.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 22 Mar 2011 13:08:45 +0000 (13:08 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 22 Mar 2011 13:08:45 +0000 (13:08 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4789 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/cortex-m3/drv/adc_sam3.c
bertos/cpu/cortex-m3/io/sam3_adc.h

index 512e978d9f7db8f726a2d1bf3e6b6dc80100b0a0..303689f10ce7745118603f5393ed06d1801e7615 100644 (file)
@@ -143,13 +143,13 @@ void adc_hw_init(void)
        ADC_MR |= ((ADC_PRESCALER << ADC_PRESCALER_SHIFT) & ADC_PRESCALER_MASK);
        LOG_INFO("prescaler[%ld]\n", ADC_PRESCALER);
        ADC_MR |= ((CONFIG_ADC_SUT << ADC_STARTUP_SHIFT) & ADC_STARTUP_MASK);
-       LOG_INFO("starup[%d]\n", ADC_SUT512);
+       LOG_INFO("starup[%d]\n", CONFIG_ADC_SUT);
        ADC_MR |= ((CONFIG_ADC_STTLING << ADC_SETTLING_SHIFT) & ADC_SETTLING_MASK);
-       LOG_INFO("sttime[%d]\n", ADC_AST17);
+       LOG_INFO("sttime[%d]\n", CONFIG_ADC_STTLING);
        ADC_MR |= ((CONFIG_ADC_TRACKTIM << ADC_TRACKTIM_SHIFT) & ADC_TRACKTIM_MASK);
-       LOG_INFO("tracking[%d]\n", 0);
+       LOG_INFO("tracking[%d]\n", CONFIG_ADC_TRACKTIM);
        ADC_MR |= ((CONFIG_ADC_TRANSFER << ADC_TRANSFER_SHIFT) & ADC_TRANSFER_MASK);
-       LOG_INFO("tranfer[%d]\n", 1);
+       LOG_INFO("tranfer[%d]\n", CONFIG_ADC_TRANSFER);
 
        /* Register and enable irq for adc. */
        sysirq_setHandler(INT_ADC, adc_conversion_end_irq);
index 47fcaed43c9b4bf485cc174b6fc896966e3c42d0..30bac49f8631ef43e8c343fef114e4aa513752e2 100644 (file)
 #define ADC_ACR_OFF              0x00000094     ///< Analog control register offeset.
 #define ADC_ACR          (*((reg32_t *)(ADC_BASE + ADC_ACR_OFF))) ///< Analog control register.
 #define ADC_TSON                          4     ///< Temperature Sensor On.
+#define ADC_TEMPERATURE_CH               15     ///< Channel where is the internal sensor temperature
 /* \} */
 
 #endif /* SAM3_ADC_H */