Fix up LCD_PROGRESS_BAR

- Some messages should not expire with `PROGRESS_MSG_EXPIRE`.
- Simplify conditional for progress bar with sanity checks.
- Rename `messageTick` to `expireStatusMillis` and make it the expire
time.
This commit is contained in:
Scott Lahteine
2015-03-30 18:00:54 -07:00
parent baa6787393
commit 5519882eea
5 changed files with 59 additions and 40 deletions

View File

@ -193,10 +193,10 @@
#include "utf_mapper.h"
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
#ifdef LCD_PROGRESS_BAR
static uint16_t progressBarTick = 0;
#if PROGRESS_MSG_EXPIRE > 0
static uint16_t messageTick = 0;
static uint16_t expireStatusMillis = 0;
#endif
#define LCD_STR_PROGRESS "\x03\x04\x05"
#endif
@ -214,7 +214,7 @@
#define LCD_STR_ARROW_RIGHT ">" /* from the default character set */
static void lcd_set_custom_characters(
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
#ifdef LCD_PROGRESS_BAR
bool progress_bar_set=true
#endif
) {
@ -299,7 +299,7 @@ static void lcd_set_custom_characters(
B00000
}; //thanks Sonny Mounicou
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
#ifdef LCD_PROGRESS_BAR
static bool char_mode = false;
byte progress[3][8] = { {
B00000,
@ -360,7 +360,7 @@ static void lcd_set_custom_characters(
}
static void lcd_implementation_init(
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
#ifdef LCD_PROGRESS_BAR
bool progress_bar_set=true
#endif
) {
@ -390,7 +390,7 @@ static void lcd_implementation_init(
#endif
lcd_set_custom_characters(
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
#ifdef LCD_PROGRESS_BAR
progress_bar_set
#endif
);
@ -583,7 +583,7 @@ static void lcd_implementation_status_screen()
// Status message line at the bottom
lcd.setCursor(0, LCD_HEIGHT - 1);
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
#ifdef LCD_PROGRESS_BAR
if (card.isFileOpen()) {
uint16_t mil = millis(), diff = mil - progressBarTick;