Merge from 2.3

This commit is contained in:
Bertrand Songis
2019-12-05 09:29:11 +01:00
161 changed files with 3682 additions and 10305 deletions
+2 -39
View File
@@ -177,43 +177,6 @@ void displayTrims(uint8_t phase)
}
}
void drawTimerWithMode(coord_t x, coord_t y, uint8_t index)
{
const TimerData & timer = g_model.timers[index];
if (timer.mode) {
const TimerState & timerState = timersStates[index];
const uint8_t negative = (timerState.val<0 ? BLINK | INVERS : 0);
LcdFlags att = RIGHT | DBLSIZE;
if (timerState.val < 60 * 60) { // display MM:SS
div_t qr = div(abs(timerState.val), 60);
lcdDrawNumber(x - 5, y, qr.rem, att | LEADING0 | negative, 2);
lcdDrawText(lcdLastLeftPos, y, ":", att|BLINK | negative);
lcdDrawNumber(lcdLastLeftPos, y, qr.quot, att | negative);
if (negative)
lcdDrawText(lcdLastLeftPos, y, "-", att | negative);
}
else if (timerState.val < (99 * 60 * 60) + (59 * 60)) { // display HHhMM
div_t qr = div(abs(timerState.val) / 60, 60);
lcdDrawNumber(x - 5, y, qr.rem, att | LEADING0, 2);
lcdDrawText(lcdLastLeftPos, y, "h", att);
lcdDrawNumber(lcdLastLeftPos, y, qr.quot, att);
if (negative)
lcdDrawText(lcdLastLeftPos, y, "-", att);
}
else { //display HHHH for crazy large persistent timers
lcdDrawText(x - 5, y, "h", att);
lcdDrawNumber(lcdLastLeftPos, y, timerState.val / 3600, att);
}
uint8_t xLabel = (negative ? x-56 : x-49);
uint8_t len = zlen(timer.name, LEN_TIMER_NAME);
if (len > 0)
lcdDrawSizedText(xLabel, y+FH, timer.name, len, RIGHT | ZCHAR);
else
lcdDrawTextAtIndex(xLabel, y+FH, STR_VTMRMODES, timer.mode, RIGHT);
}
}
void displayBattVoltage()
{
#if defined(BATTGRAPH)
@@ -459,7 +422,7 @@ void menuMainView(event_t event)
displayVoltageOrAlarm();
// Timer 1
drawTimerWithMode(125, 2*FH, 0);
drawTimerWithMode(125, 2*FH, 0, RIGHT | DBLSIZE);
// Trims sliders
displayTrims(mode);
@@ -597,7 +560,7 @@ void menuMainView(event_t event)
}
else {
// Timer2
drawTimerWithMode(87, 5*FH, 1);
drawTimerWithMode(87, 5*FH, 1, RIGHT | DBLSIZE);
}
// And ! in case of unexpected shutdown