1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-27 05:48:43 +00:00

Add NO_LCD_MENUS to display only the Status Screen

This commit is contained in:
Scott Lahteine 2018-04-30 17:31:48 -05:00
parent f4a7531ccb
commit 1025066ab1
7 changed files with 107 additions and 98 deletions

View File

@ -367,6 +367,11 @@
#endif
#endif
#if ENABLED(NO_LCD_MENUS)
#undef ULTIPANEL
#undef NEWPANEL
#endif
// Boot screens
#if DISABLED(ULTRA_LCD)
#undef SHOW_BOOTSCREEN
@ -374,7 +379,7 @@
#define BOOTSCREEN_TIMEOUT 2500
#endif
#define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST)
#define HAS_DEBUG_MENU (ENABLED(ULTIPANEL) && ENABLED(LCD_PROGRESS_BAR_TEST))
// MK2 Multiplexer forces SINGLENOZZLE and kills DISABLE_INACTIVE_EXTRUDER
#if ENABLED(MK2_MULTIPLEXER)

View File

@ -1392,6 +1392,15 @@
*/
//#define SD_CHECK_AND_RETRY
/**
* LCD Menu Items
*
* Disable all menus and only display the Status Screen, or
* just remove some extraneous menu items to recover space.
*/
//#define NO_LCD_MENUS
//#define SLIM_LCD_MENUS
//
// ENCODER SETTINGS
//

View File

@ -493,9 +493,6 @@
// Include a page of printer information in the LCD Main Menu
//#define LCD_INFO_MENU
// Leave out seldom-used LCD menu items to recover some Program Memory
//#define SLIM_LCD_MENUS
// Scroll a longer status message into view
//#define STATUS_MESSAGE_SCROLLING

View File

@ -486,8 +486,10 @@
if (g26_bed_temp > 25) {
lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99);
lcd_quick_feedback(true);
#if ENABLED(NEWPANEL)
lcd_external_control = true;
#endif
#endif
thermalManager.setTargetBed(g26_bed_temp);
while (abs(thermalManager.degBed() - g26_bed_temp) > 3) {
@ -732,7 +734,7 @@
move_to(destination, 0.0);
move_to(destination, g26_ooze_amount);
#if ENABLED(ULTRA_LCD)
#if ENABLED(NEWPANEL)
lcd_external_control = true;
#endif
@ -836,7 +838,7 @@
move_to(destination, 0); // Move back to the starting position
//debug_current_and_destination(PSTR("done doing X/Y move."));
#if ENABLED(ULTRA_LCD)
#if ENABLED(NEWPANEL)
lcd_external_control = false; // Give back control of the LCD Panel!
#endif

View File

@ -49,9 +49,6 @@
void _lcd_ubl_output_map_lcd();
#endif
extern float meshedit_done;
extern long babysteps_done;
#define SIZE_OF_LITTLE_RAISE 1
#define BIG_RAISE_NOT_NEEDED 0

View File

@ -61,33 +61,10 @@
#include "fwretract.h"
#endif
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)
bool lcd_external_control; // = false
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
#include "power_loss_recovery.h"
#endif
// Initialized by settings.load()
int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
millis_t previous_lcd_status_ms = 0;
#endif
#if ENABLED(BABYSTEPPING)
long babysteps_done = 0;
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
static void lcd_babystep_zoffset();
#else
static void lcd_babystep_z();
#endif
#endif
uint8_t lcd_status_update_delay = 1, // First update one loop delayed
lcd_status_message_level; // Higher level blocks lower level
#if ENABLED(STATUS_MESSAGE_SCROLLING)
#if LONG_FILENAME_LENGTH > CHARSIZE * 2 * (LCD_WIDTH)
#define MAX_MESSAGE_LENGTH LONG_FILENAME_LENGTH
@ -100,8 +77,14 @@ uint8_t lcd_status_update_delay = 1, // First update one loop delayed
#endif
char lcd_status_message[MAX_MESSAGE_LENGTH + 1];
uint8_t lcd_status_update_delay = 1, // First update one loop delayed
lcd_status_message_level; // Higher level blocks lower level
#if ENABLED(SCROLL_LONG_FILENAMES)
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
millis_t previous_lcd_status_ms = 0;
#endif
#if ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES)
uint8_t filename_scroll_pos, filename_scroll_max, filename_scroll_hash;
#endif
@ -112,11 +95,23 @@ char lcd_status_message[MAX_MESSAGE_LENGTH + 1];
#if ENABLED(DOGLCD)
#include "ultralcd_impl_DOGM.h"
#include <U8glib.h>
bool drawing_screen, // = false
first_page;
#else
#include "ultralcd_impl_HD44780.h"
constexpr bool first_page = true;
#endif
// The main status screen
void lcd_status_screen();
millis_t next_lcd_update_ms;
uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to draw, decrements after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial)
uint16_t max_display_update_time = 0;
#if ENABLED(ULTIPANEL)
#define DEFINE_LCD_IMPLEMENTATION_DRAWMENU_SETTING_EDIT_TYPE(_type, _name, _strFunc) \
inline void lcd_implementation_drawmenu_setting_edit_ ## _name (const bool sel, const uint8_t row, const char* pstr, const char* pstr2, _type * const data, ...) { \
UNUSED(pstr2); \
@ -144,29 +139,6 @@ char lcd_status_message[MAX_MESSAGE_LENGTH + 1];
#define lcd_implementation_drawmenu_setting_edit_bool(sel, row, pstr, pstr2, data) DRAW_BOOL_SETTING(sel, row, pstr, data)
#define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) DRAW_BOOL_SETTING(sel, row, pstr, data)
#define lcd_implementation_drawmenu_setting_edit_accessor_bool(sel, row, pstr, pstr2, pget, pset) DRAW_BOOL_SETTING(sel, row, pstr, data)
#endif // ULTIPANEL
// The main status screen
void lcd_status_screen();
millis_t next_lcd_update_ms;
uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to draw, decrements after every draw. Set to 2 in LCD routines so the LCD gets at least 1 full redraw (first redraw is partial)
uint16_t max_display_update_time = 0;
#if ENABLED(DOGLCD)
bool drawing_screen, // = false
first_page;
#else
constexpr bool first_page = true;
#endif
#if ENABLED(DAC_STEPPER_CURRENT)
#include "stepper_dac.h" //was dac_mcp4728.h MarlinMain uses stepper dac for the m-codes
uint8_t driverPercent[XYZE];
#endif
#if ENABLED(ULTIPANEL)
#ifndef TALL_FONT_CORRECTION
#define TALL_FONT_CORRECTION 0
@ -175,6 +147,27 @@ uint16_t max_display_update_time = 0;
bool no_reentry = false;
constexpr int8_t menu_bottom = LCD_HEIGHT - (TALL_FONT_CORRECTION);
// Initialized by settings.load()
int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)
bool lcd_external_control; // = false
#endif
#if ENABLED(BABYSTEPPING)
long babysteps_done = 0;
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
static void lcd_babystep_zoffset();
#else
static void lcd_babystep_z();
#endif
#endif
#if ENABLED(DAC_STEPPER_CURRENT)
#include "stepper_dac.h" //was dac_mcp4728.h MarlinMain uses stepper dac for the m-codes
uint8_t driverPercent[XYZE];
#endif
////////////////////////////////////////////
///////////////// Menu Tree ////////////////
////////////////////////////////////////////
@ -780,8 +773,6 @@ void kill_screen(const char* lcd_msg) {
lcd_kill_screen();
}
#if ENABLED(ULTIPANEL)
/**
*
* Audio feedback for controller clicks
@ -799,8 +790,13 @@ void kill_screen(const char* lcd_msg) {
void lcd_quick_feedback(const bool clear_buttons) {
lcd_refresh();
#if ENABLED(ULTIPANEL)
if (clear_buttons) buttons = 0;
next_button_update_ms = millis() + 500;
#else
UNUSED(clear_buttons);
#endif
// Buzz and wait. The delay is needed for buttons to settle!
lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
@ -811,6 +807,8 @@ void kill_screen(const char* lcd_msg) {
#endif
}
#if ENABLED(ULTIPANEL)
void lcd_completion_feedback(const bool good/*=true*/) {
if (good) {
lcd_buzz(100, 659);
@ -5251,7 +5249,7 @@ void lcd_update() {
lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
}
#if ENABLED(SCROLL_LONG_FILENAMES)
#if ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES)
// If scrolling of long file names is enabled and we are in the sd card menu,
// cause a refresh to occur until all the text has scrolled into view.
if (currentScreen == lcd_sdcard_menu && filename_scroll_pos < filename_scroll_max && !lcd_status_update_delay--) {

View File

@ -41,20 +41,6 @@
#include "Marlin.h"
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)
extern bool lcd_external_control;
#else
constexpr bool lcd_external_control = false;
#endif
extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
#if ENABLED(LCD_BED_LEVELING)
extern bool lcd_wait_for_move;
#else
constexpr bool lcd_wait_for_move = false;
#endif
int16_t lcd_strlen(const char* s);
int16_t lcd_strlen_P(const char* s);
bool lcd_hasstatus();
@ -74,6 +60,8 @@
void lcd_buzz(const long duration, const uint16_t freq);
#endif
void lcd_quick_feedback(const bool clear_buttons); // Audible feedback for a button click - could also be visual
#if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
void dontExpireStatus();
#endif
@ -107,6 +95,20 @@
typedef void (*screenFunc_t)();
typedef void (*menuAction_t)();
extern int16_t lcd_preheat_hotend_temp[2], lcd_preheat_bed_temp[2], lcd_preheat_fan_speed[2];
#if ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(G26_MESH_VALIDATION)
extern bool lcd_external_control;
#else
constexpr bool lcd_external_control = false;
#endif
#if ENABLED(LCD_BED_LEVELING)
extern bool lcd_wait_for_move;
#else
constexpr bool lcd_wait_for_move = false;
#endif
void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder=0);
// Encoder click is directly connected
@ -130,7 +132,6 @@
extern volatile uint8_t buttons; // The last-checked buttons in a bit array.
void lcd_buttons_update();
void lcd_quick_feedback(const bool clear_buttons); // Audible feedback for a button click - could also be visual
void lcd_completion_feedback(const bool good=true);
#if ENABLED(ADVANCED_PAUSE_FEATURE)