LCD menu optimalization - menu_item_edit_int3
MenuStack removed FILAMENT_LCD_DISPLAY and ENCODER_STEPS_PER_MENU_ITEM removed (unused) EXPERIMENTAL_FEATURES menu removed
This commit is contained in:
parent
68a5a4b74e
commit
39bb855333
@ -626,7 +626,7 @@ your extruder heater takes 2 minutes to hit the target on heating.
|
||||
//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
|
||||
#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
|
||||
#define ENCODER_PULSES_PER_STEP 4 // Increase if you have a high resolution encoder
|
||||
#define ENCODER_STEPS_PER_MENU_ITEM 1 // Set according to ENCODER_PULSES_PER_STEP or your liking
|
||||
//#define ENCODER_STEPS_PER_MENU_ITEM 1 // Set according to ENCODER_PULSES_PER_STEP or your liking
|
||||
//#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
|
||||
//#define ULTIPANEL //the UltiPanel as on Thingiverse
|
||||
//#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
|
||||
|
@ -260,20 +260,6 @@
|
||||
#define HAS_FOLDER_SORTING (FOLDER_SORTING || SDSORT_GCODE)
|
||||
#endif
|
||||
|
||||
// Show a progress bar on the LCD when printing from SD?
|
||||
//#define LCD_PROGRESS_BAR
|
||||
|
||||
#ifdef LCD_PROGRESS_BAR
|
||||
// Amount of time (ms) to show the bar
|
||||
#define PROGRESS_BAR_BAR_TIME 2000
|
||||
// Amount of time (ms) to show the status message
|
||||
#define PROGRESS_BAR_MSG_TIME 3000
|
||||
// Amount of time (ms) to retain the status message (0=forever)
|
||||
#define PROGRESS_MSG_EXPIRE 0
|
||||
// Enable this to show messages for MSG_TIME then hide them
|
||||
//#define PROGRESS_MSG_ONCE
|
||||
#endif
|
||||
|
||||
// Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled.
|
||||
//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
|
||||
|
||||
|
@ -1,29 +0,0 @@
|
||||
/**
|
||||
* @file
|
||||
* @author Marek Bel
|
||||
*/
|
||||
|
||||
#include "MenuStack.h"
|
||||
/**
|
||||
* @brief Push menu on stack
|
||||
* @param menu
|
||||
* @param position selected position in menu being pushed
|
||||
*/
|
||||
void MenuStack::push(menuFunc_t menu, int8_t position)
|
||||
{
|
||||
if (m_index >= max_depth) return;
|
||||
m_stack[m_index].menu = menu;
|
||||
m_stack[m_index].position = position;
|
||||
++m_index;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pop menu from stack
|
||||
* @return Record containing menu function pointer and previously selected line number
|
||||
*/
|
||||
MenuStack::Record MenuStack::pop()
|
||||
{
|
||||
if (m_index != 0) m_index--;
|
||||
|
||||
return m_stack[m_index];
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
/**
|
||||
* @file
|
||||
* @author Marek Bel
|
||||
*/
|
||||
|
||||
#ifndef MENUSTACK_H
|
||||
#define MENUSTACK_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/** Pointer to function implementing menu.*/
|
||||
typedef void (*menuFunc_t)();
|
||||
/**
|
||||
* @brief Stack implementation for navigating menu structure
|
||||
*/
|
||||
class MenuStack
|
||||
{
|
||||
public:
|
||||
struct Record
|
||||
{
|
||||
menuFunc_t menu;
|
||||
int8_t position;
|
||||
};
|
||||
MenuStack():m_stack(),m_index(0) {}
|
||||
void push(menuFunc_t menu, int8_t position);
|
||||
Record pop();
|
||||
void reset(){m_index = 0;}
|
||||
private:
|
||||
static const int max_depth = 4;
|
||||
Record m_stack[max_depth];
|
||||
uint8_t m_index;
|
||||
};
|
||||
|
||||
#endif /* FIRMWARE_MENUSTACK_H_ */
|
File diff suppressed because it is too large
Load Diff
@ -142,11 +142,7 @@ extern int lcd_printf_P(const char* format, ...);
|
||||
|
||||
extern bool cancel_heatup;
|
||||
extern bool isPrintPaused;
|
||||
|
||||
#ifdef FILAMENT_LCD_DISPLAY
|
||||
extern unsigned long message_millis;
|
||||
#endif
|
||||
|
||||
|
||||
void lcd_buzz(long duration,uint16_t freq);
|
||||
bool lcd_clicked();
|
||||
|
||||
|
@ -215,14 +215,6 @@ extern volatile uint16_t buttons; //an extended version of the last checked but
|
||||
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
|
||||
|
||||
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
|
||||
static uint16_t progressBarTick = 0;
|
||||
#if PROGRESS_MSG_EXPIRE > 0
|
||||
static uint16_t messageTick = 0;
|
||||
#endif
|
||||
#define LCD_STR_PROGRESS "\x03\x04\x05"
|
||||
#endif
|
||||
|
||||
/* Custom characters defined in the first 8 characters of the LCD */
|
||||
#define LCD_STR_BEDTEMP "\x00"
|
||||
#define LCD_STR_DEGREE "\x01"
|
||||
@ -236,11 +228,8 @@ extern volatile uint16_t buttons; //an extended version of the last checked but
|
||||
#define LCD_STR_ARROW_DOWN "\x01"
|
||||
#define LCD_STR_ARROW_RIGHT "\x7E" /* from the default character set */
|
||||
|
||||
static void lcd_set_custom_characters(
|
||||
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
|
||||
bool progress_bar_set=true
|
||||
#endif
|
||||
) {
|
||||
static void lcd_set_custom_characters()
|
||||
{
|
||||
byte bedTemp[8] = {
|
||||
B00000,
|
||||
B11111,
|
||||
@ -383,66 +372,16 @@ static void lcd_set_custom_characters(
|
||||
};
|
||||
|
||||
|
||||
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
|
||||
static bool char_mode = false;
|
||||
byte progress[3][8] = { {
|
||||
B00000,
|
||||
B10000,
|
||||
B10000,
|
||||
B10000,
|
||||
B10000,
|
||||
B10000,
|
||||
B10000,
|
||||
B00000
|
||||
}, {
|
||||
B00000,
|
||||
B10100,
|
||||
B10100,
|
||||
B10100,
|
||||
B10100,
|
||||
B10100,
|
||||
B10100,
|
||||
B00000
|
||||
}, {
|
||||
B00000,
|
||||
B10101,
|
||||
B10101,
|
||||
B10101,
|
||||
B10101,
|
||||
B10101,
|
||||
B10101,
|
||||
B00000
|
||||
} };
|
||||
if (progress_bar_set != char_mode) {
|
||||
char_mode = progress_bar_set;
|
||||
lcd.createChar(LCD_STR_BEDTEMP[0], bedTemp);
|
||||
lcd.createChar(LCD_STR_DEGREE[0], degree);
|
||||
lcd.createChar(LCD_STR_THERMOMETER[0], thermometer);
|
||||
lcd.createChar(LCD_STR_FEEDRATE[0], feedrate);
|
||||
lcd.createChar(LCD_STR_CLOCK[0], clock);
|
||||
if (progress_bar_set) {
|
||||
// Progress bar characters for info screen
|
||||
for (int i=3; i--;) lcd.createChar(LCD_STR_PROGRESS[i], progress[i]);
|
||||
}
|
||||
else {
|
||||
// Custom characters for submenus
|
||||
lcd.createChar(LCD_STR_UPLEVEL[0], uplevel);
|
||||
lcd.createChar(LCD_STR_REFRESH[0], refresh);
|
||||
lcd.createChar(LCD_STR_FOLDER[0], folder);
|
||||
}
|
||||
}
|
||||
#else
|
||||
lcd.createChar(LCD_STR_BEDTEMP[0], bedTemp);
|
||||
lcd.createChar(LCD_STR_DEGREE[0], degree);
|
||||
lcd.createChar(LCD_STR_THERMOMETER[0], thermometer);
|
||||
lcd.createChar(LCD_STR_UPLEVEL[0], uplevel);
|
||||
lcd.createChar(LCD_STR_REFRESH[0], refresh);
|
||||
lcd.createChar(LCD_STR_FOLDER[0], folder);
|
||||
lcd.createChar(LCD_STR_FEEDRATE[0], feedrate);
|
||||
lcd.createChar(LCD_STR_CLOCK[0], clock);
|
||||
//lcd.createChar(LCD_STR_ARROW_UP[0], arrup);
|
||||
//lcd.createChar(LCD_STR_ARROW_DOWN[0], arrdown);
|
||||
#endif
|
||||
lcd.createChar(LCD_STR_BEDTEMP[0], bedTemp);
|
||||
lcd.createChar(LCD_STR_DEGREE[0], degree);
|
||||
lcd.createChar(LCD_STR_THERMOMETER[0], thermometer);
|
||||
lcd.createChar(LCD_STR_UPLEVEL[0], uplevel);
|
||||
lcd.createChar(LCD_STR_REFRESH[0], refresh);
|
||||
lcd.createChar(LCD_STR_FOLDER[0], folder);
|
||||
lcd.createChar(LCD_STR_FEEDRATE[0], feedrate);
|
||||
lcd.createChar(LCD_STR_CLOCK[0], clock);
|
||||
//lcd.createChar(LCD_STR_ARROW_UP[0], arrup);
|
||||
//lcd.createChar(LCD_STR_ARROW_DOWN[0], arrdown);
|
||||
}
|
||||
|
||||
void lcd_set_custom_characters_arrows()
|
||||
@ -522,11 +461,8 @@ void lcd_set_custom_characters_degree()
|
||||
}
|
||||
|
||||
|
||||
static void lcd_implementation_init(
|
||||
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
|
||||
bool progress_bar_set=true
|
||||
#endif
|
||||
) {
|
||||
static void lcd_implementation_init()
|
||||
{
|
||||
|
||||
#if defined(LCD_I2C_TYPE_PCF8575)
|
||||
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
|
||||
@ -552,21 +488,14 @@ static void lcd_implementation_init(
|
||||
lcd.begin(LCD_WIDTH, LCD_HEIGHT);
|
||||
#endif
|
||||
|
||||
lcd_set_custom_characters(
|
||||
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
|
||||
progress_bar_set
|
||||
#endif
|
||||
);
|
||||
lcd_set_custom_characters();
|
||||
|
||||
lcd.clear();
|
||||
}
|
||||
|
||||
|
||||
static void lcd_implementation_init_noclear(
|
||||
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
|
||||
bool progress_bar_set=true
|
||||
#endif
|
||||
) {
|
||||
static void lcd_implementation_init_noclear()
|
||||
{
|
||||
|
||||
#if defined(LCD_I2C_TYPE_PCF8575)
|
||||
lcd.begin_noclear(LCD_WIDTH, LCD_HEIGHT);
|
||||
@ -592,12 +521,7 @@ static void lcd_implementation_init_noclear(
|
||||
lcd.begin_noclear(LCD_WIDTH, LCD_HEIGHT);
|
||||
#endif
|
||||
|
||||
lcd_set_custom_characters(
|
||||
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
|
||||
progress_bar_set
|
||||
#endif
|
||||
);
|
||||
|
||||
lcd_set_custom_characters();
|
||||
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,6 @@
|
||||
#define CMD_DIAGNOSTICS //Show cmd queue length on printer display
|
||||
#endif /* DEBUG_BUILD */
|
||||
|
||||
//#define EXPERIMENTAL_FEATURES
|
||||
#define TMC2130_LINEARITY_CORRECTION
|
||||
#define TMC2130_LINEARITY_CORRECTION_XYZ
|
||||
//#define TMC2130_VARIABLE_RESOLUTION
|
||||
|
Loading…
Reference in New Issue
Block a user