Skip to content

Commit

Permalink
fix(color): No startup/shutdown haptic if haptic mode set to quiet (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeerick authored Nov 6, 2023
1 parent 085a12b commit 6bc9318
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions radio/src/opentx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -909,8 +909,8 @@ void checkThrottleStick()
throttleNotIdle, STR_PRESS_ANY_KEY_TO_SKIP);
dialog->setCloseCondition([]() { return !isThrottleWarningAlertNeeded(); });
dialog->runForever();
LED_ERROR_END();
}
LED_ERROR_END();
}
#else
void checkThrottleStick()
Expand Down Expand Up @@ -1479,7 +1479,9 @@ void runStartupAnimation()
else if (!isPowerOn) {
isPowerOn = true;
pwrOn();
haptic.play(15, 3, PLAY_NOW);
#if defined(HAPTIC)
if (g_eeGeneral.hapticMode != e_mode_quiet) haptic.play(15, 3, PLAY_NOW);
#endif
}
}

Expand Down Expand Up @@ -1553,13 +1555,21 @@ void opentxInit()
lcdClear();
lcdRefresh();
lcdRefreshWait();
#endif

bool radioSettingsValid = storageReadRadioSettings(false);
(void)radioSettingsValid;
// Load radio.yml so radio settings can be used
bool radioSettingsValid = false;
#if defined(RTC_BACKUP_RAM)
// Skip loading if EM startup and radio has RTC backup data
if (!UNEXPECTED_SHUTDOWN())
radioSettingsValid = storageReadRadioSettings(false);
#else
// No RTC backup - try and load even for EM startup
radioSettingsValid = storageReadRadioSettings(false);
#endif

#if defined(GUI) && !defined(COLORLCD)
lcdSetContrast();
#endif
#endif

BACKLIGHT_ENABLE(); // we start the backlight during the startup animation
Expand All @@ -1573,7 +1583,9 @@ void opentxInit()
}
#else // defined(PWR_BUTTON_PRESS)
pwrOn();
haptic.play(15, 3, PLAY_NOW);
#if defined(HAPTIC)
if (g_eeGeneral.hapticMode != e_mode_quiet) haptic.play(15, 3, PLAY_NOW);
#endif
#endif

// Radios handle UNEXPECTED_SHUTDOWN() differently:
Expand Down Expand Up @@ -1917,8 +1929,10 @@ uint32_t pwrCheck()

#endif // COLORLCD
}

haptic.play(15, 3, PLAY_NOW);
#if defined(HAPTIC)
if (g_eeGeneral.hapticMode != e_mode_quiet)
haptic.play(15, 3, PLAY_NOW);
#endif
pwr_check_state = PWR_CHECK_OFF;
return e_power_off;
}
Expand Down

0 comments on commit 6bc9318

Please sign in to comment.