From c9adabc25a648a3d3d1e32bc60866a1bad30ffc5 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 25 Jun 2025 14:25:10 +1000 Subject: [PATCH] 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 --- ports/stm32/adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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