From c125263b0e4bc71550853efd52dbd1dcaff21eb2 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Mon, 27 Mar 2023 23:57:56 -0400 Subject: [PATCH] different API --- firmware/controllers/sensors/thermistors.cpp | 14 ++++++++++++++ firmware/controllers/sensors/thermistors.h | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/firmware/controllers/sensors/thermistors.cpp b/firmware/controllers/sensors/thermistors.cpp index f9929c01c2..ed05731314 100644 --- a/firmware/controllers/sensors/thermistors.cpp +++ b/firmware/controllers/sensors/thermistors.cpp @@ -16,6 +16,20 @@ void setDodgeSensor(ThermistorConf *thermistorConf, float pullup) { thermistorConf->config = {-40, 30, 120, 336660, 7550, 390, pullup}; } +void setAtSensor(ThermistorConf *thermistorConf, + float tempLow, float rLow, + float tempMid, float rMid, + float tempHigh, float rHigh) { + thermistorConf->config.tempC_1 = tempLow; + thermistorConf->config.resistance_1 = rLow; + + thermistorConf->config.tempC_2 = tempMid; + thermistorConf->config.resistance_2 = rMid; + + thermistorConf->config.tempC_3 = tempHigh; + thermistorConf->config.resistance_3 = rHigh; +} + // todo: better method name? void setCommonNTCSensor(ThermistorConf *thermistorConf, float pullup) { /** diff --git a/firmware/controllers/sensors/thermistors.h b/firmware/controllers/sensors/thermistors.h index 966b0a50db..e0c387858b 100644 --- a/firmware/controllers/sensors/thermistors.h +++ b/firmware/controllers/sensors/thermistors.h @@ -15,6 +15,11 @@ #define convertKelvinToCelcius(tempK) ((tempK) - KELV) #define convertCelsiusToKelvin(tempC) ((tempC) + KELV) +void setAtSensor(ThermistorConf *thermistorConf, + float tempLow, float rLow, + float tempMid, float rMid, + float tempHigh, float rHigh); + void setCommonNTCSensor(ThermistorConf *thermistorConf, float pullup); void setDodgeSensor(ThermistorConf *thermistorConf, float pullup); void set10K_4050K(ThermistorConf *thermistorConf, float pullup);