Skip to content

Commit 4fe00ca

Browse files
committed
Code formating and readability improvements
1 parent 667bb15 commit 4fe00ca

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/utility/THERMOCOUPLE/MAX31855.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ uint32_t MAX31855Class::readSensor() {
6262

6363
_spi->beginTransaction(_spiSettings);
6464

65-
6665
for (int i = 0; i < 4; i++) {
6766
read <<= 8;
6867
read |= _spi->transfer(0);
@@ -198,7 +197,7 @@ float MAX31855Class::readTCTemperature() {
198197
float MAX31855Class::readReferenceTemperature() {
199198
//TODO. Actually use TC _current_probe_type and _coldOffset
200199
uint32_t rawword;
201-
float ref;
200+
float referenceTemperature;
202201

203202
rawword = readSensor();
204203

@@ -210,13 +209,13 @@ float MAX31855Class::readReferenceTemperature() {
210209
rawword = rawword & 0x7FF;
211210
// check sign bit and convert to negative value.
212211
if (rawword & 0x800) {
213-
ref = (0xF800 | (rawword & 0x7FF)) * 0.0625;
212+
referenceTemperature = (0xF800 | (rawword & 0x7FF)) * 0.0625;
214213
} else {
215214
// multiply for the LSB value
216-
ref = rawword * 0.0625f;
215+
referenceTemperature = rawword * 0.0625f;
217216
}
218217

219-
return ref;
218+
return referenceTemperature;
220219
}
221220

222221
void MAX31855Class::setColdOffset(float offset) {

src/utility/THERMOCOUPLE/MAX31855.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class MAX31855Class {
3737
void setTCType(uint8_t type);
3838

3939
private:
40-
uint32_t readSensor();
4140
float _coldOffset;
4241
uint8_t _faultMask = TC_FAULT_ALL;
4342
uint8_t _lastFault = 0;
@@ -112,10 +111,10 @@ class MAX31855Class {
112111
{sizeof(InvT0_400) / sizeof(double), 20.872f, &InvT0_400[0]},
113112
};
114113

114+
uint32_t readSensor();
115115
double mvtoTemp(double voltage);
116116
double tempTomv(double temp);
117117
double polynomial(double value, int tableEntries, coefftable const (*table));
118-
119118
};
120119

121120
#endif

0 commit comments

Comments
 (0)