Combine Travis CI option-setting commands (#12474)
This commit is contained in:
@ -40,6 +40,11 @@
|
||||
#include "../../module/planner.h"
|
||||
#include "../../module/motion.h"
|
||||
|
||||
#if DISABLED(LCD_PROGRESS_BAR) && ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
|
||||
#include "../../feature/filwidth.h"
|
||||
#include "../../gcode/parser.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
#include "../../feature/bedlevel/ubl/ubl.h"
|
||||
#endif
|
||||
@ -97,11 +102,11 @@ static void createChar_P(const char c, const byte * const ptr) {
|
||||
#define LCD_STR_PROGRESS "\x03\x04\x05"
|
||||
#endif
|
||||
|
||||
void MarlinUI::set_custom_characters(
|
||||
#if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN)
|
||||
const HD44780CharSet screen_charset/*=CHARSET_INFO*/
|
||||
void MarlinUI::set_custom_characters(const HD44780CharSet screen_charset/*=CHARSET_INFO*/) {
|
||||
#if DISABLED(LCD_PROGRESS_BAR) && DISABLED(SHOW_BOOTSCREEN)
|
||||
UNUSED(screen_charset);
|
||||
#endif
|
||||
) {
|
||||
|
||||
// CHARSET_BOOT
|
||||
#if ENABLED(SHOW_BOOTSCREEN)
|
||||
const static PROGMEM byte corner[4][8] = { {
|
||||
@ -341,7 +346,7 @@ void MarlinUI::init_lcd() {
|
||||
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
|
||||
#endif
|
||||
|
||||
LCD_SET_CHARSET(on_status_screen() ? CHARSET_INFO : CHARSET_MENU);
|
||||
set_custom_characters(on_status_screen() ? CHARSET_INFO : CHARSET_MENU);
|
||||
|
||||
lcd.clear();
|
||||
}
|
||||
@ -398,7 +403,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
|
||||
}
|
||||
|
||||
void MarlinUI::show_bootscreen() {
|
||||
LCD_SET_CHARSET(CHARSET_BOOT);
|
||||
set_custom_characters(CHARSET_BOOT);
|
||||
lcd.clear();
|
||||
|
||||
#define LCD_EXTRA_SPACE (LCD_WIDTH-8)
|
||||
@ -470,7 +475,7 @@ void MarlinUI::clear_lcd() { lcd.clear(); }
|
||||
|
||||
lcd.clear();
|
||||
safe_delay(100);
|
||||
LCD_SET_CHARSET(CHARSET_INFO);
|
||||
set_custom_characters(CHARSET_INFO);
|
||||
lcd.clear();
|
||||
}
|
||||
|
||||
@ -583,7 +588,7 @@ FORCE_INLINE void _draw_bed_status(const bool blink) {
|
||||
|
||||
#if ENABLED(LCD_PROGRESS_BAR)
|
||||
|
||||
inline void lcd_draw_progress_bar(const uint8_t percent) {
|
||||
void MarlinUI::draw_progress_bar(const uint8_t percent) {
|
||||
const int16_t tix = (int16_t)(percent * (LCD_WIDTH) * 3) / 100,
|
||||
cel = tix / 3,
|
||||
rem = tix % 3;
|
||||
@ -612,7 +617,7 @@ void MarlinUI::draw_status_message(const bool blink) {
|
||||
// or if there is no message set.
|
||||
if (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !has_status()) {
|
||||
const uint8_t progress = get_progress();
|
||||
if (progress > 2) return lcd_draw_progress_bar(progress);
|
||||
if (progress > 2) return draw_progress_bar(progress);
|
||||
}
|
||||
|
||||
#elif ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
|
||||
|
@ -37,6 +37,12 @@
|
||||
#include "../../module/motion.h"
|
||||
#include "../../module/temperature.h"
|
||||
|
||||
#if ENABLED(FILAMENT_LCD_DISPLAY)
|
||||
#include "../../feature/filwidth.h"
|
||||
#include "../../module/planner.h"
|
||||
#include "../../gcode/parser.h"
|
||||
#endif
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#include "../../sd/cardreader.h"
|
||||
#endif
|
||||
@ -477,9 +483,7 @@ void MarlinUI::draw_status_screen() {
|
||||
|
||||
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
|
||||
// Alternate Status message and Filament display
|
||||
if (PENDING(millis(), next_filament_display))
|
||||
draw_status_message(blink);
|
||||
else {
|
||||
if (ELAPSED(millis(), next_filament_display)) {
|
||||
lcd_put_u8str_P(PSTR(LCD_STR_FILAM_DIA));
|
||||
lcd_put_wchar(':');
|
||||
lcd_put_u8str(wstring);
|
||||
@ -488,9 +492,9 @@ void MarlinUI::draw_status_screen() {
|
||||
lcd_put_u8str(mstring);
|
||||
lcd_put_wchar('%');
|
||||
}
|
||||
#else
|
||||
draw_status_message(blink);
|
||||
else
|
||||
#endif
|
||||
draw_status_message(blink);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -243,7 +243,7 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) {
|
||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
if (!ubl.lcd_map_control)
|
||||
#endif
|
||||
LCD_SET_CHARSET(screen == status_screen ? CHARSET_INFO : CHARSET_MENU);
|
||||
set_custom_characters(screen == status_screen ? CHARSET_INFO : CHARSET_MENU);
|
||||
#endif
|
||||
|
||||
refresh(LCDVIEW_CALL_REDRAW_NEXT);
|
||||
|
@ -52,11 +52,13 @@ static void lcd_factory_settings() {
|
||||
|
||||
#if ENABLED(LCD_PROGRESS_BAR_TEST)
|
||||
|
||||
#include "../lcdprint.h"
|
||||
|
||||
static void progress_bar_test() {
|
||||
static int8_t bar_percent = 0;
|
||||
if (ui.use_click()) {
|
||||
ui.goto_previous_screen();
|
||||
LCD_SET_CHARSET(CHARSET_MENU);
|
||||
ui.set_custom_characters(CHARSET_MENU);
|
||||
return;
|
||||
}
|
||||
bar_percent += (int8_t)ui.encoderPosition;
|
||||
@ -65,12 +67,12 @@ static void lcd_factory_settings() {
|
||||
draw_menu_item_static(0, PSTR(MSG_PROGRESS_BAR_TEST), true, true);
|
||||
lcd_moveto((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2);
|
||||
lcd_put_u8str(int(bar_percent)); lcd_put_wchar('%');
|
||||
lcd_moveto(0, LCD_HEIGHT - 1); lcd_draw_progress_bar(bar_percent);
|
||||
lcd_moveto(0, LCD_HEIGHT - 1); ui.draw_progress_bar(bar_percent);
|
||||
}
|
||||
|
||||
void _progress_bar_test() {
|
||||
ui.goto_screen(progress_bar_test);
|
||||
LCD_SET_CHARSET(CHARSET_INFO);
|
||||
ui.set_custom_characters(CHARSET_INFO);
|
||||
}
|
||||
|
||||
#endif // LCD_PROGRESS_BAR_TEST
|
||||
|
@ -211,6 +211,12 @@
|
||||
FONT_EDIT,
|
||||
FONT_MENU
|
||||
};
|
||||
#else
|
||||
enum HD44780CharSet : uint8_t {
|
||||
CHARSET_MENU,
|
||||
CHARSET_INFO,
|
||||
CHARSET_BOOT
|
||||
};
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////
|
||||
@ -282,23 +288,15 @@ public:
|
||||
|
||||
static constexpr bool drawing_screen = false, first_page = true;
|
||||
|
||||
enum HD44780CharSet : uint8_t { CHARSET_MENU, CHARSET_INFO, CHARSET_BOOT };
|
||||
|
||||
static void set_custom_characters(
|
||||
#if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN)
|
||||
const HD44780CharSet screen_charset=CHARSET_INFO
|
||||
#endif
|
||||
);
|
||||
static void set_custom_characters(const HD44780CharSet screen_charset=CHARSET_INFO);
|
||||
|
||||
#if ENABLED(LCD_PROGRESS_BAR)
|
||||
static millis_t progress_bar_ms; // Start time for the current progress bar cycle
|
||||
static void draw_progress_bar(const uint8_t percent);
|
||||
#if PROGRESS_MSG_EXPIRE > 0
|
||||
static millis_t MarlinUI::expire_status_ms; // = 0
|
||||
static inline void reset_progress_bar_timeout() { expire_status_ms = 0; }
|
||||
#endif
|
||||
#define LCD_SET_CHARSET(C) set_custom_characters(C)
|
||||
#else
|
||||
#define LCD_SET_CHARSET(C) set_custom_characters()
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user