UltraLCD enhancements (lower fan resolution, backlash menu) (#13519)
This commit is contained in:
committed by
Scott Lahteine
parent
de0f35f2d9
commit
5679fae11e
@ -43,6 +43,7 @@ bool printer_busy();
|
||||
static inline char* strfunc(const float value) { return STRFUNC((TYPE) value); } \
|
||||
};
|
||||
|
||||
DECLARE_MENU_EDIT_TYPE(uint8_t, percent, ui8tostr_percent,1 ); // 100% right-justified
|
||||
DECLARE_MENU_EDIT_TYPE(int16_t, int3, i16tostr3, 1 ); // 123, -12 right-justified
|
||||
DECLARE_MENU_EDIT_TYPE(int16_t, int4, i16tostr4sign, 1 ); // 1234, -123 right-justified
|
||||
DECLARE_MENU_EDIT_TYPE(int8_t, int8, i8tostr3, 1 ); // 123, -12 right-justified
|
||||
@ -102,6 +103,7 @@ FORCE_INLINE void draw_menu_item_edit_P(const bool sel, const uint8_t row, PGM_P
|
||||
typedef void NAME##_void
|
||||
#define DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(NAME) _DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(MenuItemInfo_##NAME::type_t, NAME, MenuItemInfo_##NAME::strfunc)
|
||||
|
||||
DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(percent); // 100% right-justified
|
||||
DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int3); // 123, -12 right-justified
|
||||
DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int4); // 1234, -123 right-justified
|
||||
DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(int8); // 123, -12 right-justified
|
||||
@ -174,6 +176,7 @@ class TMenuItem : MenuItemBase {
|
||||
|
||||
#define DECLARE_MENU_EDIT_ITEM(NAME) typedef TMenuItem<MenuItemInfo_##NAME> MenuItem_##NAME;
|
||||
|
||||
DECLARE_MENU_EDIT_ITEM(percent);
|
||||
DECLARE_MENU_EDIT_ITEM(int3);
|
||||
DECLARE_MENU_EDIT_ITEM(int4);
|
||||
DECLARE_MENU_EDIT_ITEM(int8);
|
||||
|
@ -49,6 +49,7 @@
|
||||
#endif
|
||||
|
||||
void menu_tmc();
|
||||
void menu_backlash();
|
||||
|
||||
#if ENABLED(DAC_STEPPER_CURRENT)
|
||||
|
||||
@ -647,6 +648,10 @@ void menu_advanced_settings() {
|
||||
}
|
||||
#endif // !SLIM_LCD_MENUS
|
||||
|
||||
#if ENABLED(BACKLASH_GCODE)
|
||||
MENU_ITEM(submenu, MSG_BACKLASH, menu_backlash);
|
||||
#endif
|
||||
|
||||
#if ENABLED(DAC_STEPPER_CURRENT)
|
||||
MENU_ITEM(submenu, MSG_DRIVE_STRENGTH, menu_dac);
|
||||
#endif
|
||||
|
58
Marlin/src/lcd/menu/menu_backlash.cpp
Normal file
58
Marlin/src/lcd/menu/menu_backlash.cpp
Normal file
@ -0,0 +1,58 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
//
|
||||
// Backlash Menu
|
||||
//
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
#if HAS_LCD_MENU && ENABLED(BACKLASH_GCODE)
|
||||
|
||||
#include "menu.h"
|
||||
|
||||
extern float backlash_distance_mm[XYZ];
|
||||
extern uint8_t backlash_correction;
|
||||
|
||||
#ifdef BACKLASH_SMOOTHING_MM
|
||||
extern float backlash_smoothing_mm;
|
||||
#endif
|
||||
|
||||
void menu_backlash() {
|
||||
START_MENU();
|
||||
MENU_BACK(MSG_MAIN);
|
||||
|
||||
MENU_MULTIPLIER_ITEM_EDIT(percent, MSG_BACKLASH_CORRECTION, &backlash_correction, all_off, all_on);
|
||||
|
||||
#define EDIT_BACKLASH_DISTANCE(N) MENU_MULTIPLIER_ITEM_EDIT(float43, MSG_##N, &backlash_distance_mm[_AXIS(N)], 0.0f, 9.9f);
|
||||
EDIT_BACKLASH_DISTANCE(A);
|
||||
EDIT_BACKLASH_DISTANCE(B);
|
||||
EDIT_BACKLASH_DISTANCE(C);
|
||||
|
||||
#ifdef BACKLASH_SMOOTHING_MM
|
||||
MENU_MULTIPLIER_ITEM_EDIT(float43, MSG_BACKLASH_SMOOTHING, &backlash_smoothing_mm, 0.0f, 9.9f);
|
||||
#endif
|
||||
|
||||
END_MENU();
|
||||
}
|
||||
|
||||
#endif // HAS_LCD_MENU && BACKLASH_COMPENSATION
|
@ -395,21 +395,21 @@ void menu_temperature() {
|
||||
//
|
||||
#if FAN_COUNT > 0
|
||||
#if HAS_FAN0
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(uint8, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.lcd_tmpfan_speed[0], 0, 255, thermalManager.lcd_setFanSpeed0);
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(percent, MSG_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.lcd_tmpfan_speed[0], 0, 255, thermalManager.lcd_setFanSpeed0);
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
MENU_MULTIPLIER_ITEM_EDIT(uint8, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.new_fan_speed[0], 3, 255);
|
||||
MENU_MULTIPLIER_ITEM_EDIT(percent, MSG_EXTRA_FAN_SPEED FAN_SPEED_1_SUFFIX, &thermalManager.new_fan_speed[0], 3, 255);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_FAN1 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 1)
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(uint8, MSG_FAN_SPEED " 2", &thermalManager.lcd_tmpfan_speed[1], 0, 255, thermalManager.lcd_setFanSpeed1);
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(percent, MSG_FAN_SPEED " 2", &thermalManager.lcd_tmpfan_speed[1], 0, 255, thermalManager.lcd_setFanSpeed1);
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
MENU_MULTIPLIER_ITEM_EDIT(uint8, MSG_EXTRA_FAN_SPEED " 2", &thermalManager.new_fan_speed[1], 3, 255);
|
||||
MENU_MULTIPLIER_ITEM_EDIT(percent, MSG_EXTRA_FAN_SPEED " 2", &thermalManager.new_fan_speed[1], 3, 255);
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_FAN2 || (ENABLED(SINGLENOZZLE) && EXTRUDERS > 2)
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(uint8, MSG_FAN_SPEED " 3", &thermalManager.lcd_tmpfan_speed[2], 0, 255, thermalManager.lcd_setFanSpeed2);
|
||||
MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(percent, MSG_FAN_SPEED " 3", &thermalManager.lcd_tmpfan_speed[2], 0, 255, thermalManager.lcd_setFanSpeed2);
|
||||
#if ENABLED(EXTRA_FAN_SPEED)
|
||||
MENU_MULTIPLIER_ITEM_EDIT(uint8, MSG_EXTRA_FAN_SPEED " 3", &thermalManager.new_fan_speed[2], 3, 255);
|
||||
MENU_MULTIPLIER_ITEM_EDIT(percent, MSG_EXTRA_FAN_SPEED " 3", &thermalManager.new_fan_speed[2], 3, 255);
|
||||
#endif
|
||||
#endif
|
||||
#endif // FAN_COUNT > 0
|
||||
|
Reference in New Issue
Block a user