Add some adc function hw specific.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 28 Jun 2010 18:03:04 +0000 (18:03 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 28 Jun 2010 18:03:04 +0000 (18:03 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3962 38d2e660-2303-0410-9eaa-f027e97ec537

boards/stm32-p103/hw/hw_adc.h

index 3c6e4bbce7952c59026c2fa94b2818e83468f550..2883d8ab3801a2e4266ca856c47bb85447a4a56c 100644 (file)
@@ -47,10 +47,10 @@ INLINE uint16_t hw_readVrefint(void)
        return ADC_RANGECONV(adc_read(ADC_VREFINT_CH), 0, 3.3);
 }
 
-INLINE float hw_readIntTemp(void)
+INLINE uint16_t hw_readIntTemp(void)
 {
-       float vsens = ADC_RANGECONV(adc_read(ADC_TEMP_CH), 0, 3.3);
-       return (float)(((ADC_TEMP_V25 - vsens) / ADC_TEMP_SLOPE) + ADC_TEMP_CONST);
+       uint16_t vsens = ADC_RANGECONV(adc_read(ADC_TEMP_CH), 0, 3300);
+       return (((ADC_TEMP_V25 - vsens) / ADC_TEMP_SLOPE) + ADC_TEMP_CONST);
 }
 
 #endif /* HW_ADC_H */