From ab84b694b66760952c15d838eb01d0461c30751e Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 15 Feb 2023 10:24:30 -0800 Subject: [PATCH] decode temperature based on sensor type --- firmware/sampling.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/firmware/sampling.cpp b/firmware/sampling.cpp index a9f8fe3..790be3f 100644 --- a/firmware/sampling.cpp +++ b/firmware/sampling.cpp @@ -126,7 +126,16 @@ float GetSensorTemperature(int ch) return 0; } - return interpolate2d(esr, lsu49TempBins, lsu49TempValues); + switch (GetSensorType()) { + case SensorType::LSU49: + return interpolate2d(esr, lsu49TempBins, lsu49TempValues); + case SensorType::LSU42: + return interpolate2d(esr, lsu42TempBins, lsu42TempValues); + case SensorType::LSUADV: + return interpolate2d(esr, lsuAdvTempBins, lsuAdvTempValues); + } + + return 0; } float GetNernstDc(int ch)