mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Check hall effect sensor is present before threshold
This commit is contained in:
@@ -70,8 +70,7 @@ void gui_drawTipTemp(bool symbol) {
|
||||
uint32_t Temp = 0;
|
||||
if (systemSettings.temperatureInF) {
|
||||
Temp = TipThermoModel::getTipInF();
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
Temp = TipThermoModel::getTipInC();
|
||||
}
|
||||
|
||||
@@ -274,8 +273,7 @@ static void gui_solderingTempAdjust() {
|
||||
OLED::printNumber(systemSettings.SolderingTemp, 3);
|
||||
if (systemSettings.temperatureInF)
|
||||
OLED::drawSymbol(0);
|
||||
else
|
||||
{
|
||||
else {
|
||||
OLED::drawSymbol(1);
|
||||
}
|
||||
OLED::print(SymbolSpace);
|
||||
@@ -410,7 +408,7 @@ static bool shouldBeSleeping(bool inAutoStart) {
|
||||
}
|
||||
}
|
||||
if (lastMovementTime > 0 || lastButtonTime > 0) {
|
||||
if ((xTaskGetTickCount() - lastMovementTime) > getSleepTimeout() && (xTaskGetTickCount() - lastButtonTime) > getSleepTimeout()) {
|
||||
if (((xTaskGetTickCount() - lastMovementTime) > getSleepTimeout()) && ((xTaskGetTickCount() - lastButtonTime) > getSleepTimeout())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -419,7 +417,7 @@ static bool shouldBeSleeping(bool inAutoStart) {
|
||||
#ifdef HALL_SENSOR
|
||||
// If the hall effect sensor is enabled in the build, check if its over
|
||||
// threshold, and if so then we force sleep
|
||||
if (lookupHallEffectThreshold()) {
|
||||
if (getHallSensorFitted() && lookupHallEffectThreshold()) {
|
||||
int16_t hallEffectStrength = getRawHallEffect();
|
||||
if (hallEffectStrength < 0)
|
||||
hallEffectStrength = -hallEffectStrength;
|
||||
@@ -516,7 +514,8 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
|
||||
if (oldTemp != systemSettings.SolderingTemp) {
|
||||
saveSettings(); // only save on change
|
||||
}
|
||||
} break;
|
||||
}
|
||||
break;
|
||||
case BUTTON_BOTH_LONG:
|
||||
if (systemSettings.lockingMode != 0) {
|
||||
// Lock buttons
|
||||
@@ -655,7 +654,9 @@ void showDebugMenu(void) {
|
||||
break;
|
||||
case 6:
|
||||
// Raw Tip
|
||||
{ OLED::printNumber(TipThermoModel::convertTipRawADCTouV(getTipRawTemp(0), true), 6); }
|
||||
{
|
||||
OLED::printNumber(TipThermoModel::convertTipRawADCTouV(getTipRawTemp(0), true), 6);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
// Temp in C
|
||||
|
||||
Reference in New Issue
Block a user