diff options
author | Damien George <damien@micropython.org> | 2025-06-25 14:25:10 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-07-08 13:15:35 +1000 |
commit | c9adabc25a648a3d3d1e32bc60866a1bad30ffc5 (patch) | |
tree | 282ee37e122f71e65df750bbc6edaf2e92bb5cad | |
parent | 841439d5fb285a748acb0bdfa8c0cac7af7b10a7 (diff) |
stm32/adc: Fix core temperature reading on WB55.
It needs a divisor of 100 because the calibration temperatures are 30 and
130 degrees, similar to the H5.
Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r-- | ports/stm32/adc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/stm32/adc.c b/ports/stm32/adc.c index 34c52f489..10d781259 100644 --- a/ports/stm32/adc.c +++ b/ports/stm32/adc.c @@ -923,7 +923,7 @@ float adc_read_core_temp_float(ADC_HandleTypeDef *adcHandle) { return 0; } float core_temp_avg_slope = (*ADC_CAL2 - *ADC_CAL1) / 100.0f; - #elif defined(STM32H5) + #elif defined(STM32H5) || defined(STM32WB) int32_t raw_value = adc_config_and_read_ref(adcHandle, ADC_CHANNEL_TEMPSENSOR); float core_temp_avg_slope = (*ADC_CAL2 - *ADC_CAL1) / 100.0f; #else |