|
@@ -150,6 +150,10 @@ static void mmu_cut_filament_menu();
|
|
|
static void lcd_menu_fails_stats();
|
|
|
#endif //TMC2130 or FILAMENT_SENSOR
|
|
|
|
|
|
+#ifdef TMC2130
|
|
|
+static void lcd_belttest_v();
|
|
|
+#endif //TMC2130
|
|
|
+
|
|
|
static void lcd_selftest_v();
|
|
|
|
|
|
#ifdef TMC2130
|
|
@@ -313,18 +317,24 @@ bool bSettings; // flag (i.e. 'fake parameter'
|
|
|
const char STR_SEPARATOR[] PROGMEM = "------------";
|
|
|
|
|
|
|
|
|
-static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, char* longFilename)
|
|
|
+static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char* filename, char* longFilename)
|
|
|
{
|
|
|
char c;
|
|
|
- int enc_dif = lcd_encoder_diff;
|
|
|
+ int enc_dif = lcd_encoder_diff / ENCODER_PULSES_PER_STEP;
|
|
|
uint8_t n = LCD_WIDTH - 1;
|
|
|
+
|
|
|
for(uint_least8_t g = 0; g<4;g++){
|
|
|
lcd_set_cursor(0, g);
|
|
|
lcd_print(' ');
|
|
|
}
|
|
|
-
|
|
|
lcd_set_cursor(0, row);
|
|
|
lcd_print('>');
|
|
|
+
|
|
|
+ if (longFilename[0] == '\0')
|
|
|
+ {
|
|
|
+ longFilename = filename;
|
|
|
+ }
|
|
|
+
|
|
|
int i = 1;
|
|
|
int j = 0;
|
|
|
char* longFilenameTMP = longFilename;
|
|
@@ -342,7 +352,7 @@ static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, char* longF
|
|
|
n = LCD_WIDTH - 1;
|
|
|
for(int g = 0; g<300 ;g++){
|
|
|
manage_heater();
|
|
|
- if(LCD_CLICKED || ( enc_dif != lcd_encoder_diff )){
|
|
|
+ if(LCD_CLICKED || ( enc_dif != (lcd_encoder_diff / ENCODER_PULSES_PER_STEP))){
|
|
|
longFilenameTMP = longFilename;
|
|
|
*(longFilenameTMP + LCD_WIDTH - 2) = '\0';
|
|
|
i = 1;
|
|
@@ -540,7 +550,7 @@ static uint8_t menu_item_sdfile(const char*
|
|
|
if (lcd_draw_update)
|
|
|
{
|
|
|
if (lcd_encoder == menu_item)
|
|
|
- lcd_implementation_drawmenu_sdfile_selected(menu_row, str_fnl);
|
|
|
+ lcd_implementation_drawmenu_sdfile_selected(menu_row, str_fn, str_fnl);
|
|
|
else
|
|
|
lcd_implementation_drawmenu_sdfile(menu_row, str_fn, str_fnl);
|
|
|
}
|
|
@@ -605,11 +615,21 @@ void lcdui_print_feedrate(void)
|
|
|
// Print percent done in form "USB---%", " SD---%", " ---%" (7 chars total)
|
|
|
void lcdui_print_percent_done(void)
|
|
|
{
|
|
|
+ char sheet[8];
|
|
|
const char* src = is_usb_printing?_N("USB"):(IS_SD_PRINTING?_N(" SD"):_N(" "));
|
|
|
char per[4];
|
|
|
bool num = IS_SD_PRINTING || (PRINTER_ACTIVE && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT));
|
|
|
- sprintf_P(per, num?_N("%3hhd"):_N("---"), calc_percent_done());
|
|
|
- lcd_printf_P(_N("%3S%3s%%"), src, per);
|
|
|
+ if (!num || heating_status) // either not printing or heating
|
|
|
+ {
|
|
|
+ eeprom_read_block(sheet, EEPROM_Sheets_base->s[eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))].name, 7);
|
|
|
+ sheet[7] = '\0';
|
|
|
+ lcd_printf_P(PSTR("%s"),sheet);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sprintf_P(per, num?_N("%3hhd"):_N("---"), calc_percent_done());
|
|
|
+ lcd_printf_P(_N("%3S%3s%%"), src, per);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// Print extruder status (5 chars total)
|
|
@@ -712,10 +732,10 @@ void lcdui_print_status_line(void)
|
|
|
{
|
|
|
if (IS_SD_PRINTING)
|
|
|
{
|
|
|
- if (strcmp(longFilenameOLD, card.longFilename) != 0)
|
|
|
+ if (strcmp(longFilenameOLD, (card.longFilename[0] ? card.longFilename : card.filename)) != 0)
|
|
|
{
|
|
|
memset(longFilenameOLD, '\0', strlen(longFilenameOLD));
|
|
|
- sprintf_P(longFilenameOLD, PSTR("%s"), card.longFilename);
|
|
|
+ sprintf_P(longFilenameOLD, PSTR("%s"), (card.longFilename[0] ? card.longFilename : card.filename));
|
|
|
scrollstuff = 0;
|
|
|
}
|
|
|
}
|
|
@@ -763,16 +783,16 @@ void lcdui_print_status_line(void)
|
|
|
}
|
|
|
else if ((IS_SD_PRINTING) && (custom_message_type == CustomMsg::Status))
|
|
|
{ // If printing from SD, show what we are printing
|
|
|
- if(strlen(card.longFilename) > LCD_WIDTH)
|
|
|
+ if(strlen(longFilenameOLD) > LCD_WIDTH)
|
|
|
{
|
|
|
int inters = 0;
|
|
|
int gh = scrollstuff;
|
|
|
while (((gh - scrollstuff) < LCD_WIDTH) && (inters == 0))
|
|
|
{
|
|
|
- if (card.longFilename[gh] == '\0')
|
|
|
+ if (longFilenameOLD[gh] == '\0')
|
|
|
{
|
|
|
lcd_set_cursor(gh - scrollstuff, 3);
|
|
|
- lcd_print(card.longFilename[gh - 1]);
|
|
|
+ lcd_print(longFilenameOLD[gh - 1]);
|
|
|
scrollstuff = 0;
|
|
|
gh = scrollstuff;
|
|
|
inters = 1;
|
|
@@ -780,7 +800,7 @@ void lcdui_print_status_line(void)
|
|
|
else
|
|
|
{
|
|
|
lcd_set_cursor(gh - scrollstuff, 3);
|
|
|
- lcd_print(card.longFilename[gh - 1]);
|
|
|
+ lcd_print(longFilenameOLD[gh - 1]);
|
|
|
gh++;
|
|
|
}
|
|
|
}
|
|
@@ -788,7 +808,7 @@ void lcdui_print_status_line(void)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- lcd_print(longFilenameOLD);
|
|
|
+ lcd_printf_P(PSTR("%-20s"), longFilenameOLD);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -841,12 +861,13 @@ void lcdui_print_status_line(void)
|
|
|
break;
|
|
|
case CustomMsg::TempCal: // PINDA temp calibration in progress
|
|
|
{
|
|
|
+ char statusLine[LCD_WIDTH + 1];
|
|
|
+ sprintf_P(statusLine, PSTR("%-20S"), _T(MSG_TEMP_CALIBRATION));
|
|
|
char progress[4];
|
|
|
+ sprintf_P(progress, PSTR("%d/6"), custom_message_state);
|
|
|
+ memcpy(statusLine + 12, progress, sizeof(progress) - 1);
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_T(MSG_TEMP_CALIBRATION));
|
|
|
- lcd_set_cursor(12, 3);
|
|
|
- sprintf(progress, "%d/6", custom_message_state);
|
|
|
- lcd_print(progress);
|
|
|
+ lcd_print(statusLine);
|
|
|
}
|
|
|
break;
|
|
|
case CustomMsg::TempCompPreheat: // temp compensation preheat
|
|
@@ -1075,12 +1096,8 @@ void lcd_commands()
|
|
|
if (!blocks_queued() && !homing_flag)
|
|
|
{
|
|
|
lcd_setstatuspgm(_i("Print paused"));////MSG_PRINT_PAUSED c=20 r=1
|
|
|
- long_pause();
|
|
|
- if (lcd_commands_type == LcdCommands::LongPause) // !!! because "lcd_commands_type" can be changed during/inside "long_pause()"
|
|
|
- {
|
|
|
- lcd_commands_type = LcdCommands::Idle;
|
|
|
- lcd_commands_step = 0;
|
|
|
- }
|
|
|
+ lcd_commands_type = LcdCommands::Idle;
|
|
|
+ lcd_commands_step = 0;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1639,7 +1656,7 @@ void lcd_pause_print()
|
|
|
{
|
|
|
lcd_return_to_status();
|
|
|
stop_and_save_print_to_ram(0.0,0.0);
|
|
|
- setAllTargetHotends(0);
|
|
|
+ long_pause();
|
|
|
isPrintPaused = true;
|
|
|
if (LcdCommands::Idle == lcd_commands_type)
|
|
|
{
|
|
@@ -1846,8 +1863,8 @@ static void lcd_menu_fails_stats_total()
|
|
|
//! @code{.unparsed}
|
|
|
//! |01234567890123456789|
|
|
|
//! |Last print failures | c=20 r=1
|
|
|
-//! | Power failures: 000| c=14 r=1
|
|
|
-//! | Filam. runouts: 000| c=14 r=1
|
|
|
+//! | Power failures 000| c=14 r=1
|
|
|
+//! | Filam. runouts 000| c=14 r=1
|
|
|
//! | Crash X:000 Y:000| c=7 r=1
|
|
|
//! ----------------------
|
|
|
//! @endcode
|
|
@@ -1893,6 +1910,7 @@ static void lcd_menu_fails_stats()
|
|
|
}
|
|
|
|
|
|
#elif defined(FILAMENT_SENSOR)
|
|
|
+static const char failStatsFmt[] PROGMEM = "%S\n" " %-16.16S%-3d\n" "%S\n" " %-16.16S%-3d\n";
|
|
|
//!
|
|
|
//! @brief Print last print and total filament run outs
|
|
|
//!
|
|
@@ -1903,9 +1921,9 @@ static void lcd_menu_fails_stats()
|
|
|
//! @code{.unparsed}
|
|
|
//! |01234567890123456789|
|
|
|
//! |Last print failures | c=20 r=1
|
|
|
-//! | Filam. runouts: 000| c=14 r=1
|
|
|
+//! | Filam. runouts 000| c=14 r=1
|
|
|
//! |Total failures | c=20 r=1
|
|
|
-//! | Filam. runouts: 000| c=14 r=1
|
|
|
+//! | Filam. runouts 000| c=14 r=1
|
|
|
//! ----------------------
|
|
|
//! @endcode
|
|
|
//! @todo Positioning of the messages and values on LCD aren't fixed to their exact place. This causes issues with translations.
|
|
@@ -1915,11 +1933,13 @@ static void lcd_menu_fails_stats()
|
|
|
uint8_t filamentLast = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT);
|
|
|
uint16_t filamentTotal = eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT);
|
|
|
lcd_home();
|
|
|
- lcd_printf_P(PSTR("Last print failures\n" ////c=20 r=1
|
|
|
- " Filam. runouts %-3d\n" ////c=14 r=1
|
|
|
- "Total failures\n" ////c=20 r=1
|
|
|
- " Filam. runouts %-3d"), filamentLast, filamentTotal); ////c=14 r=1
|
|
|
- menu_back_if_clicked();
|
|
|
+ lcd_printf_P(failStatsFmt,
|
|
|
+ _i("Last print failures"), ////c=20 r=1
|
|
|
+ _i("Filam. runouts"), filamentLast, ////c=14 r=1
|
|
|
+ _i("Total failures"), ////c=20 r=1
|
|
|
+ _i("Filam. runouts"), filamentTotal); ////c=14 r=1
|
|
|
+
|
|
|
+ menu_back_if_clicked();
|
|
|
}
|
|
|
#else
|
|
|
static void lcd_menu_fails_stats()
|
|
@@ -2374,9 +2394,11 @@ void mFilamentItem(uint16_t nTemp, uint16_t nTempBed)
|
|
|
{
|
|
|
lcd_commands_type = LcdCommands::Layer1Cal;
|
|
|
}
|
|
|
- else if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE))
|
|
|
+ else
|
|
|
{
|
|
|
- lcd_wizard(WizState::LoadFilHot);
|
|
|
+ raise_z_above(MIN_Z_FOR_PREHEAT);
|
|
|
+ if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE))
|
|
|
+ lcd_wizard(WizState::LoadFilHot);
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
@@ -3017,7 +3039,7 @@ static void lcd_menu_xyz_y_min()
|
|
|
for (uint8_t i = 0; i < 2; i++)
|
|
|
{
|
|
|
lcd_set_cursor(11,2+i);
|
|
|
- if (distanceMin[i] >= 200) lcd_puts_P(_N("N/A")); ////c=3 r=1
|
|
|
+ if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); ////c=3 r=1
|
|
|
else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]);
|
|
|
}
|
|
|
if (lcd_clicked())
|
|
@@ -3063,7 +3085,7 @@ static void lcd_menu_xyz_skew()
|
|
|
}
|
|
|
else{
|
|
|
lcd_set_cursor(15,0);
|
|
|
- lcd_puts_P(_N("N/A"));
|
|
|
+ lcd_puts_P(_T(MSG_NA));
|
|
|
}
|
|
|
if (lcd_clicked())
|
|
|
menu_goto(lcd_menu_xyz_offset, 0, true, true);
|
|
@@ -3449,6 +3471,8 @@ void lcd_wait_for_cool_down() {
|
|
|
lcd_set_custom_characters_degree();
|
|
|
setAllTargetHotends(0);
|
|
|
setTargetBed(0);
|
|
|
+ int fanSpeedBckp = fanSpeed;
|
|
|
+ fanSpeed = 255;
|
|
|
while ((degHotend(0)>MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) {
|
|
|
lcd_display_message_fullscreen_P(_i("Waiting for nozzle and bed cooling"));////MSG_WAITING_TEMP c=20 r=3
|
|
|
|
|
@@ -3467,6 +3491,7 @@ void lcd_wait_for_cool_down() {
|
|
|
delay_keep_alive(1000);
|
|
|
serialecho_temperatures();
|
|
|
}
|
|
|
+ fanSpeed = fanSpeedBckp;
|
|
|
lcd_set_custom_characters_arrows();
|
|
|
lcd_update_enable(true);
|
|
|
}
|
|
@@ -3997,13 +4022,13 @@ static void lcd_print_state(uint8_t state)
|
|
|
{
|
|
|
switch (state) {
|
|
|
case STATE_ON:
|
|
|
- lcd_puts_P(_i(" 1"));
|
|
|
+ lcd_puts_P(_N(" 1"));
|
|
|
break;
|
|
|
case STATE_OFF:
|
|
|
- lcd_puts_P(_i(" 0"));
|
|
|
+ lcd_puts_P(_N(" 0"));
|
|
|
break;
|
|
|
default:
|
|
|
- lcd_puts_P(_i("N/A"));
|
|
|
+ lcd_puts_P(_T(MSG_NA));
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -4016,7 +4041,8 @@ static void lcd_show_sensors_state()
|
|
|
uint8_t idler_state = STATE_NA;
|
|
|
|
|
|
pinda_state = READ(Z_MIN_PIN);
|
|
|
- if (mmu_enabled) {
|
|
|
+ if (mmu_enabled && ((_millis() - mmu_last_finda_response) < 1000ul) )
|
|
|
+ {
|
|
|
finda_state = mmu_finda;
|
|
|
}
|
|
|
if (ir_sensor_detected) {
|
|
@@ -4776,10 +4802,10 @@ void lcd_toshiba_flash_air_compatibility_toggle()
|
|
|
//!
|
|
|
//! @code{.unparsed}
|
|
|
//! |01234567890123456789|
|
|
|
-//! |[Smooth1]Live adj. Z| c=11
|
|
|
-//! |value set, continue | c=20
|
|
|
-//! |or start from zero? | c=20
|
|
|
-//! |>Continue Reset | c=a, c=b, a+b = 18
|
|
|
+//! |Sheet Smooth1 actual| c=a, c=b, a+b = 13
|
|
|
+//! |Z offset: -1.480 mm | c=a, c=b, a+b = 14
|
|
|
+//! |>Continue | c=19
|
|
|
+//! | Start from zero | c=19
|
|
|
//! ----------------------
|
|
|
//! @endcode
|
|
|
void lcd_first_layer_calibration_reset()
|
|
@@ -4817,8 +4843,9 @@ void lcd_first_layer_calibration_reset()
|
|
|
char sheet_name[sizeof(Sheet::name)];
|
|
|
eeprom_read_block(sheet_name, &EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].name, sizeof(Sheet::name));
|
|
|
lcd_set_cursor(0, 0);
|
|
|
- lcd_printf_P(_i("[%.7s]Live adj. Z\nvalue set, continue\nor start from zero?\n%cContinue%cReset"), //// \n denotes line break, %.7s is replaced by 7 character long sheet name, %+1.3f is replaced by 6 character long floating point number, %c is replaced by > or white space (one character) based on whether first or second option is selected. % denoted place holders can not be reordered. r=4
|
|
|
- sheet_name, menuData->reset ? ' ' : '>', menuData->reset ? '>' : ' ');
|
|
|
+ float offset = static_cast<int16_t>(eeprom_read_word(reinterpret_cast<uint16_t*>(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)))/cs.axis_steps_per_unit[Z_AXIS];
|
|
|
+ lcd_printf_P(_i("Sheet %.7s\nZ offset: %+1.3f mm\n%cContinue\n%cStart from zero"), //// \n denotes line break, %.7s is replaced by 7 character long sheet name, %+1.3f is replaced by 6 character long floating point number, %c is replaced by > or white space (one character) based on whether first or second option is selected. % denoted place holders can not be reordered. r=4
|
|
|
+ sheet_name, offset, menuData->reset ? ' ' : '>', menuData->reset ? '>' : ' ');
|
|
|
|
|
|
}
|
|
|
|
|
@@ -4932,12 +4959,12 @@ static void lcd_wizard_load()
|
|
|
{
|
|
|
if (mmu_enabled)
|
|
|
{
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("Please insert filament to the first tube of MMU, then press the knob to load it."));////c=20 r=8
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("Please insert filament into the first tube of the MMU, then press the knob to load it."));////c=20 r=8
|
|
|
tmp_extruder = 0;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("Please insert filament to the extruder, then press knob to load it."));////MSG_WIZARD_LOAD_FILAMENT c=20 r=8
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("Please insert filament into the extruder, then press the knob to load it."));////MSG_WIZARD_LOAD_FILAMENT c=20 r=8
|
|
|
}
|
|
|
lcd_update_enable(false);
|
|
|
lcd_clear();
|
|
@@ -4961,7 +4988,7 @@ static void wizard_lay1cal_message(bool cold)
|
|
|
if (mmu_enabled)
|
|
|
{
|
|
|
lcd_show_fullscreen_message_and_wait_P(
|
|
|
- _i("First you will select filament you wish to use for calibration. Then select temperature which matches your material."));
|
|
|
+ _i("Choose a filament for the First Layer Calibration and select it in the on-screen menu."));
|
|
|
}
|
|
|
else if (cold)
|
|
|
{
|
|
@@ -4969,7 +4996,7 @@ static void wizard_lay1cal_message(bool cold)
|
|
|
_i("Select temperature which matches your material."));
|
|
|
}
|
|
|
lcd_show_fullscreen_message_and_wait_P(
|
|
|
- _i("I will start to print line and you will gradually lower the nozzle by rotating the knob, until you reach optimal height. Check the pictures in our handbook in chapter Calibration.")); ////MSG_WIZARD_V2_CAL_2 c=20 r=12
|
|
|
+ _i("The printer will start printing a zig-zag line. Rotate the knob until you reach the optimal height. Check the pictures in the handbook (Calibration chapter).")); ////MSG_WIZARD_V2_CAL_2 c=20 r=12
|
|
|
}
|
|
|
|
|
|
//! @brief Printer first run wizard (Selftest and calibration)
|
|
@@ -5099,7 +5126,7 @@ void lcd_wizard(WizState state)
|
|
|
setTargetBed(PLA_PREHEAT_HPB_TEMP);
|
|
|
if (mmu_enabled)
|
|
|
{
|
|
|
- wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is any filament loaded?"), true);////c=20 r=2
|
|
|
+ wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is filament loaded?"), true);////c=20 r=2
|
|
|
} else
|
|
|
{
|
|
|
wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is filament loaded?"), true);////MSG_WIZARD_FILAMENT_LOADED c=20 r=2
|
|
@@ -5144,7 +5171,7 @@ void lcd_wizard(WizState state)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("If you have more steel sheets you can calibrate additional presets in Settings / HW Setup / Steel sheets."));
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("If you have additional steel sheets, calibrate their presets in Settings - HW Setup - Steel sheets."));
|
|
|
state = S::Finish;
|
|
|
}
|
|
|
break;
|
|
@@ -5219,29 +5246,29 @@ do\
|
|
|
if (fsensor_not_responding && (mmu_enabled == false))\
|
|
|
{\
|
|
|
/* Filament sensor not working*/\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Fil. sensor [N/A]"), lcd_fsensor_state_set);/*////MSG_FSENSOR_NA*/\
|
|
|
- MENU_ITEM_SUBMENU_P(_T(MSG_FSENS_AUTOLOAD_NA), lcd_fsensor_fail);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), _T(MSG_NA), lcd_fsensor_state_set);/*////MSG_FSENSOR_NA*/\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), NULL, lcd_fsensor_fail);\
|
|
|
}\
|
|
|
else\
|
|
|
{\
|
|
|
/* Filament sensor turned off, working, no problems*/\
|
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_OFF), lcd_fsensor_state_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), _T(MSG_OFF), lcd_fsensor_state_set);\
|
|
|
if (mmu_enabled == false)\
|
|
|
{\
|
|
|
- MENU_ITEM_SUBMENU_P(_T(MSG_FSENS_AUTOLOAD_NA), lcd_filament_autoload_info);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), NULL, lcd_filament_autoload_info);\
|
|
|
}\
|
|
|
}\
|
|
|
}\
|
|
|
else\
|
|
|
{\
|
|
|
/* Filament sensor turned on, working, no problems*/\
|
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_ON), lcd_fsensor_state_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), _T(MSG_ON), lcd_fsensor_state_set);\
|
|
|
if (mmu_enabled == false)\
|
|
|
{\
|
|
|
if (fsensor_autoload_enabled)\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("F. autoload [on]"), lcd_set_filament_autoload);/*////MSG_FSENS_AUTOLOAD_ON c=17 r=1*/\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_ON), lcd_set_filament_autoload);/*////MSG_FSENS_AUTOLOAD_ON c=17 r=1*/\
|
|
|
else\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("F. autoload [off]"), lcd_set_filament_autoload);/*////MSG_FSENS_AUTOLOAD_OFF c=17 r=1*/\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_OFF), lcd_set_filament_autoload);/*////MSG_FSENS_AUTOLOAD_OFF c=17 r=1*/\
|
|
|
/*if (fsensor_oq_meassure_enabled)*/\
|
|
|
/*MENU_ITEM_FUNCTION_P(_i("F. OQ meass. [on]"), lcd_set_filament_oq_meass);*//*////MSG_FSENS_OQMEASS_ON c=17 r=1*/\
|
|
|
/*else*/\
|
|
@@ -5261,60 +5288,58 @@ static void auto_deplete_switch()
|
|
|
eeprom_update_byte((unsigned char *)EEPROM_AUTO_DEPLETE, lcd_autoDeplete);
|
|
|
}
|
|
|
|
|
|
-static bool settingsAutoDeplete()
|
|
|
+static void settingsAutoDeplete()
|
|
|
{
|
|
|
if (mmu_enabled)
|
|
|
{
|
|
|
if (!fsensor_enabled)
|
|
|
{
|
|
|
- if (menu_item_text_P(_i("SpoolJoin [N/A]"))) return true;
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_AUTO_DEPLETE), _T(MSG_NA), NULL);
|
|
|
}
|
|
|
else if (lcd_autoDeplete)
|
|
|
{
|
|
|
- if (menu_item_function_P(_i("SpoolJoin [on]"), auto_deplete_switch)) return true;
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_AUTO_DEPLETE), _T(MSG_ON), auto_deplete_switch);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (menu_item_function_P(_i("SpoolJoin [off]"), auto_deplete_switch)) return true;
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_AUTO_DEPLETE), _T(MSG_OFF), auto_deplete_switch);
|
|
|
}
|
|
|
}
|
|
|
- return false;
|
|
|
}
|
|
|
|
|
|
#define SETTINGS_AUTO_DEPLETE \
|
|
|
do\
|
|
|
{\
|
|
|
- if(settingsAutoDeplete()) return;\
|
|
|
+ settingsAutoDeplete();\
|
|
|
}\
|
|
|
while(0)\
|
|
|
|
|
|
#ifdef MMU_HAS_CUTTER
|
|
|
-static bool settingsCutter()
|
|
|
+static void settingsCutter()
|
|
|
{
|
|
|
if (mmu_enabled)
|
|
|
{
|
|
|
if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED))
|
|
|
{
|
|
|
- if (menu_item_function_P(_i("Cutter [on]"), lcd_cutter_enabled)) return true;//// c=17 r=1
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled);
|
|
|
}
|
|
|
#ifdef MMU_ALWAYS_CUT
|
|
|
else if (EEPROM_MMU_CUTTER_ENABLED_always == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED))
|
|
|
{
|
|
|
- if (menu_item_function_P(_i("Cutter [always]"), lcd_cutter_enabled)) return true;//// c=17 r=1
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _i("Always"), lcd_cutter_enabled);
|
|
|
}
|
|
|
#endif
|
|
|
else
|
|
|
{
|
|
|
- if (menu_item_function_P(_i("Cutter [off]"), lcd_cutter_enabled)) return true;//// c=17 r=1
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_OFF), lcd_cutter_enabled);
|
|
|
}
|
|
|
}
|
|
|
- return false;
|
|
|
}
|
|
|
|
|
|
#define SETTINGS_CUTTER \
|
|
|
do\
|
|
|
{\
|
|
|
- if(settingsCutter()) return;\
|
|
|
+ settingsCutter();\
|
|
|
}\
|
|
|
while(0)
|
|
|
#else
|
|
@@ -5329,18 +5354,15 @@ do\
|
|
|
{\
|
|
|
if (SilentModeMenu == SILENT_MODE_NORMAL)\
|
|
|
{\
|
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_STEALTH_MODE_OFF), lcd_silent_mode_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_NORMAL), lcd_silent_mode_set);\
|
|
|
}\
|
|
|
- else MENU_ITEM_FUNCTION_P(_T(MSG_STEALTH_MODE_ON), lcd_silent_mode_set);\
|
|
|
+ else MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set);\
|
|
|
if (SilentModeMenu == SILENT_MODE_NORMAL)\
|
|
|
{\
|
|
|
- if (lcd_crash_detect_enabled())\
|
|
|
- {\
|
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_ON), crash_mode_switch);\
|
|
|
- }\
|
|
|
- else MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_OFF), crash_mode_switch);\
|
|
|
+ if (lcd_crash_detect_enabled()) MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), _T(MSG_ON), crash_mode_switch);\
|
|
|
+ else MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), _T(MSG_OFF), crash_mode_switch);\
|
|
|
}\
|
|
|
- else MENU_ITEM_SUBMENU_P(_T(MSG_CRASHDETECT_NA), lcd_crash_mode_info);\
|
|
|
+ else MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), NULL, lcd_crash_mode_info);\
|
|
|
}\
|
|
|
}\
|
|
|
while (0)
|
|
@@ -5354,16 +5376,16 @@ do\
|
|
|
switch (SilentModeMenu)\
|
|
|
{\
|
|
|
case SILENT_MODE_POWER:\
|
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_OFF), lcd_silent_mode_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_HIGH_POWER), lcd_silent_mode_set);\
|
|
|
break;\
|
|
|
case SILENT_MODE_SILENT:\
|
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_ON), lcd_silent_mode_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_SILENT), lcd_silent_mode_set);\
|
|
|
break;\
|
|
|
case SILENT_MODE_AUTO:\
|
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_AUTO_MODE_ON), lcd_silent_mode_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_AUTO_POWER), lcd_silent_mode_set);\
|
|
|
break;\
|
|
|
default:\
|
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_OFF), lcd_silent_mode_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_HIGH_POWER), lcd_silent_mode_set);\
|
|
|
break; /* (probably) not needed*/\
|
|
|
}\
|
|
|
}\
|
|
@@ -5377,8 +5399,8 @@ do\
|
|
|
{\
|
|
|
if (mmu_enabled)\
|
|
|
{\
|
|
|
- if (SilentModeMenu_MMU == 0) MENU_ITEM_FUNCTION_P(_i("MMU Mode [Normal]"), lcd_silent_mode_mmu_set); \
|
|
|
- else MENU_ITEM_FUNCTION_P(_i("MMU Mode[Stealth]"), lcd_silent_mode_mmu_set); \
|
|
|
+ if (SilentModeMenu_MMU == 0) MENU_ITEM_TOGGLE_P(_T(MSG_MMU_MODE), _T(MSG_NORMAL), lcd_silent_mode_mmu_set);\
|
|
|
+ else MENU_ITEM_TOGGLE_P(_T(MSG_MMU_MODE), _T(MSG_STEALTH), lcd_silent_mode_mmu_set);\
|
|
|
}\
|
|
|
}\
|
|
|
while (0)
|
|
@@ -5391,9 +5413,9 @@ while (0)
|
|
|
do\
|
|
|
{\
|
|
|
if (card.ToshibaFlashAir_isEnabled())\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("SD card [flshAir]"), lcd_toshiba_flash_air_compatibility_toggle);/*////MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON c=19 r=1*/\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY), lcd_toshiba_flash_air_compatibility_toggle);\
|
|
|
else\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("SD card [normal]"), lcd_toshiba_flash_air_compatibility_toggle);/*////MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF c=19 r=1*/\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle);\
|
|
|
\
|
|
|
if (!farm_mode)\
|
|
|
{\
|
|
@@ -5401,9 +5423,9 @@ do\
|
|
|
EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));\
|
|
|
switch (sdSort)\
|
|
|
{\
|
|
|
- case SD_SORT_TIME: MENU_ITEM_FUNCTION_P(_i("Sort [time]"), lcd_sort_type_set); break;/*////MSG_SORT_TIME c=17 r=1*/\
|
|
|
- case SD_SORT_ALPHA: MENU_ITEM_FUNCTION_P(_i("Sort [alphabet]"), lcd_sort_type_set); break;/*////MSG_SORT_ALPHA c=17 r=1*/\
|
|
|
- default: MENU_ITEM_FUNCTION_P(_i("Sort [none]"), lcd_sort_type_set);/*////MSG_SORT_NONE c=17 r=1*/\
|
|
|
+ case SD_SORT_TIME: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_SORT_TIME), lcd_sort_type_set); break;\
|
|
|
+ case SD_SORT_ALPHA: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_SORT_ALPHA), lcd_sort_type_set); break;\
|
|
|
+ default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set);\
|
|
|
}\
|
|
|
}\
|
|
|
}\
|
|
@@ -5413,9 +5435,9 @@ while (0)
|
|
|
do\
|
|
|
{\
|
|
|
if (card.ToshibaFlashAir_isEnabled())\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("SD card [flshAir]"), lcd_toshiba_flash_air_compatibility_toggle);/*////MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON c=19 r=1*/\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY), lcd_toshiba_flash_air_compatibility_toggle);\
|
|
|
else\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("SD card [normal]"), lcd_toshiba_flash_air_compatibility_toggle);/*////MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF c=19 r=1*/\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle);\
|
|
|
}\
|
|
|
while (0)
|
|
|
#endif // SDCARD_SORT_ALPHA
|
|
@@ -5447,22 +5469,22 @@ while (0)
|
|
|
do\
|
|
|
{\
|
|
|
switch(eSoundMode)\
|
|
|
- {\
|
|
|
- case e_SOUND_MODE_LOUD:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_LOUD),lcd_sound_state_set);\
|
|
|
- break;\
|
|
|
- case e_SOUND_MODE_ONCE:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_ONCE),lcd_sound_state_set);\
|
|
|
- break;\
|
|
|
- case e_SOUND_MODE_SILENT:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_SILENT),lcd_sound_state_set);\
|
|
|
- break;\
|
|
|
- case e_SOUND_MODE_BLIND:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_BLIND),lcd_sound_state_set);\
|
|
|
- break;\
|
|
|
- default:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_LOUD),lcd_sound_state_set);\
|
|
|
- }\
|
|
|
+ {\
|
|
|
+ case e_SOUND_MODE_LOUD:\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\
|
|
|
+ break;\
|
|
|
+ case e_SOUND_MODE_ONCE:\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_ONCE), lcd_sound_state_set);\
|
|
|
+ break;\
|
|
|
+ case e_SOUND_MODE_SILENT:\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SILENT), lcd_sound_state_set);\
|
|
|
+ break;\
|
|
|
+ case e_SOUND_MODE_BLIND:\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_BLIND), lcd_sound_state_set);\
|
|
|
+ break;\
|
|
|
+ default:\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\
|
|
|
+ }\
|
|
|
}\
|
|
|
while (0)
|
|
|
|
|
@@ -5492,16 +5514,16 @@ do\
|
|
|
switch(oCheckMode)\
|
|
|
{\
|
|
|
case ClCheckMode::_None:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Nozzle [none]"),lcd_check_mode_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_NOZZLE), _T(MSG_NONE), lcd_check_mode_set);\
|
|
|
break;\
|
|
|
case ClCheckMode::_Warn:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Nozzle [warn]"),lcd_check_mode_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_NOZZLE), _T(MSG_WARN), lcd_check_mode_set);\
|
|
|
break;\
|
|
|
case ClCheckMode::_Strict:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Nozzle [strict]"),lcd_check_mode_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_NOZZLE), _T(MSG_STRICT), lcd_check_mode_set);\
|
|
|
break;\
|
|
|
default:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Nozzle [none]"),lcd_check_mode_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_NOZZLE), _T(MSG_NONE), lcd_check_mode_set);\
|
|
|
}\
|
|
|
}\
|
|
|
while (0)
|
|
@@ -5535,20 +5557,15 @@ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,nDiameter);
|
|
|
#define SETTINGS_NOZZLE \
|
|
|
do\
|
|
|
{\
|
|
|
+ float fNozzleDiam;\
|
|
|
switch(oNozzleDiameter)\
|
|
|
- {\
|
|
|
- case ClNozzleDiameter::_Diameter_250:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Nozzle d. [0.25]"),lcd_nozzle_diameter_set);\
|
|
|
- break;\
|
|
|
- case ClNozzleDiameter::_Diameter_400:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Nozzle d. [0.40]"),lcd_nozzle_diameter_set);\
|
|
|
- break;\
|
|
|
- case ClNozzleDiameter::_Diameter_600:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Nozzle d. [0.60]"),lcd_nozzle_diameter_set);\
|
|
|
- break;\
|
|
|
- default:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Nozzle d. [0.40]"),lcd_nozzle_diameter_set);\
|
|
|
- }\
|
|
|
+ {\
|
|
|
+ case ClNozzleDiameter::_Diameter_250: fNozzleDiam = 0.25f; break;\
|
|
|
+ case ClNozzleDiameter::_Diameter_400: fNozzleDiam = 0.4f; break;\
|
|
|
+ case ClNozzleDiameter::_Diameter_600: fNozzleDiam = 0.6f; break;\
|
|
|
+ default: fNozzleDiam = 0.4f; break;\
|
|
|
+ }\
|
|
|
+ MENU_ITEM_TOGGLE(_T(MSG_NOZZLE_DIAMETER), ftostr12ns(fNozzleDiam), lcd_nozzle_diameter_set);\
|
|
|
}\
|
|
|
while (0)
|
|
|
|
|
@@ -5577,16 +5594,16 @@ do\
|
|
|
switch(oCheckModel)\
|
|
|
{\
|
|
|
case ClCheckModel::_None:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Model [none]"),lcd_check_model_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_MODEL), _T(MSG_NONE), lcd_check_model_set);\
|
|
|
break;\
|
|
|
case ClCheckModel::_Warn:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Model [warn]"),lcd_check_model_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_MODEL), _T(MSG_WARN), lcd_check_model_set);\
|
|
|
break;\
|
|
|
case ClCheckModel::_Strict:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Model [strict]"),lcd_check_model_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_MODEL), _T(MSG_STRICT), lcd_check_model_set);\
|
|
|
break;\
|
|
|
default:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Model [none]"),lcd_check_model_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_MODEL), _T(MSG_NONE), lcd_check_model_set);\
|
|
|
}\
|
|
|
}\
|
|
|
while (0)
|
|
@@ -5616,16 +5633,16 @@ do\
|
|
|
switch(oCheckVersion)\
|
|
|
{\
|
|
|
case ClCheckVersion::_None:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Firmware [none]"),lcd_check_version_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FIRMWARE), _T(MSG_NONE), lcd_check_version_set);\
|
|
|
break;\
|
|
|
case ClCheckVersion::_Warn:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Firmware [warn]"),lcd_check_version_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FIRMWARE), _T(MSG_WARN), lcd_check_version_set);\
|
|
|
break;\
|
|
|
case ClCheckVersion::_Strict:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Firmware [strict]"),lcd_check_version_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FIRMWARE), _T(MSG_STRICT), lcd_check_version_set);\
|
|
|
break;\
|
|
|
default:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Firmware [none]"),lcd_check_version_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FIRMWARE), _T(MSG_NONE), lcd_check_version_set);\
|
|
|
}\
|
|
|
}\
|
|
|
while (0)
|
|
@@ -5655,16 +5672,16 @@ do\
|
|
|
switch(oCheckGcode)\
|
|
|
{\
|
|
|
case ClCheckGcode::_None:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Gcode [none]"),lcd_check_gcode_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_GCODE), _T(MSG_NONE), lcd_check_gcode_set);\
|
|
|
break;\
|
|
|
case ClCheckGcode::_Warn:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Gcode [warn]"),lcd_check_gcode_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_GCODE), _T(MSG_WARN), lcd_check_gcode_set);\
|
|
|
break;\
|
|
|
case ClCheckGcode::_Strict:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Gcode [strict]"),lcd_check_gcode_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_GCODE), _T(MSG_STRICT), lcd_check_gcode_set);\
|
|
|
break;\
|
|
|
default:\
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Gcode [none]"),lcd_check_gcode_set);\
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_GCODE), _T(MSG_NONE), lcd_check_gcode_set);\
|
|
|
}\
|
|
|
}\
|
|
|
while (0)
|
|
@@ -5733,10 +5750,7 @@ static void lcd_settings_menu()
|
|
|
|
|
|
SETTINGS_CUTTER;
|
|
|
|
|
|
- if (fans_check_enabled == true)
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Fans check [on]"), lcd_set_fan_check);////MSG_FANS_CHECK_ON c=17 r=1
|
|
|
- else
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Fans check [off]"), lcd_set_fan_check);////MSG_FANS_CHECK_OFF c=17 r=1
|
|
|
+ MENU_ITEM_TOGGLE_P(_i("Fans check"), fans_check_enabled ? _T(MSG_ON) : _T(MSG_OFF), lcd_set_fan_check);
|
|
|
|
|
|
SETTINGS_SILENT_MODE;
|
|
|
|
|
@@ -5754,16 +5768,10 @@ static void lcd_settings_menu()
|
|
|
MENU_ITEM_SUBMENU_P(_i("Lin. correction"), lcd_settings_linearity_correction_menu);
|
|
|
#endif //LINEARITY_CORRECTION && TMC2130
|
|
|
|
|
|
- if (temp_cal_active == false)
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Temp. cal. [off]"), lcd_temp_calibration_set);////MSG_TEMP_CALIBRATION_OFF c=20 r=1
|
|
|
- else
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Temp. cal. [on]"), lcd_temp_calibration_set);////MSG_TEMP_CALIBRATION_ON c=20 r=1
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_TEMP_CALIBRATION), temp_cal_active ? _T(MSG_ON) : _T(MSG_OFF), lcd_temp_calibration_set);
|
|
|
|
|
|
#ifdef HAS_SECOND_SERIAL_PORT
|
|
|
- if (selectedSerialPort == 0)
|
|
|
- MENU_ITEM_FUNCTION_P(_i("RPi port [off]"), lcd_second_serial_set);////MSG_SECOND_SERIAL_OFF c=17 r=1
|
|
|
- else
|
|
|
- MENU_ITEM_FUNCTION_P(_i("RPi port [on]"), lcd_second_serial_set);////MSG_SECOND_SERIAL_ON c=17 r=1
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_RPI_PORT), (selectedSerialPort == 0) ? _T(MSG_OFF) : _T(MSG_ON), lcd_second_serial_set);
|
|
|
#endif //HAS_SECOND_SERIAL
|
|
|
|
|
|
if (!isPrintPaused && !homing_flag)
|
|
@@ -5831,6 +5839,9 @@ static void lcd_calibration_menu()
|
|
|
MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset);
|
|
|
}
|
|
|
MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), PSTR("G28 W"));
|
|
|
+#ifdef TMC2130
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Belt test "), lcd_belttest_v);////MSG_BELTTEST
|
|
|
+#endif //TMC2130
|
|
|
MENU_ITEM_FUNCTION_P(_i("Selftest "), lcd_selftest_v);////MSG_SELFTEST
|
|
|
#ifdef MK1BP
|
|
|
// MK1
|
|
@@ -6371,6 +6382,8 @@ void unload_filament()
|
|
|
custom_message_type = CustomMsg::FilamentLoading;
|
|
|
lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT));
|
|
|
|
|
|
+ raise_z_above(MIN_Z_FOR_UNLOAD);
|
|
|
+
|
|
|
// extr_unload2();
|
|
|
|
|
|
current_position[E_AXIS] -= 45;
|
|
@@ -7056,10 +7069,10 @@ static void lcd_tune_menu()
|
|
|
|
|
|
#ifdef FILAMENT_SENSOR
|
|
|
if (FSensorStateMenu == 0) {
|
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_OFF), lcd_fsensor_state_set);
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), _T(MSG_OFF), lcd_fsensor_state_set);
|
|
|
}
|
|
|
else {
|
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_ON), lcd_fsensor_state_set);
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), _T(MSG_ON), lcd_fsensor_state_set);
|
|
|
}
|
|
|
#endif //FILAMENT_SENSOR
|
|
|
|
|
@@ -7069,53 +7082,34 @@ static void lcd_tune_menu()
|
|
|
|
|
|
if(farm_mode)
|
|
|
{
|
|
|
- if (fans_check_enabled == true)
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Fans check [on]"), lcd_set_fan_check);////MSG_FANS_CHECK_ON c=17 r=1
|
|
|
- else
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Fans check [off]"), lcd_set_fan_check);////MSG_FANS_CHECK_OFF c=17 r=1
|
|
|
+ MENU_ITEM_TOGGLE_P(_i("Fans check"), fans_check_enabled ? _T(MSG_ON) : _T(MSG_OFF), lcd_set_fan_check);
|
|
|
}
|
|
|
|
|
|
#ifdef TMC2130
|
|
|
if(!farm_mode)
|
|
|
{
|
|
|
- if (SilentModeMenu == SILENT_MODE_NORMAL) MENU_ITEM_FUNCTION_P(_T(MSG_STEALTH_MODE_OFF), lcd_silent_mode_set);
|
|
|
- else MENU_ITEM_FUNCTION_P(_T(MSG_STEALTH_MODE_ON), lcd_silent_mode_set);
|
|
|
+ if (SilentModeMenu == SILENT_MODE_NORMAL) MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_NORMAL), lcd_silent_mode_set);
|
|
|
+ else MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set);
|
|
|
|
|
|
if (SilentModeMenu == SILENT_MODE_NORMAL)
|
|
|
{
|
|
|
- if (lcd_crash_detect_enabled()) MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_ON), crash_mode_switch);
|
|
|
- else MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_OFF), crash_mode_switch);
|
|
|
+ if (lcd_crash_detect_enabled()) MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), _T(MSG_ON), crash_mode_switch);
|
|
|
+ else MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), _T(MSG_OFF), crash_mode_switch);
|
|
|
}
|
|
|
- else MENU_ITEM_SUBMENU_P(_T(MSG_CRASHDETECT_NA), lcd_crash_mode_info);
|
|
|
+ else MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), NULL, lcd_crash_mode_info);
|
|
|
}
|
|
|
#else //TMC2130
|
|
|
if (!farm_mode) { //dont show in menu if we are in farm mode
|
|
|
switch (SilentModeMenu) {
|
|
|
- case SILENT_MODE_POWER: MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_OFF), lcd_silent_mode_set); break;
|
|
|
- case SILENT_MODE_SILENT: MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_ON), lcd_silent_mode_set); break;
|
|
|
- case SILENT_MODE_AUTO: MENU_ITEM_FUNCTION_P(_T(MSG_AUTO_MODE_ON), lcd_silent_mode_set); break;
|
|
|
- default: MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_OFF), lcd_silent_mode_set); break; // (probably) not needed
|
|
|
+ case SILENT_MODE_POWER: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_HIGH_POWER), lcd_silent_mode_set); break;
|
|
|
+ case SILENT_MODE_SILENT: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_SILENT), lcd_silent_mode_set); break;
|
|
|
+ case SILENT_MODE_AUTO: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_AUTO_POWER), lcd_silent_mode_set); break;
|
|
|
+ default: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_HIGH_POWER), lcd_silent_mode_set); break; // (probably) not needed
|
|
|
}
|
|
|
}
|
|
|
#endif //TMC2130
|
|
|
- SETTINGS_MMU_MODE;
|
|
|
- switch(eSoundMode)
|
|
|
- {
|
|
|
- case e_SOUND_MODE_LOUD:
|
|
|
- MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_LOUD),lcd_sound_state_set);
|
|
|
- break;
|
|
|
- case e_SOUND_MODE_ONCE:
|
|
|
- MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_ONCE),lcd_sound_state_set);
|
|
|
- break;
|
|
|
- case e_SOUND_MODE_SILENT:
|
|
|
- MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_SILENT),lcd_sound_state_set);
|
|
|
- break;
|
|
|
- case e_SOUND_MODE_BLIND:
|
|
|
- MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_BLIND),lcd_sound_state_set);
|
|
|
- break;
|
|
|
- default:
|
|
|
- MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_LOUD),lcd_sound_state_set);
|
|
|
- }
|
|
|
+ SETTINGS_MMU_MODE;
|
|
|
+ SETTINGS_SOUND;
|
|
|
#ifdef LCD_BL_PIN
|
|
|
if (backlightSupport)
|
|
|
{
|
|
@@ -7154,21 +7148,19 @@ static void lcd_mesh_bed_leveling_settings()
|
|
|
|
|
|
bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0);
|
|
|
uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR);
|
|
|
+ char sToggle[4]; //enough for nxn format
|
|
|
|
|
|
MENU_BEGIN();
|
|
|
- MENU_ITEM_BACK_P(_T(MSG_SETTINGS));
|
|
|
- if(points_nr == 3) MENU_ITEM_FUNCTION_P(_i("Mesh [3x3]"), mbl_mesh_toggle); ////MSG_MESH_3x3 c=18
|
|
|
- else MENU_ITEM_FUNCTION_P(_i("Mesh [7x7]"), mbl_mesh_toggle); ////MSG_MESH_7x7 c=18
|
|
|
- switch (mbl_z_probe_nr) {
|
|
|
- case 1: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [1]"), mbl_probe_nr_toggle); break; ////MSG_Z_PROBE_NR_1 c=18
|
|
|
- case 5: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [5]"), mbl_probe_nr_toggle); break; ////MSG_Z_PROBE_NR_1 c=18
|
|
|
- default: MENU_ITEM_FUNCTION_P(_i("Z-probe nr. [3]"), mbl_probe_nr_toggle); break; ////MSG_Z_PROBE_NR_1 c=18
|
|
|
- }
|
|
|
- if (points_nr == 7) {
|
|
|
- if (magnet_elimination) MENU_ITEM_FUNCTION_P(_i("Magnets comp. [On]"), mbl_magnets_elimination_toggle); ////MSG_MAGNETS_COMP_ON c=18
|
|
|
- else MENU_ITEM_FUNCTION_P(_i("Magnets comp.[Off]"), mbl_magnets_elimination_toggle); ////MSG_MAGNETS_COMP_OFF c=18
|
|
|
- }
|
|
|
- else menu_item_text_P(_i("Magnets comp.[N/A]")); ////MSG_MAGNETS_COMP_NA c=18
|
|
|
+ MENU_ITEM_BACK_P(_T(MSG_SETTINGS));
|
|
|
+ sToggle[0] = points_nr + '0';
|
|
|
+ sToggle[1] = 'x';
|
|
|
+ sToggle[2] = points_nr + '0';
|
|
|
+ sToggle[3] = 0;
|
|
|
+ MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle);
|
|
|
+ sToggle[0] = mbl_z_probe_nr + '0';
|
|
|
+ sToggle[1] = 0;
|
|
|
+ MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle);
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_MAGNETS_COMP), (points_nr == 7) ? (magnet_elimination ? _T(MSG_ON): _T(MSG_OFF)) : _T(MSG_NA), mbl_magnets_elimination_toggle);
|
|
|
MENU_END();
|
|
|
//SETTINGS_MBL_MODE;
|
|
|
}
|
|
@@ -7383,6 +7375,62 @@ void lcd_sdcard_menu()
|
|
|
}
|
|
|
MENU_END();
|
|
|
}
|
|
|
+#ifdef TMC2130
|
|
|
+static void lcd_belttest_v()
|
|
|
+{
|
|
|
+ lcd_belttest();
|
|
|
+ menu_back_if_clicked();
|
|
|
+}
|
|
|
+void lcd_belttest_print(const char* msg, uint16_t X, uint16_t Y)
|
|
|
+{
|
|
|
+ lcd_clear();
|
|
|
+ lcd_printf_P(
|
|
|
+ _N(
|
|
|
+ "%S:\n"
|
|
|
+ "%S\n"
|
|
|
+ "X:%d\n"
|
|
|
+ "Y:%d"
|
|
|
+ ),
|
|
|
+ _i("Belt status"),
|
|
|
+ msg,
|
|
|
+ X,Y
|
|
|
+ );
|
|
|
+}
|
|
|
+void lcd_belttest()
|
|
|
+{
|
|
|
+ int _progress = 0;
|
|
|
+ bool _result = true;
|
|
|
+ uint16_t X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X));
|
|
|
+ uint16_t Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y));
|
|
|
+ lcd_belttest_print(_i("Checking X..."), X, Y);
|
|
|
+
|
|
|
+ _delay(2000);
|
|
|
+ KEEPALIVE_STATE(IN_HANDLER);
|
|
|
+
|
|
|
+ _result = lcd_selfcheck_axis_sg(X_AXIS);
|
|
|
+ X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X));
|
|
|
+ if (!_result){
|
|
|
+ lcd_belttest_print(_i("Error"), X, Y);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ lcd_belttest_print(_i("Checking Y..."), X, Y);
|
|
|
+ _result = lcd_selfcheck_axis_sg(Y_AXIS);
|
|
|
+ Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y));
|
|
|
+
|
|
|
+ if (!_result){
|
|
|
+ lcd_belttest_print(_i("Error"), X, Y);
|
|
|
+ lcd_clear();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ lcd_belttest_print(_i("Done"), X, Y);
|
|
|
+
|
|
|
+ KEEPALIVE_STATE(NOT_BUSY);
|
|
|
+ _delay(3000);
|
|
|
+}
|
|
|
+#endif //TMC2130
|
|
|
|
|
|
static void lcd_selftest_v()
|
|
|
{
|