Get Thermal mass

This commit is contained in:
Ben V. Brown
2022-07-07 22:07:33 +10:00
parent 0d248a601b
commit 41dee449ce
2 changed files with 10 additions and 1 deletions

View File

@@ -19,6 +19,8 @@ void power_check();
// Returns the tip resistance in x10 ohms, so 7.5 = 75; 14=140 etc
uint8_t getTipResitanceX10();
uint8_t getTipThermalMass();
#ifdef __cplusplus
}
#endif

View File

@@ -229,10 +229,17 @@ void setStatusLED(const enum StatusLED state) {
uint8_t lastTipResistance = 0; // default to unknown
uint32_t lastTipReadinguV = 0;
uint8_t getTipResitanceX10() {
// Return tip resistance in x10 ohms
// Return tip resistance in x10 ohms
// We can measure this using the op-amp
return lastTipResistance;
}
uint8_t getTipThermalMass() {
if (lastTipResistance >= 80) {
return TIP_THERMAL_MASS;
}
return (TIP_THERMAL_MASS * 25) / 10;
}
void startMeasureTipResistance() {
// We want to calculate lastTipResistance
// If tip is connected, and the tip is cold and the tip is not being heated