Follow-up the PR #5089 (Centralize click-handling in the LCD loop)

bool feedback is no longer used
This commit is contained in:
esenapaj 2016-11-02 08:36:02 +09:00
parent b0be2e41ff
commit c8c1a28f6f

View file

@ -416,7 +416,7 @@ uint8_t lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; // Set when the LCD needs to
} }
} }
static void lcd_goto_previous_menu(bool feedback=false) { static void lcd_goto_previous_menu() {
if (screen_history_depth > 0) { if (screen_history_depth > 0) {
--screen_history_depth; --screen_history_depth;
lcd_goto_screen( lcd_goto_screen(
@ -648,7 +648,7 @@ void kill_screen(const char* lcd_msg) {
long babysteps_done = 0; long babysteps_done = 0;
static void _lcd_babystep(const AxisEnum axis, const char* msg) { static void _lcd_babystep(const AxisEnum axis, const char* msg) {
if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(true); } if (lcd_clicked) { defer_return_to_status = false; return lcd_goto_previous_menu(); }
ENCODER_DIRECTION_NORMAL(); ENCODER_DIRECTION_NORMAL();
if (encoderPosition) { if (encoderPosition) {
int babystep_increment = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR; int babystep_increment = (int32_t)encoderPosition * BABYSTEP_MULTIPLICATOR;
@ -1357,7 +1357,7 @@ void kill_screen(const char* lcd_msg) {
*/ */
static void _lcd_move_xyz(const char* name, AxisEnum axis) { static void _lcd_move_xyz(const char* name, AxisEnum axis) {
if (lcd_clicked) { return lcd_goto_previous_menu(true); } if (lcd_clicked) { return lcd_goto_previous_menu(); }
ENCODER_DIRECTION_NORMAL(); ENCODER_DIRECTION_NORMAL();
if (encoderPosition) { if (encoderPosition) {
refresh_cmd_timeout(); refresh_cmd_timeout();
@ -1397,7 +1397,7 @@ void kill_screen(const char* lcd_msg) {
int8_t eindex=-1 int8_t eindex=-1
#endif #endif
) { ) {
if (lcd_clicked) { return lcd_goto_previous_menu(true); } if (lcd_clicked) { return lcd_goto_previous_menu(); }
ENCODER_DIRECTION_NORMAL(); ENCODER_DIRECTION_NORMAL();
if (encoderPosition) { if (encoderPosition) {
current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale; current_position[E_AXIS] += float((int32_t)encoderPosition) * move_menu_scale;
@ -1884,7 +1884,7 @@ void kill_screen(const char* lcd_msg) {
*/ */
#if HAS_LCD_CONTRAST #if HAS_LCD_CONTRAST
static void lcd_set_contrast() { static void lcd_set_contrast() {
if (lcd_clicked) { return lcd_goto_previous_menu(true); } if (lcd_clicked) { return lcd_goto_previous_menu(); }
ENCODER_DIRECTION_NORMAL(); ENCODER_DIRECTION_NORMAL();
if (encoderPosition) { if (encoderPosition) {
set_lcd_contrast(lcd_contrast + encoderPosition); set_lcd_contrast(lcd_contrast + encoderPosition);
@ -1997,7 +1997,7 @@ void kill_screen(const char* lcd_msg) {
* *
*/ */
static void lcd_info_stats_menu() { static void lcd_info_stats_menu() {
if (lcd_clicked) { return lcd_goto_previous_menu(true); } if (lcd_clicked) { return lcd_goto_previous_menu(); }
char buffer[21]; char buffer[21];
printStatistics stats = print_job_timer.getStats(); printStatistics stats = print_job_timer.getStats();
@ -2031,7 +2031,7 @@ void kill_screen(const char* lcd_msg) {
* *
*/ */
static void lcd_info_thermistors_menu() { static void lcd_info_thermistors_menu() {
if (lcd_clicked) { return lcd_goto_previous_menu(true); } if (lcd_clicked) { return lcd_goto_previous_menu(); }
START_SCREEN(); START_SCREEN();
#define THERMISTOR_ID TEMP_SENSOR_0 #define THERMISTOR_ID TEMP_SENSOR_0
#include "thermistornames.h" #include "thermistornames.h"
@ -2083,7 +2083,7 @@ void kill_screen(const char* lcd_msg) {
* *
*/ */
static void lcd_info_board_menu() { static void lcd_info_board_menu() {
if (lcd_clicked) { return lcd_goto_previous_menu(true); } if (lcd_clicked) { return lcd_goto_previous_menu(); }
START_SCREEN(); START_SCREEN();
STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController STATIC_ITEM(BOARD_NAME, true, true); // MyPrinterController
STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000 STATIC_ITEM(MSG_INFO_BAUDRATE ": " STRINGIFY(BAUDRATE), true); // Baud: 250000
@ -2104,7 +2104,7 @@ void kill_screen(const char* lcd_msg) {
* *
*/ */
static void lcd_info_printer_menu() { static void lcd_info_printer_menu() {
if (lcd_clicked) { return lcd_goto_previous_menu(true); } if (lcd_clicked) { return lcd_goto_previous_menu(); }
START_SCREEN(); START_SCREEN();
STATIC_ITEM(MSG_MARLIN, true, true); // Marlin STATIC_ITEM(MSG_MARLIN, true, true); // Marlin
STATIC_ITEM(SHORT_BUILD_VERSION, true); // x.x.x-Branch STATIC_ITEM(SHORT_BUILD_VERSION, true); // x.x.x-Branch
@ -2300,7 +2300,7 @@ void kill_screen(const char* lcd_msg) {
lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) / scale)); \ lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) / scale)); \
if (lcd_clicked) { \ if (lcd_clicked) { \
*((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) / scale; \ *((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) / scale; \
lcd_goto_previous_menu(true); \ lcd_goto_previous_menu(); \
} \ } \
return lcd_clicked; \ return lcd_clicked; \
} \ } \