From 40ba6f2fce8f3cecc68a04cac0b949b08e4cba3a Mon Sep 17 00:00:00 2001 From: asterix Date: Tue, 28 Sep 2010 10:39:29 +0000 Subject: [PATCH] Wait the acquisition ends. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4324 38d2e660-2303-0410-9eaa-f027e97ec537 --- boards/ek-lm3s1968/hw/hw_adc.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/boards/ek-lm3s1968/hw/hw_adc.h b/boards/ek-lm3s1968/hw/hw_adc.h index 53ba119f..66d64365 100644 --- a/boards/ek-lm3s1968/hw/hw_adc.h +++ b/boards/ek-lm3s1968/hw/hw_adc.h @@ -51,6 +51,9 @@ INLINE uint16_t hw_readRawTemp(void) /* Trig the temperature sampling */ HWREG(ADC0_BASE + ADC_O_PSSI) |= ADC_PSSI_SS3; + /* Poll untill acquisition end */ + while (!(HWREG(ADC0_BASE + ADC_O_SSFSTAT3) & ADC_SSFSTAT3_FULL)); + return (uint16_t)HWREG(ADC0_BASE + ADC_O_SSFIFO3); } @@ -62,6 +65,9 @@ INLINE uint16_t hw_readIntTemp(void) /* Trig the temperature sampling */ HWREG(ADC0_BASE + ADC_O_PSSI) |= ADC_PSSI_SS3; + /* Poll untill acquisition end */ + while (!(HWREG(ADC0_BASE + ADC_O_SSFSTAT3) & ADC_SSFSTAT3_FULL)); + return (uint16_t)(14750 - ADC_RANGECONV(HWREG(ADC0_BASE + ADC_O_SSFIFO3), 0, 300) * 75); } -- 2.25.1