Enable SWD back, Add Off mode for Sleep
This commit is contained in:
@@ -228,15 +228,11 @@ static int userConfirmation(const char* message) {
|
||||
int16_t lastOffset = -1;
|
||||
bool lcdRefresh = true;
|
||||
|
||||
|
||||
for (;;) {
|
||||
|
||||
int16_t messageOffset =
|
||||
((xTaskGetTickCount() - messageStart)
|
||||
/ (systemSettings.descriptionScrollSpeed == 1 ?
|
||||
1 : 2));
|
||||
messageOffset %= messageWidth; //Roll around at the end
|
||||
|
||||
int16_t messageOffset = ((xTaskGetTickCount() - messageStart)
|
||||
/ (systemSettings.descriptionScrollSpeed == 1 ? 1 : 2));
|
||||
messageOffset %= messageWidth; //Roll around at the end
|
||||
|
||||
if (lastOffset != messageOffset) {
|
||||
lcd.clearScreen();
|
||||
@@ -302,15 +298,18 @@ static void settings_displaySleepTemp(void) {
|
||||
static void settings_setSleepTime(void) {
|
||||
systemSettings.SleepTime++; // Go up 1 minute at a time
|
||||
if (systemSettings.SleepTime >= 16) {
|
||||
systemSettings.SleepTime = 1; // can't set time over 10 mins
|
||||
systemSettings.SleepTime = 0; // can't set time over 10 mins
|
||||
}
|
||||
// Remember that ^ is the time of no movement
|
||||
if (PCBVersion == 3)
|
||||
systemSettings.SleepTime = 0; //Disable sleep on no accel
|
||||
}
|
||||
|
||||
static void settings_displaySleepTime(void) {
|
||||
printShortDescription(2, 5);
|
||||
|
||||
if (systemSettings.SleepTime < 6) {
|
||||
if (systemSettings.SleepTime == 0) {
|
||||
lcd.print(OffString);
|
||||
} else if (systemSettings.SleepTime < 6) {
|
||||
lcd.printNumber(systemSettings.SleepTime * 10, 2);
|
||||
lcd.drawChar('S');
|
||||
} else {
|
||||
@@ -324,11 +323,18 @@ static void settings_setShutdownTime(void) {
|
||||
if (systemSettings.ShutdownTime > 60) {
|
||||
systemSettings.ShutdownTime = 0; // wrap to off
|
||||
}
|
||||
if (PCBVersion == 3)
|
||||
systemSettings.ShutdownTime = 0; //Disable shutdown on no accel
|
||||
}
|
||||
|
||||
static void settings_displayShutdownTime(void) {
|
||||
printShortDescription(3, 6);
|
||||
lcd.printNumber(systemSettings.ShutdownTime, 2);
|
||||
printShortDescription(3, 5);
|
||||
if (systemSettings.ShutdownTime == 0) {
|
||||
lcd.print(OffString);
|
||||
} else {
|
||||
lcd.printNumber(systemSettings.ShutdownTime, 2);
|
||||
lcd.drawChar('M');
|
||||
}
|
||||
}
|
||||
|
||||
static void settings_setTempF(void) {
|
||||
@@ -388,18 +394,18 @@ static void settings_setDisplayRotation(void) {
|
||||
systemSettings.OrientationMode++;
|
||||
systemSettings.OrientationMode = systemSettings.OrientationMode % 3;
|
||||
switch (systemSettings.OrientationMode) {
|
||||
case 0:
|
||||
lcd.setRotation(false);
|
||||
break;
|
||||
case 1:
|
||||
lcd.setRotation(true);
|
||||
break;
|
||||
case 2:
|
||||
//do nothing on auto
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
lcd.setRotation(false);
|
||||
break;
|
||||
case 1:
|
||||
lcd.setRotation(true);
|
||||
break;
|
||||
case 2:
|
||||
//do nothing on auto
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void settings_displayDisplayRotation(void) {
|
||||
@@ -719,7 +725,8 @@ void gui_Menu(const menuitem* menu) {
|
||||
|
||||
if ((PRESS_ACCEL_INTERVAL_MAX - autoRepeatAcceleration)
|
||||
< PRESS_ACCEL_INTERVAL_MIN) {
|
||||
autoRepeatAcceleration = PRESS_ACCEL_INTERVAL_MAX - PRESS_ACCEL_INTERVAL_MIN;
|
||||
autoRepeatAcceleration = PRESS_ACCEL_INTERVAL_MAX
|
||||
- PRESS_ACCEL_INTERVAL_MIN;
|
||||
}
|
||||
|
||||
if (lcdRefresh) {
|
||||
|
||||
Reference in New Issue
Block a user