mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Get Thermal mass
This commit is contained in:
@@ -19,6 +19,8 @@ void power_check();
|
|||||||
// Returns the tip resistance in x10 ohms, so 7.5 = 75; 14=140 etc
|
// Returns the tip resistance in x10 ohms, so 7.5 = 75; 14=140 etc
|
||||||
uint8_t getTipResitanceX10();
|
uint8_t getTipResitanceX10();
|
||||||
|
|
||||||
|
uint8_t getTipThermalMass();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -229,10 +229,17 @@ void setStatusLED(const enum StatusLED state) {
|
|||||||
uint8_t lastTipResistance = 0; // default to unknown
|
uint8_t lastTipResistance = 0; // default to unknown
|
||||||
uint32_t lastTipReadinguV = 0;
|
uint32_t lastTipReadinguV = 0;
|
||||||
uint8_t getTipResitanceX10() {
|
uint8_t getTipResitanceX10() {
|
||||||
// Return tip resistance in x10 ohms
|
// Return tip resistance in x10 ohms
|
||||||
// We can measure this using the op-amp
|
// We can measure this using the op-amp
|
||||||
return lastTipResistance;
|
return lastTipResistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t getTipThermalMass() {
|
||||||
|
if (lastTipResistance >= 80) {
|
||||||
|
return TIP_THERMAL_MASS;
|
||||||
|
}
|
||||||
|
return (TIP_THERMAL_MASS * 25) / 10;
|
||||||
|
}
|
||||||
void startMeasureTipResistance() {
|
void startMeasureTipResistance() {
|
||||||
// We want to calculate lastTipResistance
|
// We want to calculate lastTipResistance
|
||||||
// If tip is connected, and the tip is cold and the tip is not being heated
|
// If tip is connected, and the tip is cold and the tip is not being heated
|
||||||
|
|||||||
Reference in New Issue
Block a user