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:
Robert Pelnar 2018-07-15 18:37:59 +02:00
parent 68a5a4b74e
commit 39bb855333
8 changed files with 211 additions and 661 deletions

View File

@ -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 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 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_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 ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
//#define ULTIPANEL //the UltiPanel as on Thingiverse //#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 //#define LCD_FEEDBACK_FREQUENCY_HZ 1000 // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click

View File

@ -260,20 +260,6 @@
#define HAS_FOLDER_SORTING (FOLDER_SORTING || SDSORT_GCODE) #define HAS_FOLDER_SORTING (FOLDER_SORTING || SDSORT_GCODE)
#endif #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. // 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 //#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED

View File

@ -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];
}

View File

@ -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

View File

@ -143,10 +143,6 @@ extern int lcd_printf_P(const char* format, ...);
extern bool cancel_heatup; extern bool cancel_heatup;
extern bool isPrintPaused; extern bool isPrintPaused;
#ifdef FILAMENT_LCD_DISPLAY
extern unsigned long message_millis;
#endif
void lcd_buzz(long duration,uint16_t freq); void lcd_buzz(long duration,uint16_t freq);
bool lcd_clicked(); bool lcd_clicked();

View File

@ -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 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
#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 */ /* Custom characters defined in the first 8 characters of the LCD */
#define LCD_STR_BEDTEMP "\x00" #define LCD_STR_BEDTEMP "\x00"
#define LCD_STR_DEGREE "\x01" #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_DOWN "\x01"
#define LCD_STR_ARROW_RIGHT "\x7E" /* from the default character set */ #define LCD_STR_ARROW_RIGHT "\x7E" /* from the default character set */
static void lcd_set_custom_characters( static void lcd_set_custom_characters()
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) {
bool progress_bar_set=true
#endif
) {
byte bedTemp[8] = { byte bedTemp[8] = {
B00000, B00000,
B11111, B11111,
@ -383,55 +372,6 @@ 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_BEDTEMP[0], bedTemp);
lcd.createChar(LCD_STR_DEGREE[0], degree); lcd.createChar(LCD_STR_DEGREE[0], degree);
lcd.createChar(LCD_STR_THERMOMETER[0], thermometer); lcd.createChar(LCD_STR_THERMOMETER[0], thermometer);
@ -442,7 +382,6 @@ static void lcd_set_custom_characters(
lcd.createChar(LCD_STR_CLOCK[0], clock); lcd.createChar(LCD_STR_CLOCK[0], clock);
//lcd.createChar(LCD_STR_ARROW_UP[0], arrup); //lcd.createChar(LCD_STR_ARROW_UP[0], arrup);
//lcd.createChar(LCD_STR_ARROW_DOWN[0], arrdown); //lcd.createChar(LCD_STR_ARROW_DOWN[0], arrdown);
#endif
} }
void lcd_set_custom_characters_arrows() void lcd_set_custom_characters_arrows()
@ -522,11 +461,8 @@ void lcd_set_custom_characters_degree()
} }
static void lcd_implementation_init( static void lcd_implementation_init()
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) {
bool progress_bar_set=true
#endif
) {
#if defined(LCD_I2C_TYPE_PCF8575) #if defined(LCD_I2C_TYPE_PCF8575)
lcd.begin(LCD_WIDTH, LCD_HEIGHT); lcd.begin(LCD_WIDTH, LCD_HEIGHT);
@ -552,21 +488,14 @@ static void lcd_implementation_init(
lcd.begin(LCD_WIDTH, LCD_HEIGHT); lcd.begin(LCD_WIDTH, LCD_HEIGHT);
#endif #endif
lcd_set_custom_characters( lcd_set_custom_characters();
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
progress_bar_set
#endif
);
lcd.clear(); lcd.clear();
} }
static void lcd_implementation_init_noclear( static void lcd_implementation_init_noclear()
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT) {
bool progress_bar_set=true
#endif
) {
#if defined(LCD_I2C_TYPE_PCF8575) #if defined(LCD_I2C_TYPE_PCF8575)
lcd.begin_noclear(LCD_WIDTH, LCD_HEIGHT); lcd.begin_noclear(LCD_WIDTH, LCD_HEIGHT);
@ -592,12 +521,7 @@ static void lcd_implementation_init_noclear(
lcd.begin_noclear(LCD_WIDTH, LCD_HEIGHT); lcd.begin_noclear(LCD_WIDTH, LCD_HEIGHT);
#endif #endif
lcd_set_custom_characters( lcd_set_custom_characters();
#if defined(LCD_PROGRESS_BAR) && defined(SDSUPPORT)
progress_bar_set
#endif
);
} }

View File

@ -186,7 +186,6 @@
#define CMD_DIAGNOSTICS //Show cmd queue length on printer display #define CMD_DIAGNOSTICS //Show cmd queue length on printer display
#endif /* DEBUG_BUILD */ #endif /* DEBUG_BUILD */
//#define EXPERIMENTAL_FEATURES
#define TMC2130_LINEARITY_CORRECTION #define TMC2130_LINEARITY_CORRECTION
#define TMC2130_LINEARITY_CORRECTION_XYZ #define TMC2130_LINEARITY_CORRECTION_XYZ
//#define TMC2130_VARIABLE_RESOLUTION //#define TMC2130_VARIABLE_RESOLUTION