mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Add isTipShorted() to warnings
This commit is contained in:
@@ -284,6 +284,7 @@ void performTipResistanceSampleReading() {
|
||||
|
||||
tipResistanceReadingSlot++;
|
||||
}
|
||||
bool tipShorted = false;
|
||||
void FinishMeasureTipResistance() {
|
||||
|
||||
// Otherwise we now have the 4 samples;
|
||||
@@ -303,6 +304,8 @@ void FinishMeasureTipResistance() {
|
||||
// return; // Change nothing as probably disconnected tip
|
||||
tipResistanceReadingSlot = lastTipResistance = 0;
|
||||
return;
|
||||
} else if (reading < 200) {
|
||||
tipShorted = true;
|
||||
} else if (reading < 800) {
|
||||
newRes = 62;
|
||||
} else {
|
||||
@@ -372,7 +375,7 @@ uint64_t getDeviceID() {
|
||||
|
||||
uint8_t preStartChecksDone() {
|
||||
#ifdef TIP_RESISTANCE_SENSE_Pin
|
||||
return (lastTipResistance == 0 || tipResistanceReadingSlot < numTipResistanceReadings || tipMeasurementOccuring) ? 0 : 1;
|
||||
return (lastTipResistance == 0 || tipResistanceReadingSlot < numTipResistanceReadings || tipMeasurementOccuring || tipShorted) ? 0 : 1;
|
||||
#else
|
||||
return 1;
|
||||
#endif
|
||||
@@ -387,7 +390,11 @@ uint8_t getTipResistanceX10() {
|
||||
return TIP_RESISTANCE;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef TIP_RESISTANCE_SENSE_Pin
|
||||
bool isTipShorted() { return tipShorted; }
|
||||
#else
|
||||
bool isTipShorted() { return false; }
|
||||
#endif
|
||||
uint8_t getTipThermalMass() {
|
||||
#ifdef TIP_RESISTANCE_SENSE_Pin
|
||||
if (lastTipResistance >= 80) {
|
||||
|
||||
Reference in New Issue
Block a user