Followup to Menu Refactor (#12275)

This commit is contained in:
Scott Lahteine 2018-10-30 16:34:45 -05:00 committed by GitHub
parent 5536228359
commit 3583e2b449
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 244 additions and 273 deletions

View File

@ -60,7 +60,7 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
#include <U8glib.h> #include <U8glib.h>
@ -156,6 +156,6 @@ uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_va
return 1; return 1;
} }
#endif // DOGLCD #endif // HAS_GRAPHICAL_LCD
#endif //__SAM3X8E__ #endif //__SAM3X8E__

View File

@ -57,7 +57,7 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
#include <U8glib.h> #include <U8glib.h>
#include <Arduino.h> #include <Arduino.h>
@ -180,6 +180,6 @@ uint8_t u8g_com_HAL_DUE_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_va
return 1; return 1;
} }
#endif // DOGLCD #endif // HAS_GRAPHICAL_LCD
#endif // ARDUINO_ARCH_SAM #endif // ARDUINO_ARCH_SAM

View File

@ -25,7 +25,7 @@
#include "src/core/macros.h" #include "src/core/macros.h"
#if ENABLED(SDSUPPORT) && ENABLED(DOGLCD) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN) #if ENABLED(SDSUPPORT) && HAS_GRAPHICAL_LCD && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
#define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently #define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode requred for communicating with each device being different. // needed due to the speed and mode requred for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use // This requirement can be removed if the SPI access to these devices is updated to use

View File

@ -57,7 +57,7 @@
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
//#include <inttypes.h> //#include <inttypes.h>
#include <U8glib.h> #include <U8glib.h>
@ -132,6 +132,6 @@ uint8_t u8g_com_HAL_LPC1768_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val,
return 1; return 1;
} }
#endif // DOGLCD #endif // HAS_GRAPHICAL_LCD
#endif // TARGET_LPC1768 #endif // TARGET_LPC1768

View File

@ -79,7 +79,7 @@
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
#include <U8glib.h> #include <U8glib.h>
@ -198,6 +198,6 @@ uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_v
return 1; return 1;
} }
#endif // DOGLCD #endif // HAS_GRAPHICAL_LCD
#endif // TARGET_LPC1768 #endif // TARGET_LPC1768

View File

@ -63,7 +63,7 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
#include <U8glib.h> #include <U8glib.h>
@ -249,6 +249,6 @@ uint8_t u8g_com_HAL_LPC1768_ssd_sw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_v
return 1; return 1;
} }
#endif // DOGLCD #endif // HAS_GRAPHICAL_LCD
#endif // TARGET_LPC1768 #endif // TARGET_LPC1768

View File

@ -57,7 +57,7 @@
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
//#include <inttypes.h> //#include <inttypes.h>
#include <U8glib.h> #include <U8glib.h>
@ -148,6 +148,6 @@ uint8_t u8g_com_HAL_LPC1768_ST7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t ar
return 1; return 1;
} }
#endif // DOGLCD #endif // HAS_GRAPHICAL_LCD
#endif // TARGET_LPC1768 #endif // TARGET_LPC1768

View File

@ -57,7 +57,7 @@
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
#include <U8glib.h> #include <U8glib.h>
#include "SoftwareSPI.h" #include "SoftwareSPI.h"
@ -151,6 +151,6 @@ uint8_t u8g_com_HAL_LPC1768_ST7920_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t ar
return 1; return 1;
} }
#endif // DOGLCD #endif // HAS_GRAPHICAL_LCD
#endif // TARGET_LPC1768 #endif // TARGET_LPC1768

View File

@ -57,7 +57,7 @@
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
#include <U8glib.h> #include <U8glib.h>
#include "SoftwareSPI.h" #include "SoftwareSPI.h"
@ -125,6 +125,6 @@ uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val,
return 1; return 1;
} }
#endif // DOGLCD #endif // HAS_GRAPHICAL_LCD
#endif // TARGET_LPC1768 #endif // TARGET_LPC1768

View File

@ -21,7 +21,6 @@
* *
*/ */
#ifdef STM32F7 #ifdef STM32F7
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------

View File

@ -379,7 +379,7 @@ void manage_inactivity(const bool ignore_stepper_queue/*=false*/) {
#if ENABLED(DISABLE_INACTIVE_E) #if ENABLED(DISABLE_INACTIVE_E)
disable_e_steppers(); disable_e_steppers();
#endif #endif
#if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL) // Only needed with an LCD #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL)
if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false; if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false;
#endif #endif
} }

View File

@ -143,7 +143,7 @@
constexpr float unified_bed_leveling::_mesh_index_to_xpos[16], constexpr float unified_bed_leveling::_mesh_index_to_xpos[16],
unified_bed_leveling::_mesh_index_to_ypos[16]; unified_bed_leveling::_mesh_index_to_ypos[16];
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
bool unified_bed_leveling::lcd_map_control = false; bool unified_bed_leveling::lcd_map_control = false;
#endif #endif

View File

@ -157,7 +157,7 @@ class unified_bed_leveling {
MESH_MIN_Y + 14 * (MESH_Y_DIST), MESH_MIN_Y + 15 * (MESH_Y_DIST) MESH_MIN_Y + 14 * (MESH_Y_DIST), MESH_MIN_Y + 15 * (MESH_Y_DIST)
}; };
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
static bool lcd_map_control; static bool lcd_map_control;
#endif #endif

View File

@ -628,7 +628,7 @@
LEAVE: LEAVE:
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_reset_alert_level(); lcd_reset_alert_level();
lcd_quick_feedback(true); lcd_quick_feedback(true);
lcd_reset_status(); lcd_reset_status();

View File

@ -45,7 +45,7 @@
#include "../feature/runout.h" #include "../feature/runout.h"
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
#include "../lcd/ultralcd.h" #include "../lcd/ultralcd.h"
#endif #endif
@ -102,7 +102,7 @@ static bool ensure_safe_temperature(const AdvancedPauseMode mode=ADVANCED_PAUSE_
} }
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT, mode); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT, mode);
#else #else
UNUSED(mode); UNUSED(mode);
@ -139,7 +139,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
#endif #endif
if (!ensure_safe_temperature(mode)) { if (!ensure_safe_temperature(mode)) {
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (show_lcd) // Show status screen if (show_lcd) // Show status screen
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
#endif #endif
@ -148,7 +148,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
} }
if (pause_for_user) { if (pause_for_user) {
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (show_lcd) // Show "insert filament" if (show_lcd) // Show "insert filament"
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT, mode); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT, mode);
#endif #endif
@ -172,7 +172,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
KEEPALIVE_STATE(IN_HANDLER); KEEPALIVE_STATE(IN_HANDLER);
} }
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (show_lcd) // Show "wait for load" message if (show_lcd) // Show "wait for load" message
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, mode); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, mode);
#endif #endif
@ -209,7 +209,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
#if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE) #if ENABLED(ADVANCED_PAUSE_CONTINUOUS_PURGE)
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (show_lcd) if (show_lcd)
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CONTINUOUS_PURGE);
#endif #endif
@ -224,7 +224,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
do { do {
if (purge_length > 0) { if (purge_length > 0) {
// "Wait for filament purge" // "Wait for filament purge"
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (show_lcd) if (show_lcd)
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_PURGE, mode); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_PURGE, mode);
#endif #endif
@ -234,7 +234,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
} }
// Show "Purge More" / "Resume" menu and wait for reply // Show "Purge More" / "Resume" menu and wait for reply
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (show_lcd) { if (show_lcd) {
KEEPALIVE_STATE(PAUSED_FOR_USER); KEEPALIVE_STATE(PAUSED_FOR_USER);
wait_for_user = false; wait_for_user = false;
@ -246,7 +246,7 @@ bool load_filament(const float &slow_load_length/*=0*/, const float &fast_load_l
// Keep looping if "Purge More" was selected // Keep looping if "Purge More" was selected
} while ( } while (
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
show_lcd && advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE show_lcd && advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE
#else #else
0 0
@ -272,7 +272,7 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/ const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/
) { ) {
if (!ensure_safe_temperature(mode)) { if (!ensure_safe_temperature(mode)) {
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (show_lcd) // Show status screen if (show_lcd) // Show status screen
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
#endif #endif
@ -342,7 +342,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE); SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE);
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (show_lcd) // Show initial message if (show_lcd) // Show initial message
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT);
#endif #endif
@ -351,7 +351,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
SERIAL_ERROR_START(); SERIAL_ERROR_START();
SERIAL_ERRORLNPGM(MSG_ERR_HOTEND_TOO_COLD); SERIAL_ERRORLNPGM(MSG_ERR_HOTEND_TOO_COLD);
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (show_lcd) { // Show status screen if (show_lcd) { // Show status screen
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
LCD_MESSAGEPGM(MSG_M600_TOO_COLD); LCD_MESSAGEPGM(MSG_M600_TOO_COLD);
@ -416,7 +416,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
void wait_for_filament_reload(const int8_t max_beep_count/*=0*/ DXC_ARGS) { void wait_for_filament_reload(const int8_t max_beep_count/*=0*/ DXC_ARGS) {
bool nozzle_timed_out = false; bool nozzle_timed_out = false;
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT);
#endif #endif
SERIAL_ECHO_START(); SERIAL_ECHO_START();
@ -454,11 +454,11 @@ void wait_for_filament_reload(const int8_t max_beep_count/*=0*/ DXC_ARGS) {
nozzle_timed_out |= thermalManager.is_heater_idle(e); nozzle_timed_out |= thermalManager.is_heater_idle(e);
if (nozzle_timed_out) { if (nozzle_timed_out) {
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
#endif #endif
SERIAL_ECHO_START(); SERIAL_ECHO_START();
#if ENABLED(ULTIPANEL) && ENABLED(EMERGENCY_PARSER) #if HAS_LCD_MENU && ENABLED(EMERGENCY_PARSER)
SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_HEAT); SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_HEAT);
#elif ENABLED(EMERGENCY_PARSER) #elif ENABLED(EMERGENCY_PARSER)
SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_HEAT_M108); SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_HEAT_M108);
@ -475,11 +475,11 @@ void wait_for_filament_reload(const int8_t max_beep_count/*=0*/ DXC_ARGS) {
// Wait for the heaters to reach the target temperatures // Wait for the heaters to reach the target temperatures
ensure_safe_temperature(); ensure_safe_temperature();
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INSERT);
#endif #endif
SERIAL_ECHO_START(); SERIAL_ECHO_START();
#if ENABLED(ULTIPANEL) && ENABLED(EMERGENCY_PARSER) #if HAS_LCD_MENU && ENABLED(EMERGENCY_PARSER)
SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT); SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT);
#elif ENABLED(EMERGENCY_PARSER) #elif ENABLED(EMERGENCY_PARSER)
SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT_M108); SERIAL_ECHOLNPGM(MSG_FILAMENT_CHANGE_INSERT_M108);
@ -550,7 +550,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) // Load the new filament if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) // Load the new filament
load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out, ADVANCED_PAUSE_MODE_PAUSE_PRINT DXC_PASS); load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out, ADVANCED_PAUSE_MODE_PAUSE_PRINT DXC_PASS);
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_RESUME); // "Wait for print to resume" lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_RESUME); // "Wait for print to resume"
#endif #endif
@ -578,7 +578,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
runout.reset(); runout.reset();
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
// Show status screen // Show status screen
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
#endif #endif

View File

@ -156,7 +156,7 @@ int16_t g26_bed_temp,
int8_t g26_prime_flag; int8_t g26_prime_flag;
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
/** /**
* If the LCD is clicked, cancel, wait for release, return true * If the LCD is clicked, cancel, wait for release, return true
@ -164,7 +164,7 @@ int8_t g26_prime_flag;
bool user_canceled() { bool user_canceled() {
if (!is_lcd_clicked()) return false; // Return if the button isn't pressed if (!is_lcd_clicked()) return false; // Return if the button isn't pressed
lcd_setstatusPGM(PSTR("Mesh Validation Stopped."), 99); lcd_setstatusPGM(PSTR("Mesh Validation Stopped."), 99);
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_quick_feedback(true); lcd_quick_feedback(true);
#endif #endif
wait_for_release(); wait_for_release();
@ -327,7 +327,7 @@ inline bool look_for_lines_to_connect() {
for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) { for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) { for (uint8_t j = 0; j < GRID_MAX_POINTS_Y; j++) {
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (user_canceled()) return true; // Check if the user wants to stop the Mesh Validation if (user_canceled()) return true; // Check if the user wants to stop the Mesh Validation
#endif #endif
@ -418,14 +418,14 @@ inline bool turn_on_heaters() {
if (g26_bed_temp > 25) { if (g26_bed_temp > 25) {
lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99); lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99);
lcd_quick_feedback(true); lcd_quick_feedback(true);
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_external_control = true; lcd_external_control = true;
#endif #endif
#endif #endif
thermalManager.setTargetBed(g26_bed_temp); thermalManager.setTargetBed(g26_bed_temp);
while (ABS(thermalManager.degBed() - g26_bed_temp) > 3) { while (ABS(thermalManager.degBed() - g26_bed_temp) > 3) {
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (is_lcd_clicked()) return exit_from_g26(); if (is_lcd_clicked()) return exit_from_g26();
#endif #endif
@ -448,7 +448,7 @@ inline bool turn_on_heaters() {
thermalManager.setTargetHotend(g26_hotend_temp, 0); thermalManager.setTargetHotend(g26_hotend_temp, 0);
while (ABS(thermalManager.degHotend(0) - g26_hotend_temp) > 3) { while (ABS(thermalManager.degHotend(0) - g26_hotend_temp) > 3) {
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (is_lcd_clicked()) return exit_from_g26(); if (is_lcd_clicked()) return exit_from_g26();
#endif #endif
@ -474,7 +474,7 @@ inline bool turn_on_heaters() {
*/ */
inline bool prime_nozzle() { inline bool prime_nozzle() {
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
#if ENABLED(PREVENT_LENGTHY_EXTRUDE) #if ENABLED(PREVENT_LENGTHY_EXTRUDE)
float Total_Prime = 0.0; float Total_Prime = 0.0;
#endif #endif
@ -619,7 +619,7 @@ void GcodeSuite::G26() {
if (parser.seen('P')) { if (parser.seen('P')) {
if (!parser.has_value()) { if (!parser.has_value()) {
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
g26_prime_flag = -1; g26_prime_flag = -1;
#else #else
SERIAL_PROTOCOLLNPGM("?Prime length must be specified when not using an LCD."); SERIAL_PROTOCOLLNPGM("?Prime length must be specified when not using an LCD.");
@ -664,7 +664,7 @@ void GcodeSuite::G26() {
} }
int16_t g26_repeats; int16_t g26_repeats;
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
g26_repeats = parser.intval('R', GRID_MAX_POINTS + 1); g26_repeats = parser.intval('R', GRID_MAX_POINTS + 1);
#else #else
if (!parser.seen('R')) { if (!parser.seen('R')) {
@ -723,7 +723,7 @@ void GcodeSuite::G26() {
move_to(destination, 0.0); move_to(destination, 0.0);
move_to(destination, g26_ooze_amount); move_to(destination, g26_ooze_amount);
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_external_control = true; lcd_external_control = true;
#endif #endif
@ -831,7 +831,7 @@ void GcodeSuite::G26() {
plan_arc(endpoint, arc_offset, false); // Draw a counter-clockwise arc plan_arc(endpoint, arc_offset, false); // Draw a counter-clockwise arc
feedrate_mm_s = save_feedrate; feedrate_mm_s = save_feedrate;
set_destination_from_current(); set_destination_from_current();
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation
#endif #endif
@ -857,7 +857,7 @@ void GcodeSuite::G26() {
for (int8_t ind = start_ind; ind <= end_ind; ind++) { for (int8_t ind = start_ind; ind <= end_ind; ind++) {
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation if (user_canceled()) goto LEAVE; // Check if the user wants to stop the Mesh Validation
#endif #endif
@ -906,7 +906,7 @@ void GcodeSuite::G26() {
move_to(destination, 0); // Move back to the starting position move_to(destination, 0); // Move back to the starting position
//debug_current_and_destination(PSTR("done doing X/Y move.")); //debug_current_and_destination(PSTR("done doing X/Y move."));
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_external_control = false; // Give back control of the LCD Panel! lcd_external_control = false; // Give back control of the LCD Panel!
#endif #endif

View File

@ -204,7 +204,7 @@ static float calibration_probe(const float &nx, const float &ny, const bool stow
#endif #endif
} }
#if HAS_BED_PROBE && ENABLED(ULTIPANEL) #if HAS_BED_PROBE && HAS_LCD_MENU
static float probe_z_shift(const float center) { static float probe_z_shift(const float center) {
STOW_PROBE(); STOW_PROBE();
endstops.enable_z_probe(false); endstops.enable_z_probe(false);
@ -588,7 +588,7 @@ void GcodeSuite::G33() {
switch (probe_points) { switch (probe_points) {
case -1: case -1:
#if HAS_BED_PROBE && ENABLED(ULTIPANEL) #if HAS_BED_PROBE && HAS_LCD_MENU
zprobe_zoffset += probe_z_shift(z_at_pt[CEN]); zprobe_zoffset += probe_z_shift(z_at_pt[CEN]);
#endif #endif

View File

@ -60,7 +60,7 @@ void GcodeSuite::M18_M84() {
#endif #endif
} }
#if ENABLED(AUTO_BED_LEVELING_UBL) && ENABLED(ULTIPANEL) // Only needed with an LCD #if HAS_LCD_MENU && ENABLED(AUTO_BED_LEVELING_UBL)
if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false; if (ubl.lcd_map_control) ubl.lcd_map_control = defer_return_to_status = false;
#endif #endif
} }

View File

@ -27,7 +27,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
#include "../../lcd/ultralcd.h" #include "../../lcd/ultralcd.h"
#endif #endif
@ -82,7 +82,7 @@
restore_stepper_drivers(); restore_stepper_drivers();
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_reset_status(); lcd_reset_status();
#endif #endif
} }
@ -115,7 +115,7 @@ void GcodeSuite::M81() {
PSU_OFF(); PSU_OFF();
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF "."); LCD_MESSAGEPGM(MACHINE_NAME " " MSG_OFF ".");
#endif #endif
} }

View File

@ -33,7 +33,7 @@
#include "../../../module/tool_change.h" #include "../../../module/tool_change.h"
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
#include "../../../lcd/ultralcd.h" #include "../../../lcd/ultralcd.h"
#endif #endif
@ -70,7 +70,7 @@ void GcodeSuite::M600() {
#endif #endif
// Show initial "wait for start" message // Show initial "wait for start" message
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT, ADVANCED_PAUSE_MODE_PAUSE_PRINT, target_extruder); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT, ADVANCED_PAUSE_MODE_PAUSE_PRINT, target_extruder);
#endif #endif

View File

@ -34,7 +34,7 @@
#include "../../../module/tool_change.h" #include "../../../module/tool_change.h"
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
#include "../../../lcd/ultralcd.h" #include "../../../lcd/ultralcd.h"
#endif #endif
@ -61,7 +61,7 @@ void GcodeSuite::M701() {
if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
// Show initial "wait for load" message // Show initial "wait for load" message
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, ADVANCED_PAUSE_MODE_LOAD_FILAMENT, target_extruder); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, ADVANCED_PAUSE_MODE_LOAD_FILAMENT, target_extruder);
#endif #endif
@ -98,7 +98,7 @@ void GcodeSuite::M701() {
#endif #endif
// Show status screen // Show status screen
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
#endif #endif
} }
@ -127,7 +127,7 @@ void GcodeSuite::M702() {
if (parser.seenval('Z')) park_point.z = parser.linearval('Z'); if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
// Show initial "wait for unload" message // Show initial "wait for unload" message
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, target_extruder); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, target_extruder);
#endif #endif
@ -171,7 +171,7 @@ void GcodeSuite::M702() {
#endif #endif
// Show status screen // Show status screen
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS); lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
#endif #endif
} }

View File

@ -427,7 +427,7 @@ void GcodeSuite::process_parsed_command(
case 120: M120(); break; // M120: Enable endstops case 120: M120(); break; // M120: Enable endstops
case 121: M121(); break; // M121: Disable endstops case 121: M121(); break; // M121: Disable endstops
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
case 145: M145(); break; // M145: Set material heatup parameters case 145: M145(); break; // M145: Set material heatup parameters
#endif #endif

View File

@ -571,7 +571,7 @@ private:
static void M190(); static void M190();
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
static void M145(); static void M145();
#endif #endif

View File

@ -27,7 +27,7 @@
#include "../gcode.h" #include "../gcode.h"
#include "../../module/stepper.h" #include "../../module/stepper.h"
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
#include "../../lcd/ultralcd.h" #include "../../lcd/ultralcd.h"
#endif #endif
@ -59,7 +59,7 @@ void GcodeSuite::M0_M1() {
planner.synchronize(); planner.synchronize();
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (has_message) if (has_message)
lcd_setstatus(args, true); lcd_setstatus(args, true);
@ -93,7 +93,7 @@ void GcodeSuite::M0_M1() {
printerEventLEDs.onResumeAfterWait(); printerEventLEDs.onResumeAfterWait();
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_reset_status(); lcd_reset_status();
#endif #endif

View File

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
#include "../gcode.h" #include "../gcode.h"
#include "../../lcd/ultralcd.h" #include "../../lcd/ultralcd.h"
@ -60,4 +60,4 @@ void GcodeSuite::M145() {
} }
} }
#endif // ULTIPANEL #endif // HAS_LCD_MENU

View File

@ -273,7 +273,7 @@ public:
static inline void set_input_temp_units(TempUnit units) { input_temp_units = units; } static inline void set_input_temp_units(TempUnit units) { input_temp_units = units; }
#if ENABLED(ULTIPANEL) && DISABLED(DISABLE_M503) #if HAS_LCD_MENU && DISABLED(DISABLE_M503)
FORCE_INLINE static char temp_units_code() { FORCE_INLINE static char temp_units_code() {
return input_temp_units == TEMPUNIT_K ? 'K' : input_temp_units == TEMPUNIT_F ? 'F' : 'C'; return input_temp_units == TEMPUNIT_K ? 'K' : input_temp_units == TEMPUNIT_F ? 'F' : 'C';
@ -293,7 +293,7 @@ public:
} }
} }
#endif // ULTIPANEL && !DISABLE_M503 #endif // HAS_LCD_MENU && !DISABLE_M503
static inline float value_celsius() { static inline float value_celsius() {
const float f = value_float(); const float f = value_float();

View File

@ -387,7 +387,7 @@ inline void get_serial_commands() {
// Process critical commands early // Process critical commands early
if (strcmp(command, "M108") == 0) { if (strcmp(command, "M108") == 0) {
wait_for_heatup = false; wait_for_heatup = false;
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
wait_for_user = false; wait_for_user = false;
#endif #endif
} }

View File

@ -97,7 +97,7 @@ void enqueue_and_echo_commands_P(PGM_P const pgcode);
*/ */
bool enqueue_and_echo_command(const char* cmd); bool enqueue_and_echo_command(const char* cmd);
#define HAS_LCD_QUEUE_NOW (ENABLED(MALYAN_LCD) || (ENABLED(ULTIPANEL) && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE)))) #define HAS_LCD_QUEUE_NOW (ENABLED(MALYAN_LCD) || (HAS_LCD_MENU && (ENABLED(AUTO_BED_LEVELING_UBL) || ENABLED(PID_AUTOTUNE_MENU) || ENABLED(ADVANCED_PAUSE_FEATURE))))
#define HAS_QUEUE_NOW (ENABLED(SDSUPPORT) || HAS_LCD_QUEUE_NOW) #define HAS_QUEUE_NOW (ENABLED(SDSUPPORT) || HAS_LCD_QUEUE_NOW)
#if HAS_QUEUE_NOW #if HAS_QUEUE_NOW

View File

@ -239,7 +239,7 @@
/** /**
* Override here because this is set in Configuration_adv.h * Override here because this is set in Configuration_adv.h
*/ */
#if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER) #if HAS_LCD_MENU && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)
#undef SD_DETECT_INVERTED #undef SD_DETECT_INVERTED
#endif #endif

View File

@ -866,7 +866,7 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE && Y_MAX_LENGTH >= Y_BED_SIZE,
#error "You probably want to use Max Endstops for DELTA!" #error "You probably want to use Max Endstops for DELTA!"
#elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED #elif ENABLED(ENABLE_LEVELING_FADE_HEIGHT) && DISABLED(AUTO_BED_LEVELING_BILINEAR) && !UBL_SEGMENTED
#error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL." #error "ENABLE_LEVELING_FADE_HEIGHT on DELTA requires AUTO_BED_LEVELING_BILINEAR or AUTO_BED_LEVELING_UBL."
#elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || ENABLED(ULTIPANEL)) #elif ENABLED(DELTA_AUTO_CALIBRATION) && !(HAS_BED_PROBE || HAS_LCD_MENU)
#error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller." #error "DELTA_AUTO_CALIBRATION requires a probe or LCD Controller."
#elif ABL_GRID #elif ABL_GRID
#if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0 #if (GRID_MAX_POINTS_X & 1) == 0 || (GRID_MAX_POINTS_Y & 1) == 0

View File

@ -14,16 +14,15 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if ENABLED(ULTRA_LCD) && DISABLED(DOGLCD) #if HAS_CHARACTER_LCD
#include "../ultralcd.h" #include "../ultralcd.h"
#include "../../Marlin.h" #include "../../Marlin.h"
#include <string.h>
#include "../fontutils.h"
#include "../lcdprint.h"
#include "ultralcd_common_HD44780.h" #include "ultralcd_common_HD44780.h"
#include <string.h>
#ifndef LCD_CLASS #ifndef LCD_CLASS
#include <LiquidCrystal.h> #include <LiquidCrystal.h>
#define LCD_CLASS LiquidCrystal #define LCD_CLASS LiquidCrystal
@ -1039,4 +1038,4 @@ int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) {
return lcd_put_u8str_max_cb(utf8_str_P, read_byte_rom, max_length); return lcd_put_u8str_max_cb(utf8_str_P, read_byte_rom, max_length);
} }
#endif // ULTRA_LCD && !DOGLCD #endif // HAS_CHARACTER_LCD

View File

@ -32,24 +32,6 @@
#include "../../libs/duration_t.h" #include "../../libs/duration_t.h"
#endif #endif
#if ENABLED(AUTO_BED_LEVELING_UBL)
#include "../../feature/bedlevel/ubl/ubl.h"
#if ENABLED(ULTIPANEL)
#define ULTRA_X_PIXELS_PER_CHAR 5
#define ULTRA_Y_PIXELS_PER_CHAR 8
#define ULTRA_COLUMNS_FOR_MESH_MAP 7
#define ULTRA_ROWS_FOR_MESH_MAP 4
#define N_USER_CHARS 8
#define TOP_LEFT _BV(0)
#define TOP_RIGHT _BV(1)
#define LOWER_LEFT _BV(2)
#define LOWER_RIGHT _BV(3)
#endif
#endif
//////////////////////////////////// ////////////////////////////////////
// Setup button and encode mappings for each panel (into 'buttons' variable // Setup button and encode mappings for each panel (into 'buttons' variable
// //
@ -57,7 +39,7 @@
// macro name. The mapping is independent of whether the button is directly connected or // macro name. The mapping is independent of whether the button is directly connected or
// via a shift/i2c register. // via a shift/i2c register.
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
extern volatile uint8_t buttons; extern volatile uint8_t buttons;
@ -119,7 +101,21 @@
#define LCD_CLICKED (buttons & (B_MI|B_ST)) #define LCD_CLICKED (buttons & (B_MI|B_ST))
#endif #endif
#endif // ULTIPANEL #if ENABLED(AUTO_BED_LEVELING_UBL)
#define ULTRA_X_PIXELS_PER_CHAR 5
#define ULTRA_Y_PIXELS_PER_CHAR 8
#define ULTRA_COLUMNS_FOR_MESH_MAP 7
#define ULTRA_ROWS_FOR_MESH_MAP 4
#define N_USER_CHARS 8
#define TOP_LEFT _BV(0)
#define TOP_RIGHT _BV(1)
#define LOWER_LEFT _BV(2)
#define LOWER_RIGHT _BV(3)
#endif
#endif // HAS_LCD_MENU
//////////////////////////////////// ////////////////////////////////////
// Create LCD class instance and chipset-specific information // Create LCD class instance and chipset-specific information
@ -141,12 +137,11 @@
#elif ENABLED(LCD_I2C_TYPE_MCP23017) #elif ENABLED(LCD_I2C_TYPE_MCP23017)
// For the LED indicators (which may be mapped to different events in lcd_implementation_update_indicators()) // For the LED indicators (which may be mapped to different events in lcd_implementation_update_indicators())
#define LCD_HAS_STATUS_INDICATORS
#define LED_A 0x04 //100 #define LED_A 0x04 //100
#define LED_B 0x02 //010 #define LED_B 0x02 //010
#define LED_C 0x01 //001 #define LED_C 0x01 //001
#define LCD_HAS_STATUS_INDICATORS
#include <Wire.h> #include <Wire.h>
#include <LiquidTWI2.h> #include <LiquidTWI2.h>
#define LCD_CLASS LiquidTWI2 #define LCD_CLASS LiquidTWI2
@ -160,9 +155,9 @@
#include <LiquidCrystal_I2C.h> #include <LiquidCrystal_I2C.h>
#define LCD_CLASS LiquidCrystal_I2C #define LCD_CLASS LiquidCrystal_I2C
// 2 wire Non-latching LCD SR from:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
#elif ENABLED(SR_LCD_2W_NL) #elif ENABLED(SR_LCD_2W_NL)
// 2 wire Non-latching LCD SR from:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
extern "C" void __cxa_pure_virtual() { while (1); } extern "C" void __cxa_pure_virtual() { while (1); }
#include <LCD.h> #include <LCD.h>
#include <LiquidCrystal_SR.h> #include <LiquidCrystal_SR.h>
@ -178,12 +173,7 @@
// Standard directly connected LCD implementations // Standard directly connected LCD implementations
#include <LiquidCrystal.h> #include <LiquidCrystal.h>
#define LCD_CLASS LiquidCrystal #define LCD_CLASS LiquidCrystal
#endif #endif
#include "../fontutils.h" #include "../fontutils.h"
#include "../lcdprint.h" #include "../lcdprint.h"
#if ENABLED(LCD_PROGRESS_BAR)
#define LCD_STR_PROGRESS "\x03\x04\x05"
#endif

View File

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if ENABLED(ULTRA_LCD) && DISABLED(DOGLCD) #if HAS_CHARACTER_LCD
/** /**
* ultralcd_impl_HD44780.cpp * ultralcd_impl_HD44780.cpp
@ -40,6 +40,10 @@
#include "../../module/planner.h" #include "../../module/planner.h"
#include "../../module/motion.h" #include "../../module/motion.h"
#if ENABLED(AUTO_BED_LEVELING_UBL)
#include "../../feature/bedlevel/ubl/ubl.h"
#endif
//////////////////////////////////// ////////////////////////////////////
// Create LCD class instance and chipset-specific information // Create LCD class instance and chipset-specific information
#if ENABLED(LCD_I2C_TYPE_PCF8575) #if ENABLED(LCD_I2C_TYPE_PCF8575)
@ -79,16 +83,6 @@
LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5, LCD_PINS_D6, LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7 LCD_CLASS lcd(LCD_PINS_RS, LCD_PINS_ENABLE, LCD_PINS_D4, LCD_PINS_D5, LCD_PINS_D6, LCD_PINS_D7); //RS,Enable,D4,D5,D6,D7
#endif #endif
#include "../fontutils.h"
#include "../lcdprint.h"
#if ENABLED(LCD_PROGRESS_BAR)
static millis_t progress_bar_ms = 0; // Start millis of the current progress bar cycle
#if PROGRESS_MSG_EXPIRE > 0
static millis_t expire_status_ms = 0; // millis at which to expire the status message
#endif
#endif
#if ENABLED(LCD_HAS_STATUS_INDICATORS) #if ENABLED(LCD_HAS_STATUS_INDICATORS)
static void lcd_implementation_update_indicators(); static void lcd_implementation_update_indicators();
#endif #endif
@ -100,9 +94,13 @@ static void createChar_P(const char c, const byte * const ptr) {
lcd.createChar(c, temp); lcd.createChar(c, temp);
} }
#if ENABLED(LCD_PROGRESS_BAR)
#define LCD_STR_PROGRESS "\x03\x04\x05"
#endif
void lcd_set_custom_characters( void lcd_set_custom_characters(
#if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN) #if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN)
const uint8_t screen_charset=CHARSET_INFO const HD44780CharSet screen_charset/*=CHARSET_INFO*/
#endif #endif
) { ) {
// CHARSET_BOOT // CHARSET_BOOT
@ -318,11 +316,7 @@ void lcd_set_custom_characters(
} }
void lcd_implementation_init( void lcd_implementation_init() {
#if ENABLED(LCD_PROGRESS_BAR)
const uint8_t screen_charset=CHARSET_INFO
#endif
) {
#if ENABLED(LCD_I2C_TYPE_PCF8575) #if ENABLED(LCD_I2C_TYPE_PCF8575)
lcd.begin(LCD_WIDTH, LCD_HEIGHT); lcd.begin(LCD_WIDTH, LCD_HEIGHT);
@ -348,11 +342,7 @@ void lcd_implementation_init(
lcd.begin(LCD_WIDTH, LCD_HEIGHT); lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#endif #endif
lcd_set_custom_characters( LCD_SET_CHARSET(currentScreen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU);
#if ENABLED(LCD_PROGRESS_BAR)
screen_charset
#endif
);
lcd.clear(); lcd.clear();
} }
@ -416,7 +406,7 @@ void lcd_implementation_clear() { lcd.clear(); }
} }
void lcd_bootscreen() { void lcd_bootscreen() {
lcd_set_custom_characters(CHARSET_BOOT); LCD_SET_CHARSET(CHARSET_BOOT);
lcd.clear(); lcd.clear();
#define LCD_EXTRA_SPACE (LCD_WIDTH-8) #define LCD_EXTRA_SPACE (LCD_WIDTH-8)
@ -485,7 +475,7 @@ void lcd_implementation_clear() { lcd.clear(); }
lcd.clear(); lcd.clear();
safe_delay(100); safe_delay(100);
lcd_set_custom_characters(); LCD_SET_CHARSET(CHARSET_INFO);
lcd.clear(); lcd.clear();
} }
@ -975,7 +965,7 @@ FORCE_INLINE void _draw_status_message(const bool blink) {
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
#if ENABLED(ADVANCED_PAUSE_FEATURE) #if ENABLED(ADVANCED_PAUSE_FEATURE)
@ -1581,6 +1571,6 @@ FORCE_INLINE void _draw_status_message(const bool blink) {
#endif // AUTO_BED_LEVELING_UBL #endif // AUTO_BED_LEVELING_UBL
#endif // ULTIPANEL #endif // HAS_LCD_MENU
#endif // ULTRA_LCD && !DOGLCD #endif // HAS_CHARACTER_LCD

View File

@ -9,7 +9,7 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
#include <U8glib.h> #include <U8glib.h>
extern U8GLIB *pu8g; extern U8GLIB *pu8g;
@ -62,4 +62,4 @@ int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) {
return ret; return ret;
} }
#endif // DOGLCD #endif // HAS_GRAPHICAL_LCD

View File

@ -67,7 +67,7 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
#include <U8glib.h> #include <U8glib.h>
#include "HAL_LCD_com_defines.h" #include "HAL_LCD_com_defines.h"
@ -281,4 +281,4 @@ uint8_t u8g_WriteEscSeqP_2_wire(u8g_t *u8g, u8g_dev_t *dev, const uint8_t *esc_s
return 1; return 1;
} }
#endif // DOGLCD #endif // HAS_GRAPHICAL_LCD

View File

@ -55,7 +55,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
#include <U8glib.h> #include <U8glib.h>
@ -233,4 +233,4 @@ u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_sw_spi = { u8g_dev_st7565_64128n_HAL_2x_f
U8G_PB_DEV(u8g_dev_st7565_64128n_HAL_hw_spi, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_st7565_64128n_HAL_fn, U8G_COM_HAL_HW_SPI_FN); U8G_PB_DEV(u8g_dev_st7565_64128n_HAL_hw_spi, WIDTH, HEIGHT, PAGE_HEIGHT, u8g_dev_st7565_64128n_HAL_fn, U8G_COM_HAL_HW_SPI_FN);
u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_hw_spi = { u8g_dev_st7565_64128n_HAL_2x_fn, &u8g_dev_st7565_64128n_HAL_2x_pb, U8G_COM_HAL_HW_SPI_FN }; u8g_dev_t u8g_dev_st7565_64128n_HAL_2x_hw_spi = { u8g_dev_st7565_64128n_HAL_2x_fn, &u8g_dev_st7565_64128n_HAL_2x_pb, U8G_COM_HAL_HW_SPI_FN };
#endif // DOGLCD #endif // HAS_GRAPHICAL_LCD

View File

@ -55,7 +55,7 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
#include <U8glib.h> #include <U8glib.h>
@ -209,4 +209,4 @@ u8g_dev_t u8g_dev_st7920_128x64_HAL_4x_hw_spi = { u8g_dev_st7920_128x64_HAL_4x_f
u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = { u8g_dev_st7920_128x64_HAL_4x_fn, &u8g_dev_st7920_128x64_HAL_4x_pb, U8G_COM_ST7920_HAL_SW_SPI }; u8g_dev_t u8g_dev_st7920_128x64_rrd_sw_spi = { u8g_dev_st7920_128x64_HAL_4x_fn, &u8g_dev_st7920_128x64_HAL_4x_pb, U8G_COM_ST7920_HAL_SW_SPI };
#endif #endif
#endif // DOGLCD #endif // HAS_GRAPHICAL_LCD

View File

@ -59,7 +59,7 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
#include <U8glib.h> #include <U8glib.h>
@ -114,19 +114,18 @@ uint8_t u8g_dev_uc1701_mini12864_HAL_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg,
u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS); u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS);
u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_init_seq); u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_init_seq);
break; break;
case U8G_DEV_MSG_STOP:
break; case U8G_DEV_MSG_STOP: break;
case U8G_DEV_MSG_PAGE_NEXT:
{ case U8G_DEV_MSG_PAGE_NEXT: {
u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem); u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start); u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start);
u8g_WriteByte(u8g, dev, 0x0B0 | pb->p.page); /* select current page */ u8g_WriteByte(u8g, dev, 0x0B0 | pb->p.page); /* select current page */
u8g_SetAddress(u8g, dev, 1); /* data mode */ u8g_SetAddress(u8g, dev, 1); /* data mode */
if ( u8g_pb_WriteBuffer(pb, u8g, dev) == 0 ) if (!u8g_pb_WriteBuffer(pb, u8g, dev)) return 0;
return 0; u8g_SetChipSelect(u8g, dev, 0);
u8g_SetChipSelect(u8g, dev, 0); } break;
}
break;
case U8G_DEV_MSG_CONTRAST: case U8G_DEV_MSG_CONTRAST:
u8g_SetChipSelect(u8g, dev, 1); u8g_SetChipSelect(u8g, dev, 1);
u8g_SetAddress(u8g, dev, 0); /* instruction mode */ u8g_SetAddress(u8g, dev, 0); /* instruction mode */
@ -144,25 +143,25 @@ uint8_t u8g_dev_uc1701_mini12864_HAL_2x_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t m
u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS); u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS);
u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_init_seq); u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_init_seq);
break; break;
case U8G_DEV_MSG_STOP:
break;
case U8G_DEV_MSG_PAGE_NEXT:
{
u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start); case U8G_DEV_MSG_STOP: break;
u8g_WriteByte(u8g, dev, 0x0B0 | (2*pb->p.page)); /* select current page */
u8g_SetAddress(u8g, dev, 1); /* data mode */ case U8G_DEV_MSG_PAGE_NEXT: {
u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)pb->buf); u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
u8g_SetChipSelect(u8g, dev, 0);
u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start);
u8g_WriteByte(u8g, dev, 0x0B0 | (2*pb->p.page)); /* select current page */
u8g_SetAddress(u8g, dev, 1); /* data mode */
u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)pb->buf);
u8g_SetChipSelect(u8g, dev, 0);
u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start);
u8g_WriteByte(u8g, dev, 0x0B0 | (2*pb->p.page+1)); /* select current page */
u8g_SetAddress(u8g, dev, 1); /* data mode */
u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)(pb->buf)+pb->width);
u8g_SetChipSelect(u8g, dev, 0);
} break;
u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start);
u8g_WriteByte(u8g, dev, 0x0B0 | (2*pb->p.page+1)); /* select current page */
u8g_SetAddress(u8g, dev, 1); /* data mode */
u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)(pb->buf)+pb->width);
u8g_SetChipSelect(u8g, dev, 0);
}
break;
case U8G_DEV_MSG_CONTRAST: case U8G_DEV_MSG_CONTRAST:
u8g_SetChipSelect(u8g, dev, 1); u8g_SetChipSelect(u8g, dev, 1);
u8g_SetAddress(u8g, dev, 0); /* instruction mode */ u8g_SetAddress(u8g, dev, 0); /* instruction mode */
@ -182,4 +181,4 @@ u8g_pb_t u8g_dev_uc1701_mini12864_HAL_2x_pb = { {16, HEIGHT, 0, 0, 0}, WIDTH, u
u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_sw_spi = { u8g_dev_uc1701_mini12864_HAL_2x_fn, &u8g_dev_uc1701_mini12864_HAL_2x_pb, U8G_COM_HAL_SW_SPI_FN }; u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_sw_spi = { u8g_dev_uc1701_mini12864_HAL_2x_fn, &u8g_dev_uc1701_mini12864_HAL_2x_pb, U8G_COM_HAL_SW_SPI_FN };
u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_hw_spi = { u8g_dev_uc1701_mini12864_HAL_2x_fn, &u8g_dev_uc1701_mini12864_HAL_2x_pb, U8G_COM_HAL_HW_SPI_FN }; u8g_dev_t u8g_dev_uc1701_mini12864_HAL_2x_hw_spi = { u8g_dev_uc1701_mini12864_HAL_2x_fn, &u8g_dev_uc1701_mini12864_HAL_2x_pb, U8G_COM_HAL_HW_SPI_FN };
#endif // DOGLCD #endif // HAS_GRAPHICAL_LCD

View File

@ -9,7 +9,7 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
#include <string.h> #include <string.h>
#include "../fontutils.h" #include "../fontutils.h"
@ -317,4 +317,4 @@ int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P utf8_msg) {
return data.adv; return data.adv;
} }
#endif // DOGLCD #endif // HAS_GRAPHICAL_LCD

View File

@ -245,7 +245,7 @@ void lcd_kill_screen() {
void lcd_implementation_clear() { } // Automatically cleared by Picture Loop void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
uint8_t row_y1, row_y2; uint8_t row_y1, row_y2;
@ -655,6 +655,6 @@ void lcd_implementation_clear() { } // Automatically cleared by Picture Loop
#endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY #endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
#endif // ULTIPANEL #endif // HAS_LCD_MENU
#endif // HAS_GRAPHICAL_LCD #endif // HAS_GRAPHICAL_LCD

View File

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
#include "menu.h" #include "menu.h"
#include "../ultralcd.h" #include "../ultralcd.h"
@ -75,8 +75,6 @@ bool no_reentry = false;
//////// Menu Navigation & History ///////// //////// Menu Navigation & History /////////
//////////////////////////////////////////// ////////////////////////////////////////////
void lcd_status_screen();
void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); } void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); }
void lcd_save_previous_screen() { void lcd_save_previous_screen() {
@ -203,14 +201,6 @@ void menu_action_setting_edit_callback_bool(PGM_P pstr, bool* ptr, screenFunc_t
bool printer_busy() { return planner.movesplanned() || IS_SD_PRINTING(); } bool printer_busy() { return planner.movesplanned() || IS_SD_PRINTING(); }
#if HAS_CHARACTER_LCD && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(LCD_PROGRESS_BAR_TEST) || ENABLED(AUTO_BED_LEVELING_UBL))
void lcd_set_custom_characters(
#if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN)
const uint8_t screen_charset=CHARSET_INFO
#endif
);
#endif
/** /**
* General function to go directly to a screen * General function to go directly to a screen
*/ */
@ -258,19 +248,17 @@ void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder/*=0*/) {
#endif #endif
screen_history_depth = 0; screen_history_depth = 0;
} }
lcd_implementation_clear(); lcd_implementation_clear();
// Re-initialize custom characters that may be re-used // Re-initialize custom characters that may be re-used
#if HAS_CHARACTER_LCD && ENABLED(AUTO_BED_LEVELING_UBL) #if HAS_CHARACTER_LCD
if (!ubl.lcd_map_control) { #if ENABLED(AUTO_BED_LEVELING_UBL)
lcd_set_custom_characters( if (!ubl.lcd_map_control)
#if ENABLED(LCD_PROGRESS_BAR) #endif
screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU LCD_SET_CHARSET(screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU);
#endif
);
}
#elif ENABLED(LCD_PROGRESS_BAR)
lcd_set_custom_characters(screen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU);
#endif #endif
lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
screen_changed = true; screen_changed = true;
#if HAS_GRAPHICAL_LCD #if HAS_GRAPHICAL_LCD
@ -476,4 +464,4 @@ void _lcd_draw_homing() {
void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(!planner.leveling_active); } void _lcd_toggle_bed_leveling() { set_bed_leveling_enabled(!planner.leveling_active); }
#endif #endif
#endif // ULTIPANEL #endif // HAS_LCD_MENU

View File

@ -54,7 +54,7 @@ static void lcd_factory_settings() {
static int8_t bar_percent = 0; static int8_t bar_percent = 0;
if (use_click()) { if (use_click()) {
lcd_goto_previous_menu(); lcd_goto_previous_menu();
lcd_set_custom_characters(CHARSET_MENU); LCD_SET_CHARSET(CHARSET_MENU);
return; return;
} }
bar_percent += (int8_t)encoderPosition; bar_percent += (int8_t)encoderPosition;
@ -68,7 +68,7 @@ static void lcd_factory_settings() {
void _progress_bar_test() { void _progress_bar_test() {
lcd_goto_screen(progress_bar_test); lcd_goto_screen(progress_bar_test);
lcd_set_custom_characters(); LCD_SET_CHARSET(CHARSET_INFO);
} }
#endif // LCD_PROGRESS_BAR_TEST #endif // LCD_PROGRESS_BAR_TEST

View File

@ -49,7 +49,7 @@
#if ENABLED(POWER_LOSS_RECOVERY) #if ENABLED(POWER_LOSS_RECOVERY)
#include "../feature/power_loss_recovery.h" #include "../feature/power_loss_recovery.h"
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
void menu_job_recovery(); void menu_job_recovery();
#endif #endif
#endif #endif
@ -100,7 +100,7 @@ uint8_t lcd_status_update_delay = 1, // First update one loop delayed
millis_t previous_lcd_status_ms = 0; millis_t previous_lcd_status_ms = 0;
#endif #endif
#if ENABLED(SDSUPPORT) && ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES) #if HAS_LCD_MENU && ENABLED(SDSUPPORT) && ENABLED(SCROLL_LONG_FILENAMES)
uint8_t filename_scroll_pos, filename_scroll_max; uint8_t filename_scroll_pos, filename_scroll_max;
#endif #endif
@ -122,8 +122,6 @@ millis_t next_button_update_ms;
int8_t encoderDirection = 1; int8_t encoderDirection = 1;
#endif #endif
void lcd_status_screen();
#if HAS_LCD_MENU #if HAS_LCD_MENU
#include "menu/menu.h" #include "menu/menu.h"
@ -202,7 +200,7 @@ void lcd_init() {
lcd_buttons_update(); lcd_buttons_update();
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
encoderDiff = 0; encoderDiff = 0;
#endif #endif
} }
@ -363,6 +361,14 @@ bool lcd_blink() {
* This is very display-dependent, so the lcd implementation draws this. * This is very display-dependent, so the lcd implementation draws this.
*/ */
#if ENABLED(LCD_PROGRESS_BAR)
millis_t progress_bar_ms = 0; // Start millis of the current progress bar cycle
#if PROGRESS_MSG_EXPIRE > 0
static millis_t expire_status_ms = 0;
void dontExpireStatus() { expire_status_ms = 0; }
#endif
#endif
#if LCD_INFO_SCREEN_STYLE == 0 #if LCD_INFO_SCREEN_STYLE == 0
void lcd_impl_status_screen_0(); void lcd_impl_status_screen_0();
#elif LCD_INFO_SCREEN_STYLE == 1 #elif LCD_INFO_SCREEN_STYLE == 1
@ -371,12 +377,12 @@ bool lcd_blink() {
void lcd_status_screen() { void lcd_status_screen() {
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
ENCODER_DIRECTION_NORMAL(); ENCODER_DIRECTION_NORMAL();
ENCODER_RATE_MULTIPLY(false); ENCODER_RATE_MULTIPLY(false);
#endif #endif
#if ENABLED(LCD_SET_PROGRESS_MANUALLY) && ENABLED(SDSUPPORT) && (ENABLED(LCD_PROGRESS_BAR) || ENABLED(DOGLCD)) #if ENABLED(LCD_SET_PROGRESS_MANUALLY) && ENABLED(SDSUPPORT) && (ENABLED(LCD_PROGRESS_BAR) || HAS_GRAPHICAL_LCD)
// Progress bar % comes from SD when actively printing // Progress bar % comes from SD when actively printing
if (IS_SD_PRINTING()) if (IS_SD_PRINTING())
progress_bar_percent = card.percentDone(); progress_bar_percent = card.percentDone();
@ -425,18 +431,14 @@ void lcd_status_screen() {
#endif // LCD_PROGRESS_BAR #endif // LCD_PROGRESS_BAR
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
if (use_click()) { if (use_click()) {
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
previous_lcd_status_ms = millis(); // get status message to show up for a while previous_lcd_status_ms = millis(); // get status message to show up for a while
#endif #endif
lcd_implementation_init( // to maybe revive the LCD if static electricity killed it.
#if ENABLED(LCD_PROGRESS_BAR)
CHARSET_MENU
#endif
);
lcd_goto_screen(menu_main); lcd_goto_screen(menu_main);
lcd_implementation_init(); // May revive the LCD if static electricity killed it
return; return;
} }
@ -465,7 +467,7 @@ void lcd_status_screen() {
feedrate_percentage = constrain(feedrate_percentage, 10, 999); feedrate_percentage = constrain(feedrate_percentage, 10, 999);
#endif // ULTIPANEL #endif // HAS_LCD_MENU
#if LCD_INFO_SCREEN_STYLE == 0 #if LCD_INFO_SCREEN_STYLE == 0
lcd_impl_status_screen_0(); lcd_impl_status_screen_0();
@ -514,7 +516,7 @@ void kill_screen(PGM_P lcd_msg) {
void lcd_quick_feedback(const bool clear_buttons) { void lcd_quick_feedback(const bool clear_buttons) {
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_refresh(); lcd_refresh();
if (clear_buttons) buttons = 0; if (clear_buttons) buttons = 0;
next_button_update_ms = millis() + 500; next_button_update_ms = millis() + 500;
@ -525,7 +527,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
// Buzz and wait. The delay is needed for buttons to settle! // Buzz and wait. The delay is needed for buttons to settle!
lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ); lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
#if ENABLED(LCD_USE_I2C_BUZZER) #if ENABLED(LCD_USE_I2C_BUZZER)
delay(10); delay(10);
#elif PIN_EXISTS(BEEPER) #elif PIN_EXISTS(BEEPER)
@ -534,7 +536,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
#endif #endif
} }
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
extern bool no_reentry; // Flag to prevent recursion into menu handlers extern bool no_reentry; // Flag to prevent recursion into menu handlers
@ -602,7 +604,7 @@ void lcd_quick_feedback(const bool clear_buttons) {
} }
} }
#endif // ULTIPANEL #endif // HAS_LCD_MENU
/** /**
* Update the LCD, read encoder buttons, etc. * Update the LCD, read encoder buttons, etc.
@ -652,7 +654,7 @@ void lcd_update() {
static uint16_t max_display_update_time = 0; static uint16_t max_display_update_time = 0;
static millis_t next_lcd_update_ms; static millis_t next_lcd_update_ms;
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
static millis_t return_to_status_ms = 0; static millis_t return_to_status_ms = 0;
// Handle any queued Move Axis motion // Handle any queued Move Axis motion
@ -688,7 +690,7 @@ void lcd_update() {
} }
#endif #endif
#endif // ULTIPANEL #endif // HAS_LCD_MENU
#if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT) #if ENABLED(SDSUPPORT) && PIN_EXISTS(SD_DETECT)
@ -712,11 +714,7 @@ void lcd_update() {
} }
lcd_refresh(); lcd_refresh();
lcd_implementation_init( // to maybe revive the LCD if static electricity killed it. lcd_implementation_init(); // May revive the LCD if static electricity killed it
#if ENABLED(LCD_PROGRESS_BAR)
currentScreen == lcd_status_screen ? CHARSET_INFO : CHARSET_MENU
#endif
);
} }
#endif // SDSUPPORT && SD_DETECT_PIN #endif // SDSUPPORT && SD_DETECT_PIN
@ -730,7 +728,7 @@ void lcd_update() {
const millis_t ms = millis(); const millis_t ms = millis();
if (ELAPSED(ms, next_lcd_update_ms) if (ELAPSED(ms, next_lcd_update_ms)
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
|| drawing_screen || drawing_screen
#endif #endif
) { ) {
@ -741,7 +739,7 @@ void lcd_update() {
lcd_implementation_update_indicators(); lcd_implementation_update_indicators();
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
#if ENABLED(LCD_HAS_SLOW_BUTTONS) #if ENABLED(LCD_HAS_SLOW_BUTTONS)
slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context slow_buttons = lcd_implementation_read_slow_buttons(); // buttons which take too long to read in interrupt context
@ -797,18 +795,18 @@ void lcd_update() {
lcdDrawUpdate = LCDVIEW_REDRAW_NOW; lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
} }
#endif // ULTIPANEL #endif // HAS_LCD_MENU
// This runs every ~100ms when idling often enough. // This runs every ~100ms when idling often enough.
// Instead of tracking changes just redraw the Status Screen once per second. // Instead of tracking changes just redraw the Status Screen once per second.
if ( if (
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
currentScreen == lcd_status_screen && currentScreen == lcd_status_screen &&
#endif #endif
!lcd_status_update_delay-- !lcd_status_update_delay--
) { ) {
lcd_status_update_delay = 9 lcd_status_update_delay = 9
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
+ 3 + 3
#endif #endif
; ;
@ -816,7 +814,7 @@ void lcd_update() {
lcdDrawUpdate = LCDVIEW_REDRAW_NOW; lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
} }
#if ENABLED(ULTIPANEL) && ENABLED(SCROLL_LONG_FILENAMES) #if HAS_LCD_MENU && ENABLED(SCROLL_LONG_FILENAMES)
// If scrolling of long file names is enabled and we are in the sd card menu, // 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. // cause a refresh to occur until all the text has scrolled into view.
if (currentScreen == menu_sdcard && filename_scroll_pos < filename_scroll_max && !lcd_status_update_delay--) { if (currentScreen == menu_sdcard && filename_scroll_pos < filename_scroll_max && !lcd_status_update_delay--) {
@ -830,7 +828,7 @@ void lcd_update() {
// then we want to use 1/2 of the time only. // then we want to use 1/2 of the time only.
uint16_t bbr2 = planner.block_buffer_runtime() >> 1; uint16_t bbr2 = planner.block_buffer_runtime() >> 1;
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
const bool &is_drawing = drawing_screen; const bool &is_drawing = drawing_screen;
#else #else
constexpr bool is_drawing = false; constexpr bool is_drawing = false;
@ -855,15 +853,15 @@ void lcd_update() {
buttons_reprapworld_keypad = 0; buttons_reprapworld_keypad = 0;
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
#define CURRENTSCREEN() (*currentScreen)() #define CURRENTSCREEN() (*currentScreen)()
#else #else
#define CURRENTSCREEN() lcd_status_screen() #define CURRENTSCREEN() lcd_status_screen()
#endif #endif
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
#if ENABLED(LIGHTWEIGHT_UI) #if ENABLED(LIGHTWEIGHT_UI)
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
const bool in_status = currentScreen == lcd_status_screen; const bool in_status = currentScreen == lcd_status_screen;
#else #else
constexpr bool in_status = true; constexpr bool in_status = true;
@ -896,7 +894,7 @@ void lcd_update() {
CURRENTSCREEN(); CURRENTSCREEN();
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_clicked = false; lcd_clicked = false;
#endif #endif
@ -905,7 +903,7 @@ void lcd_update() {
NOLESS(max_display_update_time, millis() - ms); NOLESS(max_display_update_time, millis() - ms);
} }
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
// Return to Status Screen after a timeout // Return to Status Screen after a timeout
if (currentScreen == lcd_status_screen || defer_return_to_status) if (currentScreen == lcd_status_screen || defer_return_to_status)
@ -913,7 +911,7 @@ void lcd_update() {
else if (ELAPSED(ms, return_to_status_ms)) else if (ELAPSED(ms, return_to_status_ms))
lcd_return_to_status(); lcd_return_to_status();
#endif // ULTIPANEL #endif // HAS_LCD_MENU
// Change state of drawing flag between screen updates // Change state of drawing flag between screen updates
if (!is_drawing) switch (lcdDrawUpdate) { if (!is_drawing) switch (lcdDrawUpdate) {
@ -942,6 +940,7 @@ void lcd_finishstatus(const bool persist=false) {
expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE; expire_status_ms = persist ? 0 : progress_bar_ms + PROGRESS_MSG_EXPIRE;
#endif #endif
#endif #endif
lcd_refresh(); lcd_refresh();
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
@ -953,10 +952,6 @@ void lcd_finishstatus(const bool persist=false) {
#endif #endif
} }
#if ENABLED(LCD_PROGRESS_BAR) && PROGRESS_MSG_EXPIRE > 0
void dontExpireStatus() { expire_status_ms = 0; }
#endif
bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); } bool lcd_hasstatus() { return (lcd_status_message[0] != '\0'); }
void lcd_setstatus(const char * const message, const bool persist) { void lcd_setstatus(const char * const message, const bool persist) {
@ -1023,7 +1018,7 @@ void lcd_status_printf_P(const uint8_t level, PGM_P const fmt, ...) {
void lcd_setalertstatusPGM(PGM_P const message) { void lcd_setalertstatusPGM(PGM_P const message) {
lcd_setstatusPGM(message, 1); lcd_setstatusPGM(message, 1);
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_return_to_status(); lcd_return_to_status();
#endif #endif
} }
@ -1068,7 +1063,7 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
} }
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
/** /**
* Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement) * Setup Rotary Encoder Bit Values (for two pin encoders to indicate movement)
@ -1252,6 +1247,6 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
} }
} }
#endif // ULTIPANEL #endif // HAS_LCD_MENU
#endif // ULTRA_LCD #endif // ULTRA_LCD

View File

@ -89,7 +89,7 @@
#elif ENABLED(U8GLIB_SSD1306) #elif ENABLED(U8GLIB_SSD1306)
// Generic support for SSD1306 OLED I2C LCDs // Generic support for SSD1306 OLED I2C LCDs
//#define U8G_CLASS U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE //#define U8G_CLASS U8GLIB_SSD1306_128X64_2X_I2C_2_WIRE
//#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes //#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes
#define U8G_CLASS U8GLIB_SSD1306_128X64_2X #define U8G_CLASS U8GLIB_SSD1306_128X64_2X
#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes
@ -102,7 +102,7 @@
//#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes //#define U8G_PARAM DOGLCD_SCK, DOGLCD_MOSI, DOGLCD_CS, DOGLCD_A0 // 4 stripes
#elif ENABLED(U8GLIB_SH1106) #elif ENABLED(U8GLIB_SH1106)
// Generic support for SH1106 OLED I2C LCDs // Generic support for SH1106 OLED I2C LCDs
//#define U8G_CLASS U8GLIB_SH1106_128X64_2X_I2C_2_WIRE //#define U8G_CLASS U8GLIB_SH1106_128X64_2X_I2C_2_WIRE
//#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes //#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes
#define U8G_CLASS U8GLIB_SH1106_128X64_2X #define U8G_CLASS U8GLIB_SH1106_128X64_2X
#define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes #define U8G_PARAM (U8G_I2C_OPT_NONE | U8G_I2C_OPT_FAST) // 4 stripes
@ -199,6 +199,7 @@
#include "../module/motion.h" // for active_extruder #include "../module/motion.h" // for active_extruder
#endif #endif
void lcd_status_screen();
void lcd_return_to_status(); void lcd_return_to_status();
bool lcd_hasstatus(); bool lcd_hasstatus();
void lcd_setstatus(const char* message, const bool persist=false); void lcd_setstatus(const char* message, const bool persist=false);
@ -229,8 +230,11 @@
void lcd_quick_feedback(const bool clear_buttons); // Audible feedback for a button click - could also be visual 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 #if ENABLED(LCD_PROGRESS_BAR)
void dontExpireStatus(); extern millis_t progress_bar_ms; // Start time for the current progress bar cycle
#if PROGRESS_MSG_EXPIRE > 0
void dontExpireStatus();
#endif
#endif #endif
#if ENABLED(LCD_SET_PROGRESS_MANUALLY) #if ENABLED(LCD_SET_PROGRESS_MANUALLY)
@ -246,7 +250,7 @@
void set_lcd_contrast(const int16_t value); void set_lcd_contrast(const int16_t value);
#endif #endif
#if ENABLED(DOGLCD) #if HAS_GRAPHICAL_LCD
#define SETCURSOR(col, row) lcd_moveto(col * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT)) #define SETCURSOR(col, row) lcd_moveto(col * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT))
#define SETCURSOR_RJ(len, row) lcd_moveto(LCD_PIXEL_WIDTH - len * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT)) #define SETCURSOR_RJ(len, row) lcd_moveto(LCD_PIXEL_WIDTH - len * (DOG_CHAR_WIDTH), (row + 1) * (DOG_CHAR_HEIGHT))
#else #else
@ -316,7 +320,7 @@
extern uint8_t filename_scroll_pos, filename_scroll_max; extern uint8_t filename_scroll_pos, filename_scroll_max;
#endif #endif
#endif // ULTIPANEL #endif // HAS_LCD_MENU
#if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT) #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
extern millis_t previous_lcd_status_ms; extern millis_t previous_lcd_status_ms;
@ -422,22 +426,29 @@ extern char lcd_status_message[];
void lcd_reselect_last_file(); void lcd_reselect_last_file();
#endif #endif
// LCD implementations
void lcd_implementation_clear();
void lcd_implementation_init();
#if HAS_GRAPHICAL_LCD #if HAS_GRAPHICAL_LCD
extern bool drawing_screen, first_page; extern bool drawing_screen, first_page;
#elif HAS_SPI_LCD #elif HAS_SPI_LCD
constexpr bool first_page = true; constexpr bool first_page = true;
#endif #endif
// LCD implementations
void lcd_implementation_clear();
void lcd_implementation_init();
#if HAS_CHARACTER_LCD #if HAS_CHARACTER_LCD
enum HD44780CharSet : uint8_t { enum HD44780CharSet : uint8_t { CHARSET_MENU, CHARSET_INFO, CHARSET_BOOT };
CHARSET_MENU,
CHARSET_INFO, void lcd_set_custom_characters(
CHARSET_BOOT #if ENABLED(LCD_PROGRESS_BAR) || ENABLED(SHOW_BOOTSCREEN)
}; const HD44780CharSet screen_charset=CHARSET_INFO
#endif
);
#if ENABLED(LCD_PROGRESS_BAR)
#define LCD_SET_CHARSET(C) lcd_set_custom_characters(C)
#else
#define LCD_SET_CHARSET(C) lcd_set_custom_characters()
#endif
#endif #endif

View File

@ -70,7 +70,7 @@
#include "../feature/fanmux.h" #include "../feature/fanmux.h"
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
#include "../lcd/ultralcd.h" #include "../lcd/ultralcd.h"
#endif #endif
@ -524,7 +524,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
no_move = true; no_move = true;
#endif #endif
#if ENABLED(ULTIPANEL) #if HAS_LCD_MENU
lcd_return_to_status(); lcd_return_to_status();
#endif #endif