Skip to content

Commit 087cd26

Browse files
committed
STM32L0 ADC TEMPERATURE CHANNEL rework
1 parent 51b8d6e commit 087cd26

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

targets/TARGET_STM/TARGET_STM32L0/analogin_device.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,6 @@ uint16_t adc_read(analogin_t *obj)
172172

173173
HAL_ADC_ConfigChannel(&obj->handle, &sConfig);
174174

175-
/* need to wait for some stabilization time after setting the TSEN bit in the ADC_CCR
176-
register to wake up the temperature sensor from power down mode */
177-
if (sConfig.Channel == ADC_CHANNEL_TEMPSENSOR) {
178-
wait_ms(20);
179-
}
180-
181175
HAL_ADC_Start(&obj->handle); // Start conversion
182176

183177
// Wait end of conversion and get value

targets/TARGET_STM/TARGET_STM32L0/device/stm32l0xx_hal_adc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,8 @@
280280
#define ADC_STAB_DELAY_US ((uint32_t) 1U)
281281

282282
/* Delay for temperature sensor stabilization time. */
283-
/* Maximum delay is 10us (refer to device datasheet, parameter tSTART). */
284283
/* Unit: us */
285-
#define ADC_TEMPSENSOR_DELAY_US ((uint32_t) 10U)
284+
#define ADC_TEMPSENSOR_DELAY_US ((uint32_t) 20000U)
286285
/**
287286
* @}
288287
*/

0 commit comments

Comments
 (0)