Skip to content

Commit f0eec75

Browse files
committed
Remove artifacts, Thermocouple type-t corrections and typo corrected
1 parent 907a450 commit f0eec75

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

src/RTDTempProbeClass.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@
77
/* Includes -----------------------------------------------------------------*/
88
#include "RTDTempProbeClass.h"
99

10-
#if __has_include("portenta_info.h")
11-
#include "portenta_info.h"
12-
#define TRY_REV2_RECOGNITION
13-
uint8_t* boardInfo();
14-
#define PMC_R2_SKU (24 << 8 | 3)
15-
#endif
16-
1710
/* Functions -----------------------------------------------------------------*/
1811
RTDTempProbeClass::RTDTempProbeClass(PinName rtd_cs_pin,
1912
PinName ch_sel0_pin,

src/TCTempProbeClass.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@
77
/* Includes -----------------------------------------------------------------*/
88
#include "TCTempProbeClass.h"
99

10-
#if __has_include("portenta_info.h")
11-
#include "portenta_info.h"
12-
#define TRY_REV2_RECOGNITION
13-
uint8_t* boardInfo();
14-
#define PMC_R2_SKU (24 << 8 | 3)
15-
#endif
16-
1710
/* Functions -----------------------------------------------------------------*/
1811
TCTempProbeClass::TCTempProbeClass(PinName tc_cs_pin,
1912
PinName ch_sel0_pin,

src/utility/THERMOCOUPLE/MAX31855.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ double MAX31855Class::tempTomv(double temp) {
107107
table = CoeffK;
108108
tableEntries = sizeof(CoeffK) / sizeof(coefftable);
109109
break;
110+
case PROBE_TC_T:
111+
table = CoeffT;
112+
tableEntries = sizeof(CoeffT) / sizeof(coefftable);
113+
break;
110114
}
111115
voltage = polynomial(temp, tableEntries, table);
112116
// special case... for K probes in temperature range 0-1372 we need
@@ -130,6 +134,10 @@ double MAX31855Class::mvtoTemp(double voltage) {
130134
table = InvCoeffK;
131135
tableEntries = sizeof(InvCoeffJ) / sizeof(coefftable);
132136
break;
137+
case PROBE_TC_T:
138+
table = InvCoeffT;
139+
tableEntries = sizeof(InvCoeffT) / sizeof(coefftable);
140+
break;
133141
}
134142
return polynomial(voltage, tableEntries, table);
135143
}
@@ -151,7 +159,7 @@ double MAX31855Class::readTCVoltage() {
151159
}
152160

153161
// The cold junction temperature is stored in the last 14 word's bits
154-
// whereas the ttermocouple temperature (non linearized) is in the topmost 18 bits
162+
// whereas the thermocouple temperature (non linearized) is in the topmost 18 bits
155163
// sent by the Thermocouple-to-Digital Converter
156164

157165
// sign extend thermocouple value
@@ -176,7 +184,7 @@ double MAX31855Class::readTCVoltage() {
176184
// convert it to degrees
177185
measuredCold = (measuredColdInt / 16.0f);
178186
// now the tricky part... since MAX31855K is considering a linear response
179-
// and is trimed for K thermocouples, we have to convert the reading back
187+
// and is trimmed for K thermocouples, we have to convert the reading back
180188
// to mV and then use NIST polynomial approximation to determine temperature
181189
// we know that reading from chip is calculated as:
182190
// temp = chip_temperature + thermocouple_voltage/0.041276f

src/utility/THERMOCOUPLE/MAX31855.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class MAX31855Class {
9595
};
9696

9797
static constexpr coefftable CoeffT []= {
98-
{0,-270, NULL},
98+
{0,-270.0f, NULL},
9999
{sizeof(Tm270_0) / sizeof(double), 0.0f, &Tm270_0[0]},
100100
{sizeof(T0_400) / sizeof(double), 400.0f, &T0_400[0]}
101101
};

0 commit comments

Comments
 (0)