Issue #1065 - New function putsTime

This commit is contained in:
bsongis
2014-05-09 17:11:30 +02:00
parent 57193fddfe
commit 3c07e0a227
6 changed files with 37 additions and 29 deletions
+5 -9
View File
@@ -318,11 +318,7 @@ void displayTopBar()
/* RTC time */
struct gtm t;
gettime(&t);
if (t.tm_sec % 2) {
lcd_putcAtt(BAR_TIME_X+1, BAR_Y+1, ':', 0);
}
lcd_outdezNAtt(BAR_TIME_X+1, BAR_Y+1, t.tm_hour, LEADING0, 2);
lcd_outdezNAtt(BAR_TIME_X+3*FWNUM-1, BAR_Y+1, t.tm_min, LEADING0, 2);
putsTime(BAR_TIME_X+1, BAR_Y+1, t, true);
/* The background */
lcd_filled_rect(BAR_X, BAR_Y, BAR_W, BAR_H, SOLID, FILL_WHITE|GREY_DEFAULT|ROUND);
@@ -344,7 +340,7 @@ void displayTimers()
// Main timer
if (g_model.timers[0].mode) {
TimerState & timerState = timersStates[0];
putsTime(TIMERS_X, TIMER1_Y, timerState.val, MIDSIZE|LEFT, MIDSIZE|LEFT);
putsTimer(TIMERS_X, TIMER1_Y, timerState.val, MIDSIZE|LEFT, MIDSIZE|LEFT);
putsTimerMode(TIMERS_X, TIMER1_Y-6, g_model.timers[0].mode, SMLSIZE);
if (g_model.timers[0].persistent) lcd_putcAtt(TIMERS_R, TIMER1_Y+1, 'P', SMLSIZE);
if (timerState.val < 0) {
@@ -357,7 +353,7 @@ void displayTimers()
// Second timer
if (g_model.timers[1].mode) {
TimerState & timerState = timersStates[1];
putsTime(TIMERS_X, TIMER2_Y, timerState.val, MIDSIZE|LEFT, MIDSIZE|LEFT);
putsTimer(TIMERS_X, TIMER2_Y, timerState.val, MIDSIZE|LEFT, MIDSIZE|LEFT);
putsTimerMode(TIMERS_X, TIMER2_Y-6, g_model.timers[1].mode, SMLSIZE);
if (g_model.timers[1].persistent) lcd_putcAtt(TIMERS_R, TIMER2_Y+1, 'P', SMLSIZE);
if (timerState.val < 0) {
@@ -374,7 +370,7 @@ void displayTimers()
if (g_model.timers[0].mode) {
TimerState & timerState = timersStates[0];
uint8_t att = DBLSIZE | (timerState.val<0 ? BLINK|INVERS : 0);
putsTime(12*FW+2+10*FWNUM-4, FH*2, timerState.val, att, att);
putsTimer(12*FW+2+10*FWNUM-4, FH*2, timerState.val, att, att);
putsTimerMode(timerState.val >= 0 ? 9*FW-FW/2+3 : 9*FW-FW/2-4, FH*3, g_model.timers[0].mode);
}
}
@@ -840,7 +836,7 @@ void menuMainView(uint8_t event)
}
}
else { // timer2
putsTime(33+FW+2+10*FWNUM-4, FH*5, timersStates[1].val, DBLSIZE, DBLSIZE);
putsTimer(33+FW+2+10*FWNUM-4, FH*5, timersStates[1].val, DBLSIZE, DBLSIZE);
putsTimerMode(timersStates[1].val >= 0 ? 20-FW/2+5 : 20-FW/2-2, FH*6, g_model.timers[1].mode);
// lcd_outdezNAtt(33+11*FW, FH*6, s_timerVal_10ms[1], LEADING0, 2); // 1/100s
}