Skip to content

Commit

Permalink
Merge pull request #9246 from jeromecoutant/PR_L0TEMP
Browse files Browse the repository at this point in the history
STM32L0 TEMPERATURE ADC CHANNEL minor update
  • Loading branch information
Cruz Monrreal committed Jan 3, 2019
2 parents e66e616 + 087cd26 commit f83e1d2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
6 changes: 0 additions & 6 deletions targets/TARGET_STM/TARGET_STM32L0/analogin_device.c
Expand Up @@ -172,12 +172,6 @@ uint16_t adc_read(analogin_t *obj)

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

/* need to wait for some stabilization time after setting the TSEN bit in the ADC_CCR
register to wake up the temperature sensor from power down mode */
if (sConfig.Channel == ADC_CHANNEL_TEMPSENSOR) {
wait_ms(20);
}

HAL_ADC_Start(&obj->handle); // Start conversion

// Wait end of conversion and get value
Expand Down
3 changes: 1 addition & 2 deletions targets/TARGET_STM/TARGET_STM32L0/device/stm32l0xx_hal_adc.c
Expand Up @@ -280,9 +280,8 @@
#define ADC_STAB_DELAY_US ((uint32_t) 1U)

/* Delay for temperature sensor stabilization time. */
/* Maximum delay is 10us (refer to device datasheet, parameter tSTART). */
/* Unit: us */
#define ADC_TEMPSENSOR_DELAY_US ((uint32_t) 10U)
#define ADC_TEMPSENSOR_DELAY_US ((uint32_t) 20000U)
/**
* @}
*/
Expand Down

0 comments on commit f83e1d2

Please sign in to comment.