Turn off sleep mode
This commit is contained in:
@@ -18,12 +18,13 @@
|
|||||||
#ifdef MODEL_MHP30
|
#ifdef MODEL_MHP30
|
||||||
#define ACCEL_MSA
|
#define ACCEL_MSA
|
||||||
#define POW_PD
|
#define POW_PD
|
||||||
//#define POW_QC // Unsure if we have this
|
|
||||||
#define TEMP_NTC
|
#define TEMP_NTC
|
||||||
#define I2C_SOFT
|
#define I2C_SOFT
|
||||||
#define LIS_ORI_FLIP
|
|
||||||
#define BATTFILTERDEPTH 8
|
#define BATTFILTERDEPTH 8
|
||||||
#define OLED_I2CBB
|
#define OLED_I2CBB
|
||||||
|
#define ACCEL_EXITS_ON_MOVEMENT
|
||||||
|
#endif
|
||||||
|
#ifdef ACCEL_EXITS_ON_MOVEMENT
|
||||||
|
#define NO_SLEEP_MODE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* BSP_MINIWARE_MODEL_CONFIG_H_ */
|
#endif /* BSP_MINIWARE_MODEL_CONFIG_H_ */
|
||||||
|
|||||||
@@ -195,14 +195,16 @@ const menuitem UIMenu[] = {
|
|||||||
{0, nullptr, nullptr} // end of menu marker. DO NOT REMOVE
|
{0, nullptr, nullptr} // end of menu marker. DO NOT REMOVE
|
||||||
};
|
};
|
||||||
const menuitem PowerSavingMenu[] = {
|
const menuitem PowerSavingMenu[] = {
|
||||||
/*
|
/*
|
||||||
* Sleep Temp
|
* Sleep Temp
|
||||||
* Sleep Time
|
* Sleep Time
|
||||||
* Shutdown Time
|
* Shutdown Time
|
||||||
* Motion Sensitivity
|
* Motion Sensitivity
|
||||||
*/
|
*/
|
||||||
|
#ifndef NO_SLEEP_MODE
|
||||||
{SETTINGS_DESC(SettingsItemIndex::SleepTemperature), settings_setSleepTemp, settings_displaySleepTemp}, /*Sleep Temp*/
|
{SETTINGS_DESC(SettingsItemIndex::SleepTemperature), settings_setSleepTemp, settings_displaySleepTemp}, /*Sleep Temp*/
|
||||||
{SETTINGS_DESC(SettingsItemIndex::SleepTimeout), settings_setSleepTime, settings_displaySleepTime}, /*Sleep Time*/
|
{SETTINGS_DESC(SettingsItemIndex::SleepTimeout), settings_setSleepTime, settings_displaySleepTime}, /*Sleep Time*/
|
||||||
|
#endif
|
||||||
{SETTINGS_DESC(SettingsItemIndex::ShutdownTimeout), settings_setShutdownTime, settings_displayShutdownTime}, /*Shutdown Time*/
|
{SETTINGS_DESC(SettingsItemIndex::ShutdownTimeout), settings_setShutdownTime, settings_displayShutdownTime}, /*Shutdown Time*/
|
||||||
{SETTINGS_DESC(SettingsItemIndex::MotionSensitivity), settings_setSensitivity, settings_displaySensitivity}, /* Motion Sensitivity*/
|
{SETTINGS_DESC(SettingsItemIndex::MotionSensitivity), settings_setSensitivity, settings_displaySensitivity}, /* Motion Sensitivity*/
|
||||||
#ifdef HALL_SENSOR
|
#ifdef HALL_SENSOR
|
||||||
|
|||||||
@@ -351,9 +351,28 @@ static int gui_SolderingSleepingMode(bool stayOff, bool autoStarted) {
|
|||||||
|
|
||||||
OLED::refresh();
|
OLED::refresh();
|
||||||
GUIDelay();
|
GUIDelay();
|
||||||
|
#ifdef ACCEL_EXITS_ON_MOVEMENT
|
||||||
|
// If the accel works in reverse where movement will cause exiting the soldering mode
|
||||||
|
if (systemSettings.sensitivity) {
|
||||||
|
if (lastMovementTime) {
|
||||||
|
if (lastMovementTime > TICKS_SECOND * 10) {
|
||||||
|
// If we have moved recently; in the last second
|
||||||
|
// Then exit soldering mode
|
||||||
|
|
||||||
|
if (((TickType_t)(xTaskGetTickCount() - lastMovementTime)) < (TickType_t)(TICKS_SECOND)) {
|
||||||
|
currentTempTargetDegC = 0;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
|
||||||
if (!shouldBeSleeping(autoStarted)) {
|
if (!shouldBeSleeping(autoStarted)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
if (shouldShutdown()) {
|
if (shouldShutdown()) {
|
||||||
// shutdown
|
// shutdown
|
||||||
currentTempTargetDegC = 0;
|
currentTempTargetDegC = 0;
|
||||||
@@ -379,6 +398,8 @@ static void display_countdown(int sleepThres) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
static uint32_t getSleepTimeout() {
|
static uint32_t getSleepTimeout() {
|
||||||
|
#ifndef NO_SLEEP_MODE
|
||||||
|
|
||||||
if (systemSettings.sensitivity && systemSettings.SleepTime) {
|
if (systemSettings.sensitivity && systemSettings.SleepTime) {
|
||||||
|
|
||||||
uint32_t sleepThres = 0;
|
uint32_t sleepThres = 0;
|
||||||
@@ -388,9 +409,11 @@ static uint32_t getSleepTimeout() {
|
|||||||
sleepThres = (systemSettings.SleepTime - 5) * 60 * 1000;
|
sleepThres = (systemSettings.SleepTime - 5) * 60 * 1000;
|
||||||
return sleepThres;
|
return sleepThres;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static bool shouldBeSleeping(bool inAutoStart) {
|
static bool shouldBeSleeping(bool inAutoStart) {
|
||||||
|
#ifndef NO_SLEEP_MODE
|
||||||
// Return true if the iron should be in sleep mode
|
// Return true if the iron should be in sleep mode
|
||||||
if (systemSettings.sensitivity && systemSettings.SleepTime) {
|
if (systemSettings.sensitivity && systemSettings.SleepTime) {
|
||||||
if (inAutoStart) {
|
if (inAutoStart) {
|
||||||
@@ -425,6 +448,7 @@ static bool shouldBeSleeping(bool inAutoStart) {
|
|||||||
lastHallEffectSleepStart = 0;
|
lastHallEffectSleepStart = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -523,17 +547,18 @@ static void gui_solderingMode(uint8_t jumpToSleep) {
|
|||||||
OLED::clearScreen();
|
OLED::clearScreen();
|
||||||
// Draw in the screen details
|
// Draw in the screen details
|
||||||
if (systemSettings.detailedSoldering) {
|
if (systemSettings.detailedSoldering) {
|
||||||
OLED::print(translatedString(Tr->SolderingAdvancedPowerPrompt), FontStyle::SMALL); // Power:
|
OLED::print(translatedString(Tr->SolderingAdvancedPowerPrompt),
|
||||||
|
FontStyle::SMALL); // Power:
|
||||||
OLED::printNumber(x10WattHistory.average() / 10, 2, FontStyle::SMALL);
|
OLED::printNumber(x10WattHistory.average() / 10, 2, FontStyle::SMALL);
|
||||||
OLED::print(SymbolDot, FontStyle::SMALL);
|
OLED::print(SymbolDot, FontStyle::SMALL);
|
||||||
OLED::printNumber(x10WattHistory.average() % 10, 1, FontStyle::SMALL);
|
OLED::printNumber(x10WattHistory.average() % 10, 1, FontStyle::SMALL);
|
||||||
OLED::print(SymbolWatts, FontStyle::SMALL);
|
OLED::print(SymbolWatts, FontStyle::SMALL);
|
||||||
|
#ifndef NO_SLEEP_MODE
|
||||||
if (systemSettings.sensitivity && systemSettings.SleepTime) {
|
if (systemSettings.sensitivity && systemSettings.SleepTime) {
|
||||||
OLED::print(SymbolSpace, FontStyle::SMALL);
|
OLED::print(SymbolSpace, FontStyle::SMALL);
|
||||||
display_countdown(getSleepTimeout());
|
display_countdown(getSleepTimeout());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
OLED::setCursor(0, 8);
|
OLED::setCursor(0, 8);
|
||||||
OLED::print(translatedString(Tr->SleepingTipAdvancedString), FontStyle::SMALL);
|
OLED::print(translatedString(Tr->SleepingTipAdvancedString), FontStyle::SMALL);
|
||||||
gui_drawTipTemp(true, FontStyle::SMALL);
|
gui_drawTipTemp(true, FontStyle::SMALL);
|
||||||
|
|||||||
Reference in New Issue
Block a user