Formatting and lcd contrast masking

master
Scott Lahteine 10 years ago
parent eb6e3886f4
commit 43773ff735

@ -308,7 +308,6 @@ static void lcd_implementation_status_screen() {
#if HAS_FAN #if HAS_FAN
int per = ((fanSpeed + 1) * 100) / 256; int per = ((fanSpeed + 1) * 100) / 256;
if (per) { if (per) {
lcd_print(itostr3(per)); lcd_print(itostr3(per));
lcd_print('%'); lcd_print('%');
} }

@ -968,8 +968,7 @@ static void lcd_control_volumetric_menu() {
static void lcd_set_contrast() { static void lcd_set_contrast() {
if (encoderPosition != 0) { if (encoderPosition != 0) {
lcd_contrast -= encoderPosition; lcd_contrast -= encoderPosition;
if (lcd_contrast < 0) lcd_contrast = 0; lcd_contrast &= 0x3F;
else if (lcd_contrast > 63) lcd_contrast = 63;
encoderPosition = 0; encoderPosition = 0;
lcdDrawUpdate = 1; lcdDrawUpdate = 1;
u8g.setContrast(lcd_contrast); u8g.setContrast(lcd_contrast);
@ -1003,10 +1002,12 @@ static void lcd_control_retract_menu() {
#endif // FWRETRACT #endif // FWRETRACT
#if SDCARDDETECT == -1 #if SDCARDDETECT == -1
static void lcd_sd_refresh() { static void lcd_sd_refresh() {
card.initsd(); card.initsd();
currentMenuViewOffset = 0; currentMenuViewOffset = 0;
} }
#endif #endif
static void lcd_sd_updir() { static void lcd_sd_updir() {
@ -1031,11 +1032,12 @@ void lcd_sdcard_menu() {
for (uint16_t i = 0; i < fileCnt; i++) { for (uint16_t i = 0; i < fileCnt; i++) {
if (_menuItemNr == _lineNr) { if (_menuItemNr == _lineNr) {
#ifndef SDCARD_RATHERRECENTFIRST card.getfilename(
card.getfilename(i); #ifdef SDCARD_RATHERRECENTFIRST
#else fileCnt-1 -
card.getfilename(fileCnt-1-i);
#endif #endif
i
);
if (card.filenameIsDir) if (card.filenameIsDir)
MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename); MENU_ITEM(sddirectory, MSG_CARD_MENU, card.filename, card.longFilename);
else else
@ -1456,7 +1458,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
#ifdef DOGLCD #ifdef DOGLCD
void lcd_setcontrast(uint8_t value) { void lcd_setcontrast(uint8_t value) {
lcd_contrast = value & 63; lcd_contrast = value & 0x3F;
u8g.setContrast(lcd_contrast); u8g.setContrast(lcd_contrast);
} }
#endif #endif

Loading…
Cancel
Save