|
@@ -44,13 +44,16 @@
|
|
|
#include "mmu.h"
|
|
|
|
|
|
#include "static_assert.h"
|
|
|
-#include "io_atmega2560.h"
|
|
|
#include "first_lay_cal.h"
|
|
|
|
|
|
#include "fsensor.h"
|
|
|
#include "adc.h"
|
|
|
#include "config.h"
|
|
|
|
|
|
+#ifndef LA_NOCOMPAT
|
|
|
+#include "la10compat.h"
|
|
|
+#endif
|
|
|
+
|
|
|
|
|
|
int scrollstuff = 0;
|
|
|
char longFilenameOLD[LONG_FILENAME_LENGTH];
|
|
@@ -86,7 +89,6 @@ unsigned int custom_message_state = 0;
|
|
|
|
|
|
bool isPrintPaused = false;
|
|
|
uint8_t farm_mode = 0;
|
|
|
-int farm_no = 0;
|
|
|
int farm_timer = 8;
|
|
|
uint8_t farm_status = 0;
|
|
|
bool printer_connected = true;
|
|
@@ -134,7 +136,6 @@ static void prusa_stat_farm_number();
|
|
|
static void prusa_stat_diameter();
|
|
|
static void prusa_stat_temperatures();
|
|
|
static void prusa_stat_printinfo();
|
|
|
-static void lcd_farm_no();
|
|
|
static void lcd_menu_xyz_y_min();
|
|
|
static void lcd_menu_xyz_skew();
|
|
|
static void lcd_menu_xyz_offset();
|
|
@@ -168,10 +169,10 @@ static void reset_crash_det(unsigned char axis);
|
|
|
static bool lcd_selfcheck_axis_sg(unsigned char axis);
|
|
|
static bool lcd_selfcheck_axis(int _axis, int _travel);
|
|
|
#else
|
|
|
-static bool lcd_selfcheck_endstops();
|
|
|
static bool lcd_selfcheck_axis(int _axis, int _travel);
|
|
|
static bool lcd_selfcheck_pulleys(int axis);
|
|
|
#endif
|
|
|
+static bool lcd_selfcheck_endstops();
|
|
|
|
|
|
static bool lcd_selfcheck_check_heater(bool _isbed);
|
|
|
enum class TestScreen : uint_least8_t
|
|
@@ -338,11 +339,9 @@ static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char*
|
|
|
uint8_t n = LCD_WIDTH - 1;
|
|
|
|
|
|
for(uint_least8_t g = 0; g<4;g++){
|
|
|
- lcd_set_cursor(0, g);
|
|
|
- lcd_print(' ');
|
|
|
+ lcd_putc_at(0, g, ' ');
|
|
|
}
|
|
|
- lcd_set_cursor(0, row);
|
|
|
- lcd_print('>');
|
|
|
+ lcd_putc_at(0, row, '>');
|
|
|
|
|
|
if (longFilename[0] == '\0')
|
|
|
{
|
|
@@ -381,20 +380,17 @@ static void lcd_implementation_drawmenu_sdfile_selected(uint8_t row, const char*
|
|
|
}
|
|
|
}
|
|
|
if(c!='\0'){
|
|
|
- lcd_set_cursor(i, row);
|
|
|
- lcd_print(c);
|
|
|
+ lcd_putc_at(i, row, c);
|
|
|
i++;
|
|
|
}
|
|
|
n=n-i+1;
|
|
|
- while(n--)
|
|
|
- lcd_print(' ');
|
|
|
+ lcd_space(n);
|
|
|
}
|
|
|
static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* filename, char* longFilename)
|
|
|
{
|
|
|
char c;
|
|
|
uint8_t n = LCD_WIDTH - 1;
|
|
|
- lcd_set_cursor(0, row);
|
|
|
- lcd_print(' ');
|
|
|
+ lcd_putc_at(0, row, ' ');
|
|
|
if (longFilename[0] != '\0')
|
|
|
{
|
|
|
filename = longFilename;
|
|
@@ -406,15 +402,13 @@ static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* filename
|
|
|
filename++;
|
|
|
n--;
|
|
|
}
|
|
|
- while(n--)
|
|
|
- lcd_print(' ');
|
|
|
+ lcd_space(n);
|
|
|
}
|
|
|
static void lcd_implementation_drawmenu_sddirectory_selected(uint8_t row, const char* filename, char* longFilename)
|
|
|
{
|
|
|
char c;
|
|
|
uint8_t n = LCD_WIDTH - 2;
|
|
|
- lcd_set_cursor(0, row);
|
|
|
- lcd_print('>');
|
|
|
+ lcd_putc_at(0, row, '>');
|
|
|
lcd_print(LCD_STR_FOLDER[0]);
|
|
|
if (longFilename[0] != '\0')
|
|
|
{
|
|
@@ -427,15 +421,13 @@ static void lcd_implementation_drawmenu_sddirectory_selected(uint8_t row, const
|
|
|
filename++;
|
|
|
n--;
|
|
|
}
|
|
|
- while(n--)
|
|
|
- lcd_print(' ');
|
|
|
+ lcd_space(n);
|
|
|
}
|
|
|
static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* filename, char* longFilename)
|
|
|
{
|
|
|
char c;
|
|
|
uint8_t n = LCD_WIDTH - 2;
|
|
|
- lcd_set_cursor(0, row);
|
|
|
- lcd_print(' ');
|
|
|
+ lcd_putc_at(0, row, ' ');
|
|
|
lcd_print(LCD_STR_FOLDER[0]);
|
|
|
if (longFilename[0] != '\0')
|
|
|
{
|
|
@@ -448,8 +440,7 @@ static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* fil
|
|
|
filename++;
|
|
|
n--;
|
|
|
}
|
|
|
- while(n--)
|
|
|
- lcd_print(' ');
|
|
|
+ lcd_space(n);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -668,39 +659,7 @@ void lcdui_print_extruder(void)
|
|
|
|
|
|
void lcdui_print_farm(void)
|
|
|
{
|
|
|
- int chars = lcd_printf_P(_N(" F0 "));
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if (farm_mode)
|
|
|
- {
|
|
|
- lcd_set_cursor(6, 2);
|
|
|
- lcd_puts_P(PSTR(" F"));
|
|
|
- lcd_print(farm_no);
|
|
|
- lcd_puts_P(PSTR(" "));
|
|
|
-
|
|
|
-
|
|
|
- lcd_set_cursor(LCD_WIDTH - 1, 0);
|
|
|
- if ( (_millis() - kicktime) < 60000 ) {
|
|
|
-
|
|
|
- lcd_puts_P(PSTR("L"));
|
|
|
-
|
|
|
- }else{
|
|
|
- lcd_puts_P(PSTR(" "));
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- else {
|
|
|
-#ifdef SNMM
|
|
|
- lcd_puts_P(PSTR(" E"));
|
|
|
- lcd_print(get_ext_nr() + 1);
|
|
|
-
|
|
|
-#else
|
|
|
- lcd_set_cursor(LCD_WIDTH - 8 - 2, 2);
|
|
|
- lcd_puts_P(PSTR(" "));
|
|
|
-#endif
|
|
|
- }
|
|
|
-*/
|
|
|
+ lcd_printf_P(_N(" FRM "));
|
|
|
}
|
|
|
|
|
|
#ifdef CMD_DIAGNOSTICS
|
|
@@ -710,7 +669,7 @@ void lcdui_print_cmd_diag(void)
|
|
|
lcd_set_cursor(LCD_WIDTH - 8 -1, 2);
|
|
|
lcd_puts_P(PSTR(" C"));
|
|
|
lcd_print(buflen);
|
|
|
- if (buflen < 9) lcd_puts_P(" ");
|
|
|
+ if (buflen < 9) lcd_print(' ');
|
|
|
}
|
|
|
#endif
|
|
|
|
|
@@ -765,32 +724,27 @@ void lcdui_print_status_line(void)
|
|
|
heating_status_counter = 0;
|
|
|
}
|
|
|
lcd_set_cursor(7, 3);
|
|
|
- lcd_puts_P(PSTR(" "));
|
|
|
+ lcd_space(13);
|
|
|
|
|
|
for (unsigned int dots = 0; dots < heating_status_counter; dots++)
|
|
|
{
|
|
|
- lcd_set_cursor(7 + dots, 3);
|
|
|
- lcd_print('.');
|
|
|
+ lcd_putc_at(7 + dots, 3, '.');
|
|
|
}
|
|
|
switch (heating_status)
|
|
|
{
|
|
|
case 1:
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_T(MSG_HEATING));
|
|
|
+ lcd_puts_at_P(0, 3, _T(MSG_HEATING));
|
|
|
break;
|
|
|
case 2:
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_T(MSG_HEATING_COMPLETE));
|
|
|
+ lcd_puts_at_P(0, 3, _T(MSG_HEATING_COMPLETE));
|
|
|
heating_status = 0;
|
|
|
heating_status_counter = 0;
|
|
|
break;
|
|
|
case 3:
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_T(MSG_BED_HEATING));
|
|
|
+ lcd_puts_at_P(0, 3, _T(MSG_BED_HEATING));
|
|
|
break;
|
|
|
case 4:
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_T(MSG_BED_DONE));
|
|
|
+ lcd_puts_at_P(0, 3, _T(MSG_BED_DONE));
|
|
|
heating_status = 0;
|
|
|
heating_status_counter = 0;
|
|
|
break;
|
|
@@ -839,9 +793,8 @@ void lcdui_print_status_line(void)
|
|
|
if (custom_message_state > 10)
|
|
|
{
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(PSTR(" "));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_T(MSG_CALIBRATE_Z_AUTO));
|
|
|
+ lcd_space(20);
|
|
|
+ lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO));
|
|
|
lcd_puts_P(PSTR(" : "));
|
|
|
lcd_print(custom_message_state-10);
|
|
|
}
|
|
@@ -856,9 +809,8 @@ void lcdui_print_status_line(void)
|
|
|
if (custom_message_state > 3 && custom_message_state <= 10 )
|
|
|
{
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(PSTR(" "));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Calibration done"));
|
|
|
+ lcd_space(19);
|
|
|
+ lcd_puts_at_P(0, 3, _i("Calibration done"));
|
|
|
custom_message_state--;
|
|
|
}
|
|
|
}
|
|
@@ -888,8 +840,7 @@ void lcdui_print_status_line(void)
|
|
|
}
|
|
|
break;
|
|
|
case CustomMsg::TempCompPreheat:
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("PINDA Heating"));
|
|
|
+ lcd_puts_at_P(0, 3, _i("PINDA Heating"));
|
|
|
if (custom_message_state <= PINDA_HEAT_T)
|
|
|
{
|
|
|
lcd_puts_P(PSTR(": "));
|
|
@@ -997,6 +948,36 @@ void lcd_status_screen()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+#ifdef ULTIPANEL_FEEDMULTIPLY
|
|
|
+
|
|
|
+ if ((feedmultiply < 100 && (feedmultiply + int(lcd_encoder)) > 100) ||
|
|
|
+ (feedmultiply > 100 && (feedmultiply + int(lcd_encoder)) < 100))
|
|
|
+ {
|
|
|
+ lcd_encoder = 0;
|
|
|
+ feedmultiply = 100;
|
|
|
+ }
|
|
|
+ if (feedmultiply == 100 && int(lcd_encoder) > ENCODER_FEEDRATE_DEADZONE)
|
|
|
+ {
|
|
|
+ feedmultiply += int(lcd_encoder) - ENCODER_FEEDRATE_DEADZONE;
|
|
|
+ lcd_encoder = 0;
|
|
|
+ }
|
|
|
+ else if (feedmultiply == 100 && int(lcd_encoder) < -ENCODER_FEEDRATE_DEADZONE)
|
|
|
+ {
|
|
|
+ feedmultiply += int(lcd_encoder) + ENCODER_FEEDRATE_DEADZONE;
|
|
|
+ lcd_encoder = 0;
|
|
|
+ }
|
|
|
+ else if (feedmultiply != 100)
|
|
|
+ {
|
|
|
+ feedmultiply += int(lcd_encoder);
|
|
|
+ lcd_encoder = 0;
|
|
|
+ }
|
|
|
+#endif
|
|
|
+
|
|
|
+ if (feedmultiply < 10)
|
|
|
+ feedmultiply = 10;
|
|
|
+ else if (feedmultiply > 999)
|
|
|
+ feedmultiply = 999;
|
|
|
+
|
|
|
if (lcd_status_update_delay)
|
|
|
lcd_status_update_delay--;
|
|
|
else
|
|
@@ -1073,36 +1054,6 @@ void lcd_status_screen()
|
|
|
menu_submenu(lcd_main_menu);
|
|
|
lcd_refresh();
|
|
|
}
|
|
|
-
|
|
|
-#ifdef ULTIPANEL_FEEDMULTIPLY
|
|
|
-
|
|
|
- if ((feedmultiply < 100 && (feedmultiply + int(lcd_encoder)) > 100) ||
|
|
|
- (feedmultiply > 100 && (feedmultiply + int(lcd_encoder)) < 100))
|
|
|
- {
|
|
|
- lcd_encoder = 0;
|
|
|
- feedmultiply = 100;
|
|
|
- }
|
|
|
- if (feedmultiply == 100 && int(lcd_encoder) > ENCODER_FEEDRATE_DEADZONE)
|
|
|
- {
|
|
|
- feedmultiply += int(lcd_encoder) - ENCODER_FEEDRATE_DEADZONE;
|
|
|
- lcd_encoder = 0;
|
|
|
- }
|
|
|
- else if (feedmultiply == 100 && int(lcd_encoder) < -ENCODER_FEEDRATE_DEADZONE)
|
|
|
- {
|
|
|
- feedmultiply += int(lcd_encoder) + ENCODER_FEEDRATE_DEADZONE;
|
|
|
- lcd_encoder = 0;
|
|
|
- }
|
|
|
- else if (feedmultiply != 100)
|
|
|
- {
|
|
|
- feedmultiply += int(lcd_encoder);
|
|
|
- lcd_encoder = 0;
|
|
|
- }
|
|
|
-#endif
|
|
|
-
|
|
|
- if (feedmultiply < 10)
|
|
|
- feedmultiply = 10;
|
|
|
- else if (feedmultiply > 999)
|
|
|
- feedmultiply = 999;
|
|
|
}
|
|
|
|
|
|
void lcd_commands()
|
|
@@ -1483,7 +1434,6 @@ void lcd_commands()
|
|
|
|
|
|
if (lcd_commands_step == 1 && !blocks_queued())
|
|
|
{
|
|
|
- lcd_confirm_print();
|
|
|
lcd_commands_step = 0;
|
|
|
lcd_commands_type = LcdCommands::Idle;
|
|
|
}
|
|
@@ -1579,6 +1529,7 @@ void lcd_return_to_status()
|
|
|
|
|
|
void lcd_pause_print()
|
|
|
{
|
|
|
+ SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED);
|
|
|
stop_and_save_print_to_ram(0.0, -default_retraction);
|
|
|
lcd_return_to_status();
|
|
|
isPrintPaused = true;
|
|
@@ -1586,7 +1537,6 @@ void lcd_pause_print()
|
|
|
{
|
|
|
lcd_commands_type = LcdCommands::LongPause;
|
|
|
}
|
|
|
- SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_PAUSED);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1688,8 +1638,8 @@ void lcd_menu_extruder_info()
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1697,8 +1647,8 @@ static void lcd_menu_fails_stats_mmu()
|
|
|
{
|
|
|
MENU_BEGIN();
|
|
|
MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Last print"), lcd_menu_fails_stats_mmu_print);
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Total"), lcd_menu_fails_stats_mmu_total);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total);
|
|
|
MENU_END();
|
|
|
}
|
|
|
|
|
@@ -1706,9 +1656,9 @@ static void lcd_menu_fails_stats_mmu()
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1720,9 +1670,9 @@ static void lcd_menu_fails_stats_mmu_print()
|
|
|
uint16_t load_fails = eeprom_read_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL);
|
|
|
lcd_home();
|
|
|
lcd_printf_P(PSTR("%S\n" " %-16.16S%-3d\n" " %-16.16S%-3d"),
|
|
|
- _i("Last print failures"),
|
|
|
- _i("MMU fails"), fails,
|
|
|
- _i("MMU load fails"), load_fails);
|
|
|
+ _T(MSG_LAST_PRINT_FAILURES),
|
|
|
+ _T(MSG_MMU_FAILS), fails,
|
|
|
+ _T(MSG_MMU_LOAD_FAILS), load_fails);
|
|
|
menu_back_if_clicked_fb();
|
|
|
}
|
|
|
|
|
@@ -1730,9 +1680,9 @@ static void lcd_menu_fails_stats_mmu_print()
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1749,10 +1699,10 @@ static void lcd_menu_fails_stats_mmu_total()
|
|
|
if (mmu_power_fails > 999) mmu_power_fails = 999;
|
|
|
lcd_home();
|
|
|
lcd_printf_P(PSTR("%S\n" " %-16.16S%-3d\n" " %-16.16S%-3d\n" " %-16.16S%-3d"),
|
|
|
- _i("Total failures"),
|
|
|
- _i("MMU fails"), fails,
|
|
|
- _i("MMU load fails"), load_fails,
|
|
|
- _i("MMU power fails"), mmu_power_fails);
|
|
|
+ _T(MSG_TOTAL_FAILURES),
|
|
|
+ _T(MSG_MMU_FAILS), fails,
|
|
|
+ _T(MSG_MMU_LOAD_FAILS), load_fails,
|
|
|
+ _i("MMU power fails"), mmu_power_failures);
|
|
|
menu_back_if_clicked_fb();
|
|
|
}
|
|
|
|
|
@@ -1763,10 +1713,10 @@ static const char failStatsFmt[] PROGMEM = "%S\n" " %-16.16S%-3d\n" " %-16.16S%-
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1783,10 +1733,10 @@ static void lcd_menu_fails_stats_total()
|
|
|
if (crashY > 999) crashY = 999;
|
|
|
lcd_home();
|
|
|
lcd_printf_P(failStatsFmt,
|
|
|
- _i("Total failures"),
|
|
|
- _i("Power failures"), power,
|
|
|
- _i("Filam. runouts"), filam,
|
|
|
- _i("Crash"), crashX, crashY);
|
|
|
+ _T(MSG_TOTAL_FAILURES),
|
|
|
+ _T(MSG_POWER_FAILURES), power,
|
|
|
+ _T(MSG_FIL_RUNOUTS), filam,
|
|
|
+ _T(MSG_CRASH), crashX, crashY);
|
|
|
menu_back_if_clicked_fb();
|
|
|
}
|
|
|
|
|
@@ -1794,10 +1744,10 @@ static void lcd_menu_fails_stats_total()
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1822,20 +1772,20 @@ static void lcd_menu_fails_stats_print()
|
|
|
lcd_home();
|
|
|
#ifndef PAT9125
|
|
|
lcd_printf_P(failStatsFmt,
|
|
|
- _i("Last print failures"),
|
|
|
- _i("Power failures"), power,
|
|
|
- _i("Filam. runouts"), filam,
|
|
|
- _i("Crash"), crashX, crashY);
|
|
|
+ _T(MSG_LAST_PRINT_FAILURES),
|
|
|
+ _T(MSG_POWER_FAILURES), power,
|
|
|
+ _T(MSG_FIL_RUNOUTS), filam,
|
|
|
+ _T(MSG_CRASH), crashX, crashY);
|
|
|
#else
|
|
|
|
|
|
lcd_printf_P(PSTR("%S\n"
|
|
|
" %-16.16S%-3d\n"
|
|
|
" %-7.7S H %-3d S %-3d\n"
|
|
|
" %-7.7S X %-3d Y %-3d"),
|
|
|
- _i("Last print failures"),
|
|
|
- _i("Power failures"), power,
|
|
|
- _i("Runouts"), filam, fsensor_softfail,
|
|
|
- _i("Crash"), crashX, crashY);
|
|
|
+ _T(MSG_LAST_PRINT_FAILURES),
|
|
|
+ _T(MSG_POWER_FAILURES), power,
|
|
|
+ _i("Runouts"), filam, fsensor_softfail,
|
|
|
+ _T(MSG_CRASH), crashX, crashY);
|
|
|
#endif
|
|
|
menu_back_if_clicked_fb();
|
|
|
}
|
|
@@ -1849,8 +1799,8 @@ static void lcd_menu_fails_stats_print()
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1859,8 +1809,8 @@ static void lcd_menu_fails_stats()
|
|
|
{
|
|
|
MENU_BEGIN();
|
|
|
MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Last print"), lcd_menu_fails_stats_print);
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Total"), lcd_menu_fails_stats_total);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_print);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_total);
|
|
|
MENU_END();
|
|
|
}
|
|
|
|
|
@@ -1875,10 +1825,10 @@ static const char failStatsFmt[] PROGMEM = "%S\n" " %-16.16S%-3d\n" "%S\n" " %-1
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1890,10 +1840,10 @@ static void lcd_menu_fails_stats()
|
|
|
if (filamentTotal > 999) filamentTotal = 999;
|
|
|
lcd_home();
|
|
|
lcd_printf_P(failStatsFmt,
|
|
|
- _i("Last print failures"),
|
|
|
- _i("Filam. runouts"), filamentLast,
|
|
|
- _i("Total failures"),
|
|
|
- _i("Filam. runouts"), filamentTotal);
|
|
|
+ _T(MSG_LAST_PRINT_FAILURES),
|
|
|
+ _T(MSG_FIL_RUNOUTS), filamentLast,
|
|
|
+ _T(MSG_TOTAL_FAILURES),
|
|
|
+ _T(MSG_FIL_RUNOUTS), filamentTotal);
|
|
|
|
|
|
menu_back_if_clicked();
|
|
|
}
|
|
@@ -1972,7 +1922,7 @@ static void lcd_menu_temperatures()
|
|
|
lcd_menu_temperatures_line( _i("Ambient"), (int)current_temperature_ambient );
|
|
|
#endif
|
|
|
#ifdef PINDA_THERMISTOR
|
|
|
- lcd_menu_temperatures_line( _i("PINDA"), (int)current_temperature_pinda );
|
|
|
+ lcd_menu_temperatures_line( _i("PINDA"), (int)current_temperature_pinda );
|
|
|
#endif
|
|
|
menu_back_if_clicked();
|
|
|
}
|
|
@@ -2001,8 +1951,7 @@ static void lcd_menu_voltages()
|
|
|
lcd_home();
|
|
|
lcd_printf_P(PSTR(" PWR: %4.1fV\n" " BED: %4.1fV"), volt_pwr, volt_bed);
|
|
|
#ifdef IR_SENSOR_ANALOG
|
|
|
- float volt_IR = VOLT_DIV_REF * ((float)current_voltage_raw_IR / (1023 * OVERSAMPLENR));
|
|
|
- lcd_printf_P(PSTR("\n IR : %3.1fV"),volt_IR);
|
|
|
+ lcd_printf_P(PSTR("\n IR : %3.1fV"), Raw2Voltage(current_voltage_raw_IR));
|
|
|
#endif
|
|
|
menu_back_if_clicked();
|
|
|
}
|
|
@@ -2013,7 +1962,7 @@ static void lcd_menu_voltages()
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -2023,7 +1972,7 @@ static void lcd_menu_voltages()
|
|
|
static void lcd_menu_belt_status()
|
|
|
{
|
|
|
lcd_home();
|
|
|
- lcd_printf_P(PSTR("%S\n" " X %d\n" " Y %d"), _i("Belt status"), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)));
|
|
|
+ lcd_printf_P(PSTR("%S\n" " X %d\n" " Y %d"), _T(MSG_BELT_STATUS), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)), eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)));
|
|
|
menu_back_if_clicked();
|
|
|
}
|
|
|
#endif
|
|
@@ -2093,7 +2042,7 @@ static void lcd_preheat_menu()
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -2101,7 +2050,7 @@ static void lcd_preheat_menu()
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -2128,8 +2077,8 @@ static void lcd_support_menu()
|
|
|
{
|
|
|
int8_t status;
|
|
|
bool is_flash_air;
|
|
|
- uint8_t ip[4];
|
|
|
- char ip_str[3*4+3+1];
|
|
|
+ uint32_t ip;
|
|
|
+ char ip_str[IP4_STR_SIZE];
|
|
|
} _menu_data_t;
|
|
|
static_assert(sizeof(menu_data)>= sizeof(_menu_data_t),"_menu_data_t doesn't fit into menu_data");
|
|
|
_menu_data_t* _md = (_menu_data_t*)&(menu_data[0]);
|
|
@@ -2138,16 +2087,12 @@ static void lcd_support_menu()
|
|
|
|
|
|
|
|
|
_md->status = 1;
|
|
|
- _md->is_flash_air = card.ToshibaFlashAir_isEnabled() && card.ToshibaFlashAir_GetIP(_md->ip);
|
|
|
- if (_md->is_flash_air)
|
|
|
- sprintf_P(_md->ip_str, PSTR("%d.%d.%d.%d"),
|
|
|
- _md->ip[0], _md->ip[1],
|
|
|
- _md->ip[2], _md->ip[3]);
|
|
|
- } else if (_md->is_flash_air &&
|
|
|
- _md->ip[0] == 0 && _md->ip[1] == 0 &&
|
|
|
- _md->ip[2] == 0 && _md->ip[3] == 0 &&
|
|
|
- ++ _md->status == 16)
|
|
|
- {
|
|
|
+ _md->is_flash_air = card.ToshibaFlashAir_isEnabled();
|
|
|
+ if (_md->is_flash_air) {
|
|
|
+ card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip));
|
|
|
+ }
|
|
|
+ } else if (_md->is_flash_air && _md->ip == 0 && ++ _md->status == 16)
|
|
|
+ {
|
|
|
|
|
|
_md->status = 0;
|
|
|
}
|
|
@@ -2183,18 +2128,7 @@ static void lcd_support_menu()
|
|
|
#ifdef IR_SENSOR_ANALOG
|
|
|
MENU_ITEM_BACK_P(STR_SEPARATOR);
|
|
|
MENU_ITEM_BACK_P(PSTR("Fil. sensor v.:"));
|
|
|
- switch(oFsensorPCB)
|
|
|
- {
|
|
|
- case ClFsensorPCB::_Old:
|
|
|
- MENU_ITEM_BACK_P(PSTR(" 03 or older"));
|
|
|
- break;
|
|
|
- case ClFsensorPCB::_Rev03b:
|
|
|
- MENU_ITEM_BACK_P(PSTR(" 03b or newer"));
|
|
|
- break;
|
|
|
- case ClFsensorPCB::_Undef:
|
|
|
- default:
|
|
|
- MENU_ITEM_BACK_P(PSTR(" state unknown"));
|
|
|
- }
|
|
|
+ MENU_ITEM_BACK_P(FsensorIRVersionText());
|
|
|
#endif
|
|
|
|
|
|
MENU_ITEM_BACK_P(STR_SEPARATOR);
|
|
@@ -2219,17 +2153,35 @@ static void lcd_support_menu()
|
|
|
if (_md->is_flash_air) {
|
|
|
MENU_ITEM_BACK_P(STR_SEPARATOR);
|
|
|
MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:"));
|
|
|
-
|
|
|
+ MENU_ITEM_BACK_P(PSTR(" "));
|
|
|
+ if (((menu_item - 1) == menu_line) && lcd_draw_update) {
|
|
|
+ lcd_set_cursor(2, menu_row);
|
|
|
+ ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip));
|
|
|
+ lcd_printf_P(PSTR("%s"), _md->ip_str);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (IP_address) {
|
|
|
+
|
|
|
+ MENU_ITEM_BACK_P(STR_SEPARATOR);
|
|
|
+ MENU_ITEM_BACK_P(PSTR("Printer IP Addr:"));
|
|
|
+ MENU_ITEM_BACK_P(PSTR(" "));
|
|
|
+ if (((menu_item - 1) == menu_line) && lcd_draw_update) {
|
|
|
+ lcd_set_cursor(2, menu_row);
|
|
|
+ ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address));
|
|
|
+ lcd_printf_P(PSTR("%s"), _md->ip_str);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
#ifndef MK1BP
|
|
|
MENU_ITEM_BACK_P(STR_SEPARATOR);
|
|
|
- MENU_ITEM_SUBMENU_P(_i("XYZ cal. details"), lcd_menu_xyz_y_min);
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Extruder info"), lcd_menu_extruder_info);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("XYZ cal. details"), lcd_menu_xyz_y_min);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Extruder info"), lcd_menu_extruder_info);
|
|
|
MENU_ITEM_SUBMENU_P(_i("Sensor info"), lcd_menu_show_sensors_state);
|
|
|
|
|
|
#ifdef TMC2130
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Belt status"), lcd_menu_belt_status);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_BELT_STATUS), lcd_menu_belt_status);
|
|
|
#endif
|
|
|
|
|
|
MENU_ITEM_SUBMENU_P(_i("Temperatures"), lcd_menu_temperatures);
|
|
@@ -2238,6 +2190,7 @@ static void lcd_support_menu()
|
|
|
MENU_ITEM_SUBMENU_P(_i("Voltages"), lcd_menu_voltages);
|
|
|
#endif
|
|
|
|
|
|
+
|
|
|
#ifdef DEBUG_BUILD
|
|
|
MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);
|
|
|
#endif
|
|
@@ -2302,19 +2255,18 @@ uint8_t nLevel;
|
|
|
|
|
|
lcd_set_cursor(0,0);
|
|
|
lcdui_print_temp(LCD_STR_THERMOMETER[0],(int)degHotend(0),(int)degTargetHotend(0));
|
|
|
+lcd_puts_at_P(0,1, _i("Press the knob"));
|
|
|
lcd_set_cursor(0,2);
|
|
|
-lcd_puts_P(_i("Press the knob"));
|
|
|
-lcd_set_cursor(0,3);
|
|
|
switch(eFilamentAction)
|
|
|
{
|
|
|
case FilamentAction::Load:
|
|
|
case FilamentAction::AutoLoad:
|
|
|
case FilamentAction::MmuLoad:
|
|
|
- lcd_puts_P(_i("to load filament"));
|
|
|
+ lcd_puts_P(_i("to load filament"));
|
|
|
break;
|
|
|
case FilamentAction::UnLoad:
|
|
|
case FilamentAction::MmuUnLoad:
|
|
|
- lcd_puts_P(_i("to unload filament"));
|
|
|
+ lcd_puts_P(_i("to unload filament"));
|
|
|
break;
|
|
|
case FilamentAction::MmuEject:
|
|
|
case FilamentAction::MmuCut:
|
|
@@ -2439,7 +2391,7 @@ void mFilamentItem(uint16_t nTemp, uint16_t nTempBed)
|
|
|
case FilamentAction::None:
|
|
|
case FilamentAction::Preheat:
|
|
|
case FilamentAction::Lay1Cal:
|
|
|
-
|
|
|
+
|
|
|
break;
|
|
|
}
|
|
|
if (bFilamentWaitingFlag) Sound_MakeSound(e_SOUND_TYPE_StandardPrompt);
|
|
@@ -2447,34 +2399,44 @@ void mFilamentItem(uint16_t nTemp, uint16_t nTempBed)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- bFilamentWaitingFlag = true;
|
|
|
lcd_set_cursor(0, 0);
|
|
|
lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0));
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
- switch (eFilamentAction)
|
|
|
+
|
|
|
+ if (!bFilamentWaitingFlag)
|
|
|
{
|
|
|
- case FilamentAction::Load:
|
|
|
- case FilamentAction::AutoLoad:
|
|
|
- case FilamentAction::MmuLoad:
|
|
|
- lcd_puts_P(_i("Preheating to load"));
|
|
|
- break;
|
|
|
- case FilamentAction::UnLoad:
|
|
|
- case FilamentAction::MmuUnLoad:
|
|
|
- lcd_puts_P(_i("Preheating to unload"));
|
|
|
- break;
|
|
|
- case FilamentAction::MmuEject:
|
|
|
- lcd_puts_P(_i("Preheating to eject"));
|
|
|
- break;
|
|
|
- case FilamentAction::MmuCut:
|
|
|
- lcd_puts_P(_i("Preheating to cut"));
|
|
|
- break;
|
|
|
- case FilamentAction::None:
|
|
|
- case FilamentAction::Preheat:
|
|
|
- case FilamentAction::Lay1Cal:
|
|
|
- break;
|
|
|
+
|
|
|
+
|
|
|
+ bFilamentWaitingFlag = true;
|
|
|
+
|
|
|
+ lcd_set_cursor(0, 1);
|
|
|
+ switch (eFilamentAction)
|
|
|
+ {
|
|
|
+ case FilamentAction::Load:
|
|
|
+ case FilamentAction::AutoLoad:
|
|
|
+ case FilamentAction::MmuLoad:
|
|
|
+ lcd_puts_P(_i("Preheating to load"));
|
|
|
+ raise_z_above(MIN_Z_FOR_LOAD);
|
|
|
+ break;
|
|
|
+ case FilamentAction::UnLoad:
|
|
|
+ case FilamentAction::MmuUnLoad:
|
|
|
+ lcd_puts_P(_i("Preheating to unload"));
|
|
|
+ raise_z_above(MIN_Z_FOR_UNLOAD);
|
|
|
+ break;
|
|
|
+ case FilamentAction::MmuEject:
|
|
|
+ lcd_puts_P(_i("Preheating to eject"));
|
|
|
+ break;
|
|
|
+ case FilamentAction::MmuCut:
|
|
|
+ lcd_puts_P(_i("Preheating to cut"));
|
|
|
+ break;
|
|
|
+ case FilamentAction::None:
|
|
|
+ case FilamentAction::Preheat:
|
|
|
+ case FilamentAction::Lay1Cal:
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ lcd_puts_at_P(0, 3, _i(">Cancel"));
|
|
|
}
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i(">Cancel"));
|
|
|
+
|
|
|
if (lcd_clicked())
|
|
|
{
|
|
|
bFilamentWaitingFlag = false;
|
|
@@ -2524,6 +2486,12 @@ static void mFilamentItem_ASA()
|
|
|
mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP);
|
|
|
}
|
|
|
|
|
|
+static void mFilamentItem_PC()
|
|
|
+{
|
|
|
+ bFilamentPreheatState = false;
|
|
|
+ mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP);
|
|
|
+}
|
|
|
+
|
|
|
static void mFilamentItem_ABS()
|
|
|
{
|
|
|
bFilamentPreheatState = false;
|
|
@@ -2548,6 +2516,12 @@ static void mFilamentItem_FLEX()
|
|
|
mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP);
|
|
|
}
|
|
|
|
|
|
+static void mFilamentItem_PVB()
|
|
|
+{
|
|
|
+ bFilamentPreheatState = false;
|
|
|
+ mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP);
|
|
|
+}
|
|
|
+
|
|
|
void mFilamentBack()
|
|
|
{
|
|
|
menu_back();
|
|
@@ -2583,6 +2557,8 @@ void lcd_generic_preheat_menu()
|
|
|
MENU_ITEM_SUBMENU_P(PSTR("PLA - " STRINGIFY(PLA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PLA_PREHEAT_HPB_TEMP)),mFilamentItem_PLA);
|
|
|
MENU_ITEM_SUBMENU_P(PSTR("PET - " STRINGIFY(PET_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PET_PREHEAT_HPB_TEMP)),mFilamentItem_PET);
|
|
|
MENU_ITEM_SUBMENU_P(PSTR("ASA - " STRINGIFY(ASA_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ASA_PREHEAT_HPB_TEMP)),mFilamentItem_ASA);
|
|
|
+ MENU_ITEM_SUBMENU_P(PSTR("PC - " STRINGIFY(PC_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PC_PREHEAT_HPB_TEMP)),mFilamentItem_PC);
|
|
|
+ MENU_ITEM_SUBMENU_P(PSTR("PVB - " STRINGIFY(PVB_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PVB_PREHEAT_HPB_TEMP)),mFilamentItem_PVB);
|
|
|
MENU_ITEM_SUBMENU_P(PSTR("ABS - " STRINGIFY(ABS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(ABS_PREHEAT_HPB_TEMP)),mFilamentItem_ABS);
|
|
|
MENU_ITEM_SUBMENU_P(PSTR("HIPS - " STRINGIFY(HIPS_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(HIPS_PREHEAT_HPB_TEMP)),mFilamentItem_HIPS);
|
|
|
MENU_ITEM_SUBMENU_P(PSTR("PP - " STRINGIFY(PP_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(PP_PREHEAT_HPB_TEMP)),mFilamentItem_PP);
|
|
@@ -2622,8 +2598,7 @@ void lcd_wait_interact() {
|
|
|
lcd_puts_P(_i("Insert filament"));
|
|
|
#endif
|
|
|
if (!fsensor_autoload_enabled) {
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("and press the knob"));
|
|
|
+ lcd_puts_at_P(0, 2, _i("and press the knob"));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2632,9 +2607,7 @@ void lcd_change_success() {
|
|
|
|
|
|
lcd_clear();
|
|
|
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
-
|
|
|
- lcd_puts_P(_i("Change success!"));
|
|
|
+ lcd_puts_at_P(0, 2, _i("Change success!"));
|
|
|
|
|
|
|
|
|
}
|
|
@@ -2642,8 +2615,7 @@ void lcd_change_success() {
|
|
|
static void lcd_loading_progress_bar(uint16_t loading_time_ms) {
|
|
|
|
|
|
for (uint_least8_t i = 0; i < 20; i++) {
|
|
|
- lcd_set_cursor(i, 3);
|
|
|
- lcd_print(".");
|
|
|
+ lcd_putc_at(i, 3, '.');
|
|
|
|
|
|
for (uint_least8_t j = 0; j < 5; j++) {
|
|
|
delay_keep_alive(loading_time_ms / 100);
|
|
@@ -2657,11 +2629,8 @@ void lcd_loading_color() {
|
|
|
|
|
|
lcd_clear();
|
|
|
|
|
|
- lcd_set_cursor(0, 0);
|
|
|
-
|
|
|
- lcd_puts_P(_i("Loading color"));
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_T(MSG_PLEASE_WAIT));
|
|
|
+ lcd_puts_at_P(0, 0, _i("Loading color"));
|
|
|
+ lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT));
|
|
|
lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL);
|
|
|
}
|
|
|
|
|
@@ -2671,16 +2640,13 @@ void lcd_loading_filament() {
|
|
|
|
|
|
lcd_clear();
|
|
|
|
|
|
- lcd_set_cursor(0, 0);
|
|
|
-
|
|
|
- lcd_puts_P(_T(MSG_LOADING_FILAMENT));
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_T(MSG_PLEASE_WAIT));
|
|
|
+ lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT));
|
|
|
+ lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT));
|
|
|
#ifdef SNMM
|
|
|
for (int i = 0; i < 20; i++) {
|
|
|
|
|
|
lcd_set_cursor(i, 3);
|
|
|
- lcd_print(".");
|
|
|
+ lcd_print('.');
|
|
|
for (int j = 0; j < 10 ; j++) {
|
|
|
manage_heater();
|
|
|
manage_inactivity(true);
|
|
@@ -2709,26 +2675,11 @@ void lcd_alright() {
|
|
|
|
|
|
lcd_clear();
|
|
|
|
|
|
- lcd_set_cursor(0, 0);
|
|
|
-
|
|
|
- lcd_puts_P(_i("Changed correctly?"));
|
|
|
-
|
|
|
- lcd_set_cursor(1, 1);
|
|
|
-
|
|
|
- lcd_puts_P(_T(MSG_YES));
|
|
|
-
|
|
|
- lcd_set_cursor(1, 2);
|
|
|
-
|
|
|
- lcd_puts_P(_i("Filament not loaded"));
|
|
|
-
|
|
|
-
|
|
|
- lcd_set_cursor(1, 3);
|
|
|
- lcd_puts_P(_i("Color not correct"));
|
|
|
-
|
|
|
-
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
-
|
|
|
- lcd_print(">");
|
|
|
+ lcd_puts_at_P(0, 0, _i("Changed correctly?"));
|
|
|
+ lcd_puts_at_P(1, 1, _T(MSG_YES));
|
|
|
+ lcd_puts_at_P(1, 2, _i("Filament not loaded"));
|
|
|
+ lcd_puts_at_P(1, 3, _i("Color not correct"));
|
|
|
+ lcd_putc_at(0, 1, '>');
|
|
|
|
|
|
|
|
|
enc_dif = lcd_encoder_diff;
|
|
@@ -2758,14 +2709,8 @@ void lcd_alright() {
|
|
|
cursor_pos = 1;
|
|
|
Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
}
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, cursor_pos);
|
|
|
- lcd_print(">");
|
|
|
+ lcd_puts_at_P(0, 1, PSTR(" \n \n "));
|
|
|
+ lcd_putc_at(0, cursor_pos, '>');
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
_delay(100);
|
|
@@ -2794,10 +2739,8 @@ void lcd_alright() {
|
|
|
void show_preheat_nozzle_warning()
|
|
|
{
|
|
|
lcd_clear();
|
|
|
- lcd_set_cursor(0, 0);
|
|
|
- lcd_puts_P(_T(MSG_ERROR));
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_T(MSG_PREHEAT_NOZZLE));
|
|
|
+ lcd_puts_at_P(0, 0, _T(MSG_ERROR));
|
|
|
+ lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE));
|
|
|
_delay(2000);
|
|
|
lcd_clear();
|
|
|
}
|
|
@@ -2847,7 +2790,7 @@ static void lcd_LoadFilament()
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -2883,7 +2826,7 @@ void lcd_menu_statistics()
|
|
|
"%S:\n"
|
|
|
"%10ldh %02hhdm %02hhds"
|
|
|
),
|
|
|
- _i("Filament used"), _met,
|
|
|
+ _i("Filament used"), _met,
|
|
|
_i("Print time"), _h, _m, _s);
|
|
|
menu_back_if_clicked_fb();
|
|
|
}
|
|
@@ -2936,7 +2879,7 @@ static void _lcd_move(const char *name, int axis, int min, int max)
|
|
|
if (max_software_endstops && current_position[axis] > max) current_position[axis] = max;
|
|
|
lcd_encoder = 0;
|
|
|
world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]);
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[axis] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[axis] / 60);
|
|
|
lcd_draw_update = 1;
|
|
|
}
|
|
|
}
|
|
@@ -2950,7 +2893,7 @@ static void _lcd_move(const char *name, int axis, int min, int max)
|
|
|
}
|
|
|
|
|
|
|
|
|
-static void lcd_move_e()
|
|
|
+void lcd_move_e()
|
|
|
{
|
|
|
if (degHotend0() > EXTRUDE_MINTEMP)
|
|
|
{
|
|
@@ -2961,7 +2904,7 @@ static void lcd_move_e()
|
|
|
{
|
|
|
current_position[E_AXIS] += float((int)lcd_encoder) * move_menu_scale;
|
|
|
lcd_encoder = 0;
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60);
|
|
|
lcd_draw_update = 1;
|
|
|
}
|
|
|
}
|
|
@@ -3058,8 +3001,7 @@ static void lcd_menu_xyz_skew()
|
|
|
lcd_printf_P(_N("%3.2f\x01"), _deg(angleDiff));
|
|
|
}
|
|
|
else{
|
|
|
- lcd_set_cursor(15,0);
|
|
|
- lcd_puts_P(_T(MSG_NA));
|
|
|
+ lcd_puts_at_P(15,0, _T(MSG_NA));
|
|
|
}
|
|
|
if (lcd_clicked())
|
|
|
menu_goto(lcd_menu_xyz_offset, 0, true, true);
|
|
@@ -3077,8 +3019,7 @@ static void lcd_menu_xyz_skew()
|
|
|
|
|
|
static void lcd_menu_xyz_offset()
|
|
|
{
|
|
|
- lcd_set_cursor(0,0);
|
|
|
- lcd_puts_P(_i("[0;0] point offset"));
|
|
|
+ lcd_puts_at_P(0, 0, _i("[0;0] point offset"));
|
|
|
lcd_puts_at_P(0, 1, separator);
|
|
|
lcd_puts_at_P(0, 2, PSTR("X"));
|
|
|
lcd_puts_at_P(0, 3, PSTR("Y"));
|
|
@@ -3282,7 +3223,7 @@ void lcd_adjust_bed(void)
|
|
|
MENU_ITEM_EDIT_int3_P(_i("Right side[um]"), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX);
|
|
|
MENU_ITEM_EDIT_int3_P(_i("Front side[um]"), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX);
|
|
|
MENU_ITEM_EDIT_int3_P(_i("Rear side [um]"), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Reset"), lcd_adjust_bed_reset);
|
|
|
+ MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset);
|
|
|
MENU_END();
|
|
|
}
|
|
|
|
|
@@ -3299,8 +3240,7 @@ void lcd_adjust_bed(void)
|
|
|
void pid_extruder()
|
|
|
{
|
|
|
lcd_clear();
|
|
|
- lcd_set_cursor(1, 0);
|
|
|
- lcd_puts_P(_i("Set temperature:"));
|
|
|
+ lcd_puts_at_P(1, 0, _i("Set temperature:"));
|
|
|
pid_temp += int(lcd_encoder);
|
|
|
if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP;
|
|
|
if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP;
|
|
@@ -3335,7 +3275,7 @@ void lcd_adjust_z() {
|
|
|
|
|
|
lcd_set_cursor(0, 1);
|
|
|
|
|
|
- lcd_print(">");
|
|
|
+ lcd_print('>');
|
|
|
|
|
|
|
|
|
enc_dif = lcd_encoder_diff;
|
|
@@ -3364,11 +3304,11 @@ void lcd_adjust_z() {
|
|
|
cursor_pos = 1;
|
|
|
}
|
|
|
lcd_set_cursor(0, 1);
|
|
|
- lcd_print(" ");
|
|
|
+ lcd_print(' ');
|
|
|
lcd_set_cursor(0, 2);
|
|
|
- lcd_print(" ");
|
|
|
+ lcd_print(' ');
|
|
|
lcd_set_cursor(0, cursor_pos);
|
|
|
- lcd_print(">");
|
|
|
+ lcd_print('>');
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
_delay(100);
|
|
|
}
|
|
@@ -3414,7 +3354,7 @@ bool lcd_wait_for_pinda(float temp) {
|
|
|
lcd_set_cursor(0, 4);
|
|
|
lcd_print(LCD_STR_THERMOMETER[0]);
|
|
|
lcd_print(ftostr3(current_temperature_pinda));
|
|
|
- lcd_print("/");
|
|
|
+ lcd_print('/');
|
|
|
lcd_print(ftostr3(temp));
|
|
|
lcd_print(LCD_STR_DEGREE);
|
|
|
delay_keep_alive(1000);
|
|
@@ -3436,7 +3376,7 @@ void lcd_wait_for_heater() {
|
|
|
lcd_set_cursor(0, 4);
|
|
|
lcd_print(LCD_STR_THERMOMETER[0]);
|
|
|
lcd_print(ftostr3(degHotend(active_extruder)));
|
|
|
- lcd_print("/");
|
|
|
+ lcd_print('/');
|
|
|
lcd_print(ftostr3(degTargetHotend(active_extruder)));
|
|
|
lcd_print(LCD_STR_DEGREE);
|
|
|
}
|
|
@@ -3479,7 +3419,7 @@ bool lcd_calibrate_z_end_stop_manual(bool only_z)
|
|
|
{
|
|
|
|
|
|
current_position[Z_AXIS] = 0;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
|
|
|
|
|
|
for (;;) {
|
|
@@ -3501,7 +3441,7 @@ bool lcd_calibrate_z_end_stop_manual(bool only_z)
|
|
|
|
|
|
current_position[Z_AXIS] += fabs(lcd_encoder);
|
|
|
lcd_encoder = 0;
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60);
|
|
|
}
|
|
|
}
|
|
|
if (lcd_clicked()) {
|
|
@@ -3537,7 +3477,7 @@ calibrated:
|
|
|
else {
|
|
|
current_position[Z_AXIS] = Z_MAX_POS+4.f;
|
|
|
}
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
return true;
|
|
|
|
|
|
canceled:
|
|
@@ -3755,16 +3695,14 @@ int8_t lcd_show_multiscreen_message_two_choices_and_wait_P(const char *msg, bool
|
|
|
if (msg_next == NULL) {
|
|
|
lcd_set_cursor(0, 3);
|
|
|
if (enc_dif < lcd_encoder_diff && yes) {
|
|
|
- lcd_puts_P((PSTR(" ")));
|
|
|
- lcd_set_cursor(7, 3);
|
|
|
- lcd_puts_P((PSTR(">")));
|
|
|
+ lcd_print(' ');
|
|
|
+ lcd_putc_at(7, 3, '>');
|
|
|
yes = false;
|
|
|
Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
}
|
|
|
else if (enc_dif > lcd_encoder_diff && !yes) {
|
|
|
- lcd_puts_P((PSTR(">")));
|
|
|
- lcd_set_cursor(7, 3);
|
|
|
- lcd_puts_P((PSTR(" ")));
|
|
|
+ lcd_print('>');
|
|
|
+ lcd_putc_at(7, 3, ' ');
|
|
|
yes = true;
|
|
|
Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
}
|
|
@@ -3793,13 +3731,11 @@ int8_t lcd_show_multiscreen_message_two_choices_and_wait_P(const char *msg, bool
|
|
|
}
|
|
|
if (msg_next == NULL) {
|
|
|
lcd_set_cursor(0, 3);
|
|
|
- if (yes) lcd_puts_P(PSTR(">"));
|
|
|
- lcd_set_cursor(1, 3);
|
|
|
- lcd_puts_P(first_choice);
|
|
|
+ if (yes) lcd_print('>');
|
|
|
+ lcd_puts_at_P(1, 3, first_choice);
|
|
|
lcd_set_cursor(7, 3);
|
|
|
- if (!yes) lcd_puts_P(PSTR(">"));
|
|
|
- lcd_set_cursor(8, 3);
|
|
|
- lcd_puts_P(second_choice);
|
|
|
+ if (!yes) lcd_print('>');
|
|
|
+ lcd_puts_at_P(8, 3, second_choice);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -3817,17 +3753,13 @@ int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow
|
|
|
lcd_display_message_fullscreen_P(msg);
|
|
|
|
|
|
if (default_yes) {
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(PSTR(">"));
|
|
|
+ lcd_putc_at(0, 2, '>');
|
|
|
lcd_puts_P(_T(MSG_YES));
|
|
|
- lcd_set_cursor(1, 3);
|
|
|
- lcd_puts_P(_T(MSG_NO));
|
|
|
+ lcd_puts_at_P(1, 3, _T(MSG_NO));
|
|
|
}
|
|
|
else {
|
|
|
- lcd_set_cursor(1, 2);
|
|
|
- lcd_puts_P(_T(MSG_YES));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(PSTR(">"));
|
|
|
+ lcd_puts_at_P(1, 2, _T(MSG_YES));
|
|
|
+ lcd_putc_at(0, 3, '>');
|
|
|
lcd_puts_P(_T(MSG_NO));
|
|
|
}
|
|
|
int8_t retval = default_yes ? true : false;
|
|
@@ -3848,17 +3780,15 @@ int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow
|
|
|
if (abs(enc_dif - lcd_encoder_diff) > 4) {
|
|
|
lcd_set_cursor(0, 2);
|
|
|
if (enc_dif < lcd_encoder_diff && retval) {
|
|
|
- lcd_puts_P((PSTR(" ")));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P((PSTR(">")));
|
|
|
+ lcd_print(' ');
|
|
|
+ lcd_putc_at(0, 3, '>');
|
|
|
retval = 0;
|
|
|
Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
|
|
|
}
|
|
|
else if (enc_dif > lcd_encoder_diff && !retval) {
|
|
|
- lcd_puts_P((PSTR(">")));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P((PSTR(" ")));
|
|
|
+ lcd_print('>');
|
|
|
+ lcd_putc_at(0, 3, ' ');
|
|
|
retval = 1;
|
|
|
Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
}
|
|
@@ -3941,14 +3871,12 @@ void lcd_temp_cal_show_result(bool result) {
|
|
|
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 1);
|
|
|
SERIAL_ECHOLNPGM("Temperature calibration done. Continue with pressing the knob.");
|
|
|
lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CALIBRATION_DONE));
|
|
|
- temp_cal_active = true;
|
|
|
eeprom_update_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, 1);
|
|
|
}
|
|
|
else {
|
|
|
eeprom_update_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA, 0);
|
|
|
SERIAL_ECHOLNPGM("Temperature calibration failed. Continue with pressing the knob.");
|
|
|
lcd_show_fullscreen_message_and_wait_P(_i("Temperature calibration failed"));
|
|
|
- temp_cal_active = false;
|
|
|
eeprom_update_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, 0);
|
|
|
}
|
|
|
lcd_update_enable(true);
|
|
@@ -3956,14 +3884,10 @@ void lcd_temp_cal_show_result(bool result) {
|
|
|
}
|
|
|
|
|
|
static void lcd_show_end_stops() {
|
|
|
- lcd_set_cursor(0, 0);
|
|
|
- lcd_puts_P((PSTR("End stops diag")));
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
- lcd_puts_P((READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) ? (PSTR("X1")) : (PSTR("X0")));
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P((READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0")));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P((READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0")));
|
|
|
+ lcd_puts_at_P(0, 0, (PSTR("End stops diag")));
|
|
|
+ lcd_puts_at_P(0, 1, (READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) ? (PSTR("X1")) : (PSTR("X0")));
|
|
|
+ lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0")));
|
|
|
+ lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0")));
|
|
|
}
|
|
|
|
|
|
#ifndef TMC2130
|
|
@@ -4020,7 +3944,7 @@ static void lcd_show_sensors_state()
|
|
|
finda_state = mmu_finda;
|
|
|
}
|
|
|
if (ir_sensor_detected) {
|
|
|
- idler_state = !PIN_GET(IR_SENSOR_PIN);
|
|
|
+ idler_state = !READ(IR_SENSOR_PIN);
|
|
|
}
|
|
|
lcd_puts_at_P(0, 0, _i("Sensor state"));
|
|
|
lcd_puts_at_P(1, 1, _i("PINDA:"));
|
|
@@ -4048,14 +3972,14 @@ void lcd_menu_show_sensors_state()
|
|
|
}
|
|
|
|
|
|
void prusa_statistics_err(char c){
|
|
|
- SERIAL_ECHO("{[ERR:");
|
|
|
+ SERIAL_ECHOPGM("{[ERR:");
|
|
|
SERIAL_ECHO(c);
|
|
|
SERIAL_ECHO(']');
|
|
|
prusa_stat_farm_number();
|
|
|
}
|
|
|
|
|
|
static void prusa_statistics_case0(uint8_t statnr){
|
|
|
- SERIAL_ECHO("{");
|
|
|
+ SERIAL_ECHO('{');
|
|
|
prusa_stat_printerstatus(statnr);
|
|
|
prusa_stat_farm_number();
|
|
|
prusa_stat_printinfo();
|
|
@@ -4083,7 +4007,7 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- SERIAL_ECHO("{");
|
|
|
+ SERIAL_ECHO('{');
|
|
|
prusa_stat_printerstatus(1);
|
|
|
prusa_stat_farm_number();
|
|
|
prusa_stat_diameter();
|
|
@@ -4133,7 +4057,7 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
|
|
return;
|
|
|
break;
|
|
|
case 4:
|
|
|
- SERIAL_ECHO("{[RES:1][FIL:");
|
|
|
+ SERIAL_ECHOPGM("{[RES:1][FIL:");
|
|
|
MYSERIAL.print(int(_fil_nr));
|
|
|
SERIAL_ECHO(']');
|
|
|
prusa_stat_printerstatus(status_number);
|
|
@@ -4141,7 +4065,7 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
|
|
farm_timer = 2;
|
|
|
break;
|
|
|
case 5:
|
|
|
- SERIAL_ECHO("{[RES:0][FIL:");
|
|
|
+ SERIAL_ECHOPGM("{[RES:0][FIL:");
|
|
|
MYSERIAL.print(int(_fil_nr));
|
|
|
SERIAL_ECHO(']');
|
|
|
prusa_stat_printerstatus(status_number);
|
|
@@ -4149,22 +4073,21 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
|
|
farm_timer = 2;
|
|
|
break;
|
|
|
case 6:
|
|
|
- SERIAL_ECHO("{[PRN:8]");
|
|
|
+ SERIAL_ECHOPGM("{[PRN:8]");
|
|
|
prusa_stat_farm_number();
|
|
|
status_number = 8;
|
|
|
farm_timer = 2;
|
|
|
break;
|
|
|
case 7:
|
|
|
- SERIAL_ECHO("{[PRN:9]");
|
|
|
+ SERIAL_ECHOPGM("{[PRN:9]");
|
|
|
prusa_stat_farm_number();
|
|
|
status_number = 9;
|
|
|
farm_timer = 2;
|
|
|
break;
|
|
|
case 8:
|
|
|
- SERIAL_ECHO("{[PRN:0][PFN:");
|
|
|
+ SERIAL_ECHOPGM("{[PRN:0]");
|
|
|
+ prusa_stat_farm_number();
|
|
|
status_number = 0;
|
|
|
- SERIAL_ECHO(farm_no);
|
|
|
- SERIAL_ECHO(']');
|
|
|
farm_timer = 2;
|
|
|
break;
|
|
|
case 20:
|
|
@@ -4180,7 +4103,7 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
|
|
prusa_stat_printerstatus(status_number);
|
|
|
break;
|
|
|
case 22:
|
|
|
- SERIAL_ECHO("{[PRN:5]");
|
|
|
+ SERIAL_ECHOPGM("{[PRN:5]");
|
|
|
prusa_stat_farm_number();
|
|
|
status_number = 5;
|
|
|
break;
|
|
@@ -4199,12 +4122,9 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
|
|
break;
|
|
|
|
|
|
case 99:
|
|
|
- SERIAL_ECHO("{[PRN:99]");
|
|
|
+ SERIAL_ECHOPGM("{[PRN:99]");
|
|
|
prusa_stat_temperatures();
|
|
|
- SERIAL_ECHO("[PFN:");
|
|
|
- SERIAL_ECHO(farm_no);
|
|
|
- SERIAL_ECHO(']');
|
|
|
-
|
|
|
+ prusa_stat_farm_number();
|
|
|
break;
|
|
|
}
|
|
|
SERIAL_ECHOLN('}');
|
|
@@ -4213,47 +4133,45 @@ void prusa_statistics(int _message, uint8_t _fil_nr) {
|
|
|
|
|
|
static void prusa_stat_printerstatus(int _status)
|
|
|
{
|
|
|
- SERIAL_ECHO("[PRN:");
|
|
|
+ SERIAL_ECHOPGM("[PRN:");
|
|
|
SERIAL_ECHO(_status);
|
|
|
SERIAL_ECHO(']');
|
|
|
}
|
|
|
|
|
|
static void prusa_stat_farm_number() {
|
|
|
- SERIAL_ECHO("[PFN:");
|
|
|
- SERIAL_ECHO(farm_no);
|
|
|
- SERIAL_ECHO(']');
|
|
|
+ SERIAL_ECHOPGM("[PFN:0]");
|
|
|
}
|
|
|
|
|
|
static void prusa_stat_diameter() {
|
|
|
- SERIAL_ECHO("[DIA:");
|
|
|
+ SERIAL_ECHOPGM("[DIA:");
|
|
|
SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM));
|
|
|
SERIAL_ECHO(']');
|
|
|
}
|
|
|
|
|
|
static void prusa_stat_temperatures()
|
|
|
{
|
|
|
- SERIAL_ECHO("[ST0:");
|
|
|
+ SERIAL_ECHOPGM("[ST0:");
|
|
|
SERIAL_ECHO(target_temperature[0]);
|
|
|
- SERIAL_ECHO("][STB:");
|
|
|
+ SERIAL_ECHOPGM("][STB:");
|
|
|
SERIAL_ECHO(target_temperature_bed);
|
|
|
- SERIAL_ECHO("][AT0:");
|
|
|
+ SERIAL_ECHOPGM("][AT0:");
|
|
|
SERIAL_ECHO(current_temperature[0]);
|
|
|
- SERIAL_ECHO("][ATB:");
|
|
|
+ SERIAL_ECHOPGM("][ATB:");
|
|
|
SERIAL_ECHO(current_temperature_bed);
|
|
|
SERIAL_ECHO(']');
|
|
|
}
|
|
|
|
|
|
static void prusa_stat_printinfo()
|
|
|
{
|
|
|
- SERIAL_ECHO("[TFU:");
|
|
|
+ SERIAL_ECHOPGM("[TFU:");
|
|
|
SERIAL_ECHO(total_filament_used);
|
|
|
- SERIAL_ECHO("][PCD:");
|
|
|
+ SERIAL_ECHOPGM("][PCD:");
|
|
|
SERIAL_ECHO(itostr3(card.percentDone()));
|
|
|
- SERIAL_ECHO("][FEM:");
|
|
|
+ SERIAL_ECHOPGM("][FEM:");
|
|
|
SERIAL_ECHO(itostr3(feedmultiply));
|
|
|
- SERIAL_ECHO("][FNM:");
|
|
|
+ SERIAL_ECHOPGM("][FNM:");
|
|
|
SERIAL_ECHO(longFilenameOLD);
|
|
|
- SERIAL_ECHO("][TIM:");
|
|
|
+ SERIAL_ECHOPGM("][TIM:");
|
|
|
if (starttime != 0)
|
|
|
{
|
|
|
SERIAL_ECHO(_millis() / 1000 - starttime / 1000);
|
|
@@ -4262,8 +4180,8 @@ static void prusa_stat_printinfo()
|
|
|
{
|
|
|
SERIAL_ECHO(0);
|
|
|
}
|
|
|
- SERIAL_ECHO("][FWR:");
|
|
|
- SERIAL_ECHO(FW_VERSION);
|
|
|
+ SERIAL_ECHOPGM("][FWR:");
|
|
|
+ SERIAL_ECHORPGM(FW_VERSION_STR_P());
|
|
|
SERIAL_ECHO(']');
|
|
|
prusa_stat_diameter();
|
|
|
}
|
|
@@ -4286,23 +4204,23 @@ void lcd_pick_babystep(){
|
|
|
|
|
|
lcd_set_cursor(3, 2);
|
|
|
|
|
|
- lcd_print("1");
|
|
|
+ lcd_print('1');
|
|
|
|
|
|
lcd_set_cursor(3, 3);
|
|
|
|
|
|
- lcd_print("2");
|
|
|
+ lcd_print('2');
|
|
|
|
|
|
lcd_set_cursor(12, 2);
|
|
|
|
|
|
- lcd_print("3");
|
|
|
+ lcd_print('3');
|
|
|
|
|
|
lcd_set_cursor(12, 3);
|
|
|
|
|
|
- lcd_print("4");
|
|
|
+ lcd_print('4');
|
|
|
|
|
|
lcd_set_cursor(1, 2);
|
|
|
|
|
|
- lcd_print(">");
|
|
|
+ lcd_print('>');
|
|
|
|
|
|
|
|
|
enc_dif = lcd_encoder_diff;
|
|
@@ -4333,20 +4251,20 @@ void lcd_pick_babystep(){
|
|
|
|
|
|
|
|
|
lcd_set_cursor(1, 2);
|
|
|
- lcd_print(" ");
|
|
|
+ lcd_print(' ');
|
|
|
lcd_set_cursor(1, 3);
|
|
|
- lcd_print(" ");
|
|
|
+ lcd_print(' ');
|
|
|
lcd_set_cursor(10, 2);
|
|
|
- lcd_print(" ");
|
|
|
+ lcd_print(' ');
|
|
|
lcd_set_cursor(10, 3);
|
|
|
- lcd_print(" ");
|
|
|
+ lcd_print(' ');
|
|
|
|
|
|
if (cursor_pos < 3) {
|
|
|
lcd_set_cursor(1, cursor_pos+1);
|
|
|
- lcd_print(">");
|
|
|
+ lcd_print('>');
|
|
|
}else{
|
|
|
lcd_set_cursor(10, cursor_pos-1);
|
|
|
- lcd_print(">");
|
|
|
+ lcd_print('>');
|
|
|
}
|
|
|
|
|
|
|
|
@@ -4378,7 +4296,7 @@ void lcd_move_menu_axis()
|
|
|
MENU_ITEM_SUBMENU_P(_i("Move X"), lcd_move_x);
|
|
|
MENU_ITEM_SUBMENU_P(_i("Move Y"), lcd_move_y);
|
|
|
MENU_ITEM_SUBMENU_P(_i("Move Z"), lcd_move_z);
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Extruder"), lcd_move_e);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e);
|
|
|
MENU_END();
|
|
|
}
|
|
|
|
|
@@ -4656,9 +4574,9 @@ void lcd_pinda_calibration_menu()
|
|
|
}
|
|
|
|
|
|
void lcd_temp_calibration_set() {
|
|
|
+ bool temp_cal_active = eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE);
|
|
|
temp_cal_active = !temp_cal_active;
|
|
|
eeprom_update_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE, temp_cal_active);
|
|
|
- st_current_init();
|
|
|
}
|
|
|
|
|
|
#ifdef HAS_SECOND_SERIAL_PORT
|
|
@@ -4849,7 +4767,7 @@ void lcd_v2_calibration()
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- loaded = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is filament loaded?"), false, true);
|
|
|
+ loaded = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), false, true);
|
|
|
lcd_update_enabled = true;
|
|
|
|
|
|
}
|
|
@@ -4916,7 +4834,7 @@ void lcd_language()
|
|
|
static void wait_preheat()
|
|
|
{
|
|
|
current_position[Z_AXIS] = 100;
|
|
|
- plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60);
|
|
|
delay_keep_alive(2000);
|
|
|
lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING));
|
|
|
lcd_set_custom_characters();
|
|
@@ -5102,10 +5020,10 @@ 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 filament loaded?"), true);
|
|
|
+ wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), true);
|
|
|
} else
|
|
|
{
|
|
|
- wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is filament loaded?"), true);
|
|
|
+ wizard_event = lcd_show_fullscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), true);
|
|
|
}
|
|
|
if (wizard_event) state = S::Lay1CalCold;
|
|
|
else
|
|
@@ -5204,11 +5122,11 @@ void lcd_settings_linearity_correction_menu(void)
|
|
|
#ifdef TMC2130_LINEARITY_CORRECTION_XYZ
|
|
|
|
|
|
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("X-correct:"), &tmc2130_wave_fac[X_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("Y-correct:"), &tmc2130_wave_fac[Y_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("Z-correct:"), &tmc2130_wave_fac[Z_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("X-correct:"), &tmc2130_wave_fac[X_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("Y-correct:"), &tmc2130_wave_fac[Y_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("Z-correct:"), &tmc2130_wave_fac[Z_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);
|
|
|
#endif
|
|
|
- MENU_ITEM_EDIT_int3_P(_i("E-correct:"), &tmc2130_wave_fac[E_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);
|
|
|
+ MENU_ITEM_EDIT_int3_P(_i("E-correct:"), &tmc2130_wave_fac[E_AXIS], TMC2130_WAVE_FAC1000_MIN-TMC2130_WAVE_FAC1000_STP, TMC2130_WAVE_FAC1000_MAX);
|
|
|
MENU_END();
|
|
|
}
|
|
|
#endif
|
|
@@ -5393,16 +5311,13 @@ do\
|
|
|
else\
|
|
|
MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle);\
|
|
|
\
|
|
|
- if (!farm_mode)\
|
|
|
+ uint8_t sdSort;\
|
|
|
+ EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));\
|
|
|
+ switch (sdSort)\
|
|
|
{\
|
|
|
- uint8_t sdSort;\
|
|
|
- EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));\
|
|
|
- switch (sdSort)\
|
|
|
- {\
|
|
|
- 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);\
|
|
|
- }\
|
|
|
+ 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);\
|
|
|
}\
|
|
|
}\
|
|
|
while (0)
|
|
@@ -5504,30 +5419,31 @@ do\
|
|
|
}\
|
|
|
while (0)
|
|
|
|
|
|
-static void lcd_nozzle_diameter_set(void)
|
|
|
-{
|
|
|
-uint16_t nDiameter;
|
|
|
-
|
|
|
-switch(oNozzleDiameter)
|
|
|
- {
|
|
|
- case ClNozzleDiameter::_Diameter_250:
|
|
|
- oNozzleDiameter=ClNozzleDiameter::_Diameter_400;
|
|
|
- nDiameter=400;
|
|
|
- break;
|
|
|
- case ClNozzleDiameter::_Diameter_400:
|
|
|
- oNozzleDiameter=ClNozzleDiameter::_Diameter_600;
|
|
|
- nDiameter=600;
|
|
|
- break;
|
|
|
- case ClNozzleDiameter::_Diameter_600:
|
|
|
- oNozzleDiameter=ClNozzleDiameter::_Diameter_250;
|
|
|
- nDiameter=250;
|
|
|
- break;
|
|
|
- default:
|
|
|
- oNozzleDiameter=ClNozzleDiameter::_Diameter_400;
|
|
|
- nDiameter=400;
|
|
|
- }
|
|
|
-eeprom_update_byte((uint8_t*)EEPROM_NOZZLE_DIAMETER,(uint8_t)oNozzleDiameter);
|
|
|
-eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,nDiameter);
|
|
|
+static void lcd_nozzle_diameter_cycle(void) {
|
|
|
+ uint16_t nDiameter;
|
|
|
+ switch(oNozzleDiameter){
|
|
|
+ case ClNozzleDiameter::_Diameter_250:
|
|
|
+ oNozzleDiameter=ClNozzleDiameter::_Diameter_400;
|
|
|
+ nDiameter=400;
|
|
|
+ break;
|
|
|
+ case ClNozzleDiameter::_Diameter_400:
|
|
|
+ oNozzleDiameter=ClNozzleDiameter::_Diameter_600;
|
|
|
+ nDiameter=600;
|
|
|
+ break;
|
|
|
+ case ClNozzleDiameter::_Diameter_600:
|
|
|
+ oNozzleDiameter=ClNozzleDiameter::_Diameter_800;
|
|
|
+ nDiameter=800;
|
|
|
+ break;
|
|
|
+ case ClNozzleDiameter::_Diameter_800:
|
|
|
+ oNozzleDiameter=ClNozzleDiameter::_Diameter_250;
|
|
|
+ nDiameter=250;
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ oNozzleDiameter=ClNozzleDiameter::_Diameter_400;
|
|
|
+ nDiameter=400;
|
|
|
+ }
|
|
|
+ eeprom_update_byte((uint8_t*)EEPROM_NOZZLE_DIAMETER,(uint8_t)oNozzleDiameter);
|
|
|
+ eeprom_update_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM,nDiameter);
|
|
|
}
|
|
|
|
|
|
#define SETTINGS_NOZZLE \
|
|
@@ -5539,9 +5455,10 @@ do\
|
|
|
case ClNozzleDiameter::_Diameter_250: fNozzleDiam = 0.25f; break;\
|
|
|
case ClNozzleDiameter::_Diameter_400: fNozzleDiam = 0.4f; break;\
|
|
|
case ClNozzleDiameter::_Diameter_600: fNozzleDiam = 0.6f; break;\
|
|
|
+ case ClNozzleDiameter::_Diameter_800: fNozzleDiam = 0.8f; break;\
|
|
|
default: fNozzleDiam = 0.4f; break;\
|
|
|
}\
|
|
|
- MENU_ITEM_TOGGLE(_T(MSG_NOZZLE_DIAMETER), ftostr12ns(fNozzleDiam), lcd_nozzle_diameter_set);\
|
|
|
+ MENU_ITEM_TOGGLE(_T(MSG_NOZZLE_DIAMETER), ftostr12ns(fNozzleDiam), lcd_nozzle_diameter_cycle);\
|
|
|
}\
|
|
|
while (0)
|
|
|
|
|
@@ -5623,6 +5540,7 @@ do\
|
|
|
}\
|
|
|
while (0)
|
|
|
|
|
|
+#if 0
|
|
|
static void lcd_check_gcode_set(void)
|
|
|
{
|
|
|
switch(oCheckGcode)
|
|
@@ -5641,6 +5559,7 @@ switch(oCheckGcode)
|
|
|
}
|
|
|
eeprom_update_byte((uint8_t*)EEPROM_CHECK_GCODE,(uint8_t)oCheckGcode);
|
|
|
}
|
|
|
+#endif
|
|
|
|
|
|
#define SETTINGS_GCODE \
|
|
|
do\
|
|
@@ -5719,7 +5638,7 @@ static void select_sheet_menu()
|
|
|
static void sheets_menu()
|
|
|
{
|
|
|
MENU_BEGIN();
|
|
|
- MENU_ITEM_BACK_P(_i("HW Setup"));
|
|
|
+ MENU_ITEM_BACK_P(_T(MSG_HW_SETUP));
|
|
|
MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>);
|
|
|
MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>);
|
|
|
MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>);
|
|
@@ -5733,17 +5652,54 @@ static void sheets_menu()
|
|
|
|
|
|
void lcd_hw_setup_menu(void)
|
|
|
{
|
|
|
+ typedef struct
|
|
|
+ {
|
|
|
+ int8_t status;
|
|
|
+ uint8_t experimental_menu_visibility;
|
|
|
+ } _menu_data_t;
|
|
|
+ static_assert(sizeof(menu_data)>= sizeof(_menu_data_t),"_menu_data_t doesn't fit into menu_data");
|
|
|
+ _menu_data_t* _md = (_menu_data_t*)&(menu_data[0]);
|
|
|
+
|
|
|
+ if (_md->status == 0 || lcd_draw_update)
|
|
|
+ {
|
|
|
+ _md->status = 1;
|
|
|
+ _md->experimental_menu_visibility = eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY);
|
|
|
+ if (_md->experimental_menu_visibility == EEPROM_EMPTY_VALUE)
|
|
|
+ {
|
|
|
+ _md->experimental_menu_visibility = 0;
|
|
|
+ eeprom_update_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, _md->experimental_menu_visibility);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
MENU_BEGIN();
|
|
|
MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK));
|
|
|
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Steel sheets"), sheets_menu);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu);
|
|
|
SETTINGS_NOZZLE;
|
|
|
MENU_ITEM_SUBMENU_P(_i("Checks"), lcd_checking_menu);
|
|
|
|
|
|
#ifdef IR_SENSOR_ANALOG
|
|
|
FSENSOR_ACTION_NA;
|
|
|
- MENU_ITEM_FUNCTION_P(PSTR("Fsensor Detection"), lcd_detect_IRsensor);
|
|
|
+
|
|
|
+
|
|
|
+ if(!mmu_enabled) MENU_ITEM_FUNCTION_P(PSTR("Fsensor Detection"), lcd_detect_IRsensor);
|
|
|
#endif
|
|
|
+
|
|
|
+ if (_md->experimental_menu_visibility)
|
|
|
+ {
|
|
|
+ MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);
|
|
|
+ }
|
|
|
+
|
|
|
+#ifdef PINDA_TEMP_COMP
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ MENU_ITEM_TOGGLE_P(_N("SuperPINDA"), eeprom_read_byte((uint8_t *)EEPROM_PINDA_TEMP_COMPENSATION) ? _T(MSG_YES) : _T(MSG_NO), lcd_pinda_temp_compensation_toggle);
|
|
|
+#endif
|
|
|
+
|
|
|
MENU_END();
|
|
|
}
|
|
|
|
|
@@ -5765,25 +5721,27 @@ static void lcd_settings_menu()
|
|
|
|
|
|
SETTINGS_CUTTER;
|
|
|
|
|
|
- MENU_ITEM_TOGGLE_P(_i("Fans check"), fans_check_enabled ? _T(MSG_ON) : _T(MSG_OFF), lcd_set_fan_check);
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FANS_CHECK), fans_check_enabled ? _T(MSG_ON) : _T(MSG_OFF), lcd_set_fan_check);
|
|
|
|
|
|
SETTINGS_SILENT_MODE;
|
|
|
|
|
|
if(!farm_mode)
|
|
|
{
|
|
|
bSettings=true;
|
|
|
- MENU_ITEM_SUBMENU_P(_i("HW Setup"), lcd_hw_setup_menu);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu);
|
|
|
}
|
|
|
|
|
|
SETTINGS_MMU_MODE;
|
|
|
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Mesh bed leveling"), lcd_mesh_bed_leveling_settings);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bed_leveling_settings);
|
|
|
|
|
|
#if defined (TMC2130) && defined (LINEARITY_CORRECTION)
|
|
|
MENU_ITEM_SUBMENU_P(_i("Lin. correction"), lcd_settings_linearity_correction_menu);
|
|
|
#endif
|
|
|
-
|
|
|
- MENU_ITEM_TOGGLE_P(_T(MSG_TEMP_CALIBRATION), temp_cal_active ? _T(MSG_ON) : _T(MSG_OFF), lcd_temp_calibration_set);
|
|
|
+ if(has_temperature_compensation())
|
|
|
+ {
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_TEMP_CALIBRATION), eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE) ? _T(MSG_ON) : _T(MSG_OFF), lcd_temp_calibration_set);
|
|
|
+ }
|
|
|
|
|
|
#ifdef HAS_SECOND_SERIAL_PORT
|
|
|
MENU_ITEM_TOGGLE_P(_T(MSG_RPI_PORT), (selectedSerialPort == 0) ? _T(MSG_OFF) : _T(MSG_ON), lcd_second_serial_set);
|
|
@@ -5808,7 +5766,6 @@ static void lcd_settings_menu()
|
|
|
|
|
|
if (farm_mode)
|
|
|
{
|
|
|
- MENU_ITEM_SUBMENU_P(PSTR("Farm number"), lcd_farm_no);
|
|
|
MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode);
|
|
|
}
|
|
|
|
|
@@ -5851,13 +5808,13 @@ static void lcd_calibration_menu()
|
|
|
MENU_ITEM_FUNCTION_P(_i("Wizard"), lcd_wizard);
|
|
|
if (lcd_commands_type == LcdCommands::Idle)
|
|
|
{
|
|
|
- MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset);
|
|
|
+ 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);
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Belt test "), lcd_belttest_v);
|
|
|
#endif
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Selftest "), lcd_selftest_v);
|
|
|
+ MENU_ITEM_FUNCTION_P(_i("Selftest "), lcd_selftest_v);
|
|
|
#ifdef MK1BP
|
|
|
|
|
|
|
|
@@ -5871,14 +5828,14 @@ static void lcd_calibration_menu()
|
|
|
|
|
|
#endif
|
|
|
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Mesh Bed Leveling"), lcd_mesh_bedleveling);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling);
|
|
|
|
|
|
#endif
|
|
|
|
|
|
MENU_ITEM_SUBMENU_P(_i("Bed level correct"), lcd_adjust_bed);
|
|
|
MENU_ITEM_SUBMENU_P(_i("PID calibration"), pid_extruder);
|
|
|
#ifndef TMC2130
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Show end stops"), menu_show_end_stops);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Show end stops"), menu_show_end_stops);
|
|
|
#endif
|
|
|
#ifndef MK1BP
|
|
|
MENU_ITEM_GCODE_P(_i("Reset XYZ calibr."), PSTR("M44"));
|
|
@@ -5887,7 +5844,10 @@ static void lcd_calibration_menu()
|
|
|
|
|
|
#endif
|
|
|
#ifndef MK1BP
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Temp. calibration"), lcd_pinda_calibration_menu);
|
|
|
+ if(has_temperature_compensation())
|
|
|
+ {
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Temp. calibration"), lcd_pinda_calibration_menu);
|
|
|
+ }
|
|
|
#endif
|
|
|
}
|
|
|
|
|
@@ -5898,11 +5858,9 @@ void bowden_menu() {
|
|
|
int enc_dif = lcd_encoder_diff;
|
|
|
int cursor_pos = 0;
|
|
|
lcd_clear();
|
|
|
- lcd_set_cursor(0, 0);
|
|
|
- lcd_print(">");
|
|
|
+ lcd_putc_at(0, 0, '>');
|
|
|
for (uint_least8_t i = 0; i < 4; i++) {
|
|
|
- lcd_set_cursor(1, i);
|
|
|
- lcd_print("Extruder ");
|
|
|
+ lcd_puts_at_P(1, i, PSTR("Extruder "));
|
|
|
lcd_print(i);
|
|
|
lcd_print(": ");
|
|
|
EEPROM_read_B(EEPROM_BOWDEN_LENGTH + i * 2, &bowden_length[i]);
|
|
@@ -5936,16 +5894,8 @@ void bowden_menu() {
|
|
|
Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
}
|
|
|
|
|
|
- lcd_set_cursor(0, 0);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, cursor_pos);
|
|
|
- lcd_print(">");
|
|
|
+ lcd_puts_at_P(0, 0, PSTR(" \n \n \n "));
|
|
|
+ lcd_putc_at(0, cursor_pos, '>');
|
|
|
Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
_delay(100);
|
|
@@ -5959,8 +5909,7 @@ void bowden_menu() {
|
|
|
manage_heater();
|
|
|
manage_inactivity(true);
|
|
|
|
|
|
- lcd_set_cursor(1, 1);
|
|
|
- lcd_print("Extruder ");
|
|
|
+ lcd_puts_at_P(1, 1, PSTR("Extruder "));
|
|
|
lcd_print(cursor_pos);
|
|
|
lcd_print(": ");
|
|
|
lcd_set_cursor(13, 1);
|
|
@@ -5989,11 +5938,9 @@ void bowden_menu() {
|
|
|
lcd_update_enable(true);
|
|
|
lcd_clear();
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
- lcd_set_cursor(0, cursor_pos);
|
|
|
- lcd_print(">");
|
|
|
+ lcd_putc_at(0, cursor_pos, '>');
|
|
|
for (uint_least8_t i = 0; i < 4; i++) {
|
|
|
- lcd_set_cursor(1, i);
|
|
|
- lcd_print("Extruder ");
|
|
|
+ lcd_puts_at_P(1, i, PSTR("Extruder "));
|
|
|
lcd_print(i);
|
|
|
lcd_print(": ");
|
|
|
EEPROM_read_B(EEPROM_BOWDEN_LENGTH + i * 2, &bowden_length[i]);
|
|
@@ -6013,8 +5960,8 @@ void bowden_menu() {
|
|
|
|
|
|
static char snmm_stop_print_menu() {
|
|
|
lcd_clear();
|
|
|
- lcd_puts_at_P(0,0,_T(MSG_UNLOAD_FILAMENT)); lcd_print(":");
|
|
|
- lcd_set_cursor(0, 1); lcd_print(">");
|
|
|
+ lcd_puts_at_P(0,0,_T(MSG_UNLOAD_FILAMENT)); lcd_print(':');
|
|
|
+ lcd_set_cursor(0, 1); lcd_print('>');
|
|
|
lcd_puts_at_P(1,2,_i("Used during print"));
|
|
|
lcd_puts_at_P(1,3,_i("Current"));
|
|
|
char cursor_pos = 1;
|
|
@@ -6038,14 +5985,9 @@ static char snmm_stop_print_menu() {
|
|
|
Sound_MakeSound(e_SOUND_TYPE_BlindAlert);
|
|
|
}
|
|
|
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_print(" ");
|
|
|
+ lcd_puts_at_P(0, 1, PSTR(" \n \n "));
|
|
|
lcd_set_cursor(0, cursor_pos);
|
|
|
- lcd_print(">");
|
|
|
+ lcd_print('>');
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
_delay(100);
|
|
@@ -6148,14 +6090,8 @@ uint8_t choose_menu_P(const char *header, const char *item, const char *last_ite
|
|
|
|
|
|
if (last_item&&last_visible) lcd_puts_at_P(1, 3, last_item);
|
|
|
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, cursor_pos);
|
|
|
- lcd_print(">");
|
|
|
+ lcd_puts_at_P(0, 1, PSTR(" \n \n "));
|
|
|
+ lcd_putc_at(0, cursor_pos, '>');
|
|
|
_delay(100);
|
|
|
|
|
|
if (lcd_clicked())
|
|
@@ -6169,34 +6105,31 @@ uint8_t choose_menu_P(const char *header, const char *item, const char *last_ite
|
|
|
}
|
|
|
|
|
|
char reset_menu() {
|
|
|
+ const uint8_t items_no =
|
|
|
#ifdef SNMM
|
|
|
- int items_no = 5;
|
|
|
+ 5;
|
|
|
#else
|
|
|
- int items_no = 4;
|
|
|
+ 4;
|
|
|
#endif
|
|
|
- static int first = 0;
|
|
|
- int enc_dif = 0;
|
|
|
+ static int8_t first = 0;
|
|
|
+ int8_t enc_dif = 0;
|
|
|
char cursor_pos = 0;
|
|
|
- const char *item [items_no];
|
|
|
-
|
|
|
- item[0] = "Language";
|
|
|
- item[1] = "Statistics";
|
|
|
- item[2] = "Shipping prep";
|
|
|
- item[3] = "All Data";
|
|
|
-#ifdef SNMM
|
|
|
- item[4] = "Bowden length";
|
|
|
-#endif
|
|
|
|
|
|
+ const char *const item[items_no] PROGMEM = {PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("All Data")
|
|
|
+#ifdef SNMM
|
|
|
+ , PSTR("Bowden length")
|
|
|
+#endif
|
|
|
+ };
|
|
|
+
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
lcd_clear();
|
|
|
lcd_set_cursor(0, 0);
|
|
|
- lcd_print(">");
|
|
|
+ lcd_putc('>');
|
|
|
lcd_consume_click();
|
|
|
while (1) {
|
|
|
|
|
|
for (uint_least8_t i = 0; i < 4; i++) {
|
|
|
- lcd_set_cursor(1, i);
|
|
|
- lcd_print(item[first + i]);
|
|
|
+ lcd_puts_at_P(1, i, item[first + i]);
|
|
|
}
|
|
|
|
|
|
manage_heater();
|
|
@@ -6230,16 +6163,9 @@ char reset_menu() {
|
|
|
lcd_clear();
|
|
|
}
|
|
|
}
|
|
|
- lcd_set_cursor(0, 0);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_print(" ");
|
|
|
+ lcd_puts_at_P(0, 0, PSTR(" \n \n \n "));
|
|
|
lcd_set_cursor(0, cursor_pos);
|
|
|
- lcd_print(">");
|
|
|
+ lcd_putc('>');
|
|
|
Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
_delay(100);
|
|
@@ -6404,13 +6330,13 @@ void unload_filament()
|
|
|
|
|
|
|
|
|
current_position[E_AXIS] -= 45;
|
|
|
- plan_buffer_line_curposXYZE(5200 / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(5200 / 60);
|
|
|
st_synchronize();
|
|
|
current_position[E_AXIS] -= 15;
|
|
|
- plan_buffer_line_curposXYZE(1000 / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(1000 / 60);
|
|
|
st_synchronize();
|
|
|
current_position[E_AXIS] -= 20;
|
|
|
- plan_buffer_line_curposXYZE(1000 / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(1000 / 60);
|
|
|
st_synchronize();
|
|
|
|
|
|
lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT));
|
|
@@ -6437,74 +6363,6 @@ void unload_filament()
|
|
|
|
|
|
}
|
|
|
|
|
|
-static void lcd_farm_no()
|
|
|
-{
|
|
|
- char step = 0;
|
|
|
- int enc_dif = 0;
|
|
|
- int _farmno = farm_no;
|
|
|
- int _ret = 0;
|
|
|
- lcd_clear();
|
|
|
-
|
|
|
- lcd_set_cursor(0, 0);
|
|
|
- lcd_print("Farm no");
|
|
|
-
|
|
|
- do
|
|
|
- {
|
|
|
-
|
|
|
- if (abs((enc_dif - lcd_encoder_diff)) > 2) {
|
|
|
- if (enc_dif > lcd_encoder_diff) {
|
|
|
- switch (step) {
|
|
|
- case(0): if (_farmno >= 100) _farmno -= 100; break;
|
|
|
- case(1): if (_farmno % 100 >= 10) _farmno -= 10; break;
|
|
|
- case(2): if (_farmno % 10 >= 1) _farmno--; break;
|
|
|
- default: break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (enc_dif < lcd_encoder_diff) {
|
|
|
- switch (step) {
|
|
|
- case(0): if (_farmno < 900) _farmno += 100; break;
|
|
|
- case(1): if (_farmno % 100 < 90) _farmno += 10; break;
|
|
|
- case(2): if (_farmno % 10 <= 8)_farmno++; break;
|
|
|
- default: break;
|
|
|
- }
|
|
|
- }
|
|
|
- enc_dif = 0;
|
|
|
- lcd_encoder_diff = 0;
|
|
|
- }
|
|
|
-
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- if (_farmno < 100) lcd_print("0");
|
|
|
- if (_farmno < 10) lcd_print("0");
|
|
|
- lcd_print(_farmno);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_print(" ");
|
|
|
-
|
|
|
-
|
|
|
- lcd_set_cursor(step, 3);
|
|
|
- lcd_print("^");
|
|
|
- _delay(100);
|
|
|
-
|
|
|
- if (lcd_clicked())
|
|
|
- {
|
|
|
- _delay(200);
|
|
|
- step++;
|
|
|
- if(step == 3) {
|
|
|
- _ret = 1;
|
|
|
- farm_no = _farmno;
|
|
|
- EEPROM_save_B(EEPROM_FARM_NUMBER, &farm_no);
|
|
|
- prusa_statistics(20);
|
|
|
- lcd_return_to_status();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- manage_heater();
|
|
|
- } while (_ret == 0);
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
unsigned char lcd_choose_color() {
|
|
|
|
|
|
|
|
@@ -6520,8 +6378,7 @@ unsigned char lcd_choose_color() {
|
|
|
unsigned char cursor_pos = 1;
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
lcd_clear();
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
- lcd_print(">");
|
|
|
+ lcd_putc_at(0, 1, '>');
|
|
|
|
|
|
active_rows = items_no < 3 ? items_no : 3;
|
|
|
lcd_consume_click();
|
|
@@ -6562,14 +6419,10 @@ unsigned char lcd_choose_color() {
|
|
|
lcd_clear();
|
|
|
}
|
|
|
}
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_print(" ");
|
|
|
- lcd_set_cursor(0, cursor_pos);
|
|
|
- lcd_print(">");
|
|
|
+ lcd_putc_at(0, 1, ' ');
|
|
|
+ lcd_putc_at(0, 2, ' ');
|
|
|
+ lcd_putc_at(0, 3, ' ');
|
|
|
+ lcd_putc_at(0, cursor_pos, '>');
|
|
|
Sound_MakeSound(e_SOUND_TYPE_EncoderMove);
|
|
|
enc_dif = lcd_encoder_diff;
|
|
|
_delay(100);
|
|
@@ -6589,85 +6442,6 @@ unsigned char lcd_choose_color() {
|
|
|
|
|
|
}
|
|
|
|
|
|
-void lcd_confirm_print()
|
|
|
-{
|
|
|
- uint8_t filament_type;
|
|
|
- int enc_dif = 0;
|
|
|
- int cursor_pos = 1;
|
|
|
- int _ret = 0;
|
|
|
- int _t = 0;
|
|
|
-
|
|
|
- enc_dif = lcd_encoder_diff;
|
|
|
- lcd_clear();
|
|
|
-
|
|
|
- lcd_set_cursor(0, 0);
|
|
|
- lcd_print("Print ok ?");
|
|
|
-
|
|
|
- do
|
|
|
- {
|
|
|
- if (abs(enc_dif - lcd_encoder_diff) > 12) {
|
|
|
- if (enc_dif > lcd_encoder_diff) {
|
|
|
- cursor_pos--;
|
|
|
- }
|
|
|
-
|
|
|
- if (enc_dif < lcd_encoder_diff) {
|
|
|
- cursor_pos++;
|
|
|
- }
|
|
|
- enc_dif = lcd_encoder_diff;
|
|
|
- }
|
|
|
-
|
|
|
- if (cursor_pos > 2) { cursor_pos = 2; }
|
|
|
- if (cursor_pos < 1) { cursor_pos = 1; }
|
|
|
-
|
|
|
- lcd_set_cursor(0, 2); lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 3); lcd_print(" ");
|
|
|
- lcd_set_cursor(2, 2);
|
|
|
- lcd_puts_P(_T(MSG_YES));
|
|
|
- lcd_set_cursor(2, 3);
|
|
|
- lcd_puts_P(_T(MSG_NO));
|
|
|
- lcd_set_cursor(0, 1 + cursor_pos);
|
|
|
- lcd_print(">");
|
|
|
- _delay(100);
|
|
|
-
|
|
|
- _t = _t + 1;
|
|
|
- if (_t>100)
|
|
|
- {
|
|
|
- prusa_statistics(99);
|
|
|
- _t = 0;
|
|
|
- }
|
|
|
- if (lcd_clicked())
|
|
|
- {
|
|
|
- filament_type = FARM_FILAMENT_COLOR_NONE;
|
|
|
- if (cursor_pos == 1)
|
|
|
- {
|
|
|
- _ret = 1;
|
|
|
-
|
|
|
- prusa_statistics(4, filament_type);
|
|
|
- no_response = true;
|
|
|
- important_status = 4;
|
|
|
- saved_filament_type = filament_type;
|
|
|
- NcTime = _millis();
|
|
|
- }
|
|
|
- if (cursor_pos == 2)
|
|
|
- {
|
|
|
- _ret = 2;
|
|
|
-
|
|
|
- prusa_statistics(5, filament_type);
|
|
|
- no_response = true;
|
|
|
- important_status = 5;
|
|
|
- saved_filament_type = filament_type;
|
|
|
- NcTime = _millis();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- manage_heater();
|
|
|
- manage_inactivity();
|
|
|
- proc_commands();
|
|
|
-
|
|
|
- } while (_ret == 0);
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
#include "w25x20cl.h"
|
|
|
|
|
|
#ifdef LCD_TEST
|
|
@@ -6690,7 +6464,7 @@ static bool fan_error_selftest()
|
|
|
fanSpeedSoftPwm = 255;
|
|
|
#endif
|
|
|
manage_heater();
|
|
|
- setExtruderAutoFanState(EXTRUDER_0_AUTO_FAN_PIN, 1);
|
|
|
+ setExtruderAutoFanState(3);
|
|
|
#ifdef FAN_SOFT_PWM
|
|
|
extruder_autofan_last_check = _millis();
|
|
|
fan_measuring = true;
|
|
@@ -6698,6 +6472,7 @@ static bool fan_error_selftest()
|
|
|
_delay(1000);
|
|
|
manage_heater();
|
|
|
fanSpeed = 0;
|
|
|
+ setExtruderAutoFanState(1);
|
|
|
#ifdef FAN_SOFT_PWM
|
|
|
fanSpeedSoftPwm = 0;
|
|
|
#endif
|
|
@@ -6726,11 +6501,12 @@ void lcd_resume_print()
|
|
|
lcd_return_to_status();
|
|
|
lcd_reset_alert_level();
|
|
|
if (fan_error_selftest()) return;
|
|
|
+ cmdqueue_serial_disabled = false;
|
|
|
|
|
|
lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS));
|
|
|
st_synchronize();
|
|
|
|
|
|
- lcd_setstatuspgm(_T(MSG_RESUMING_PRINT));
|
|
|
+ lcd_setstatuspgm(_T(MSG_RESUMING_PRINT));
|
|
|
isPrintPaused = false;
|
|
|
restore_print_from_ram_and_continue(default_retraction);
|
|
|
pause_time += (_millis() - start_pause_print);
|
|
@@ -6818,7 +6594,7 @@ static void activate_calibrate_sheet()
|
|
|
static void lcd_sheet_menu()
|
|
|
{
|
|
|
MENU_BEGIN();
|
|
|
- MENU_ITEM_BACK_P(_i("Steel sheets"));
|
|
|
+ MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS));
|
|
|
|
|
|
if(eeprom_is_sheet_initialized(selected_sheet)){
|
|
|
MENU_ITEM_SUBMENU_P(_i("Select"), change_sheet);
|
|
@@ -6826,10 +6602,10 @@ static void lcd_sheet_menu()
|
|
|
|
|
|
if (lcd_commands_type == LcdCommands::Idle)
|
|
|
{
|
|
|
- MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet);
|
|
|
}
|
|
|
MENU_ITEM_SUBMENU_P(_i("Rename"), lcd_rename_sheet_menu);
|
|
|
- MENU_ITEM_FUNCTION_P(_i("Reset"), lcd_reset_sheet);
|
|
|
+ MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet);
|
|
|
|
|
|
MENU_END();
|
|
|
}
|
|
@@ -6861,6 +6637,8 @@ static void lcd_main_menu()
|
|
|
MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);
|
|
|
}
|
|
|
|
|
|
+ if (farm_mode)
|
|
|
+ MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);
|
|
|
|
|
|
if ( moves_planned() || IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal))
|
|
|
{
|
|
@@ -6875,9 +6653,9 @@ static void lcd_main_menu()
|
|
|
{
|
|
|
#ifdef FANCHECK
|
|
|
if((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK))
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);
|
|
|
#else
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);
|
|
|
#endif
|
|
|
}
|
|
|
|
|
@@ -6895,9 +6673,9 @@ static void lcd_main_menu()
|
|
|
{
|
|
|
#ifdef FANCHECK
|
|
|
if((fan_check_error == EFCE_FIXED) || (fan_check_error == EFCE_OK))
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);
|
|
|
#else
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Resume print"), lcd_resume_print);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print);
|
|
|
#endif
|
|
|
|
|
|
}
|
|
@@ -6946,14 +6724,7 @@ static void lcd_main_menu()
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal))
|
|
|
- {
|
|
|
- if (farm_mode)
|
|
|
- {
|
|
|
- MENU_ITEM_SUBMENU_P(PSTR("Farm number"), lcd_farm_no);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
+ if ( ! ( IS_SD_PRINTING || is_usb_printing || (lcd_commands_type == LcdCommands::Layer1Cal) ) )
|
|
|
{
|
|
|
if (mmu_enabled)
|
|
|
{
|
|
@@ -6962,9 +6733,9 @@ static void lcd_main_menu()
|
|
|
|
|
|
|
|
|
MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), mmu_unload_filament);
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Eject filament"), mmu_fil_eject_menu);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FILAMENT), mmu_fil_eject_menu);
|
|
|
#ifdef MMU_HAS_CUTTER
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Cut filament"), mmu_cut_filament_menu);
|
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), mmu_cut_filament_menu);
|
|
|
#endif
|
|
|
}
|
|
|
else
|
|
@@ -6975,7 +6746,7 @@ static void lcd_main_menu()
|
|
|
#endif
|
|
|
#ifdef FILAMENT_SENSOR
|
|
|
if ((fsensor_autoload_enabled == true) && (fsensor_enabled == true) && (mmu_enabled == false))
|
|
|
- MENU_ITEM_SUBMENU_P(_i("AutoLoad filament"), lcd_menu_AutoLoadFilament);
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("AutoLoad filament"), lcd_menu_AutoLoadFilament);
|
|
|
else
|
|
|
#endif
|
|
|
{
|
|
@@ -7144,7 +6915,8 @@ static void lcd_tune_menu()
|
|
|
MENU_ITEM_EDIT_advance_K();
|
|
|
#endif
|
|
|
#ifdef FILAMENTCHANGEENABLE
|
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);
|
|
|
+ if (!farm_mode)
|
|
|
+ MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);
|
|
|
#endif
|
|
|
|
|
|
#ifdef FILAMENT_SENSOR
|
|
@@ -7172,7 +6944,7 @@ static void lcd_tune_menu()
|
|
|
|
|
|
if(farm_mode)
|
|
|
{
|
|
|
- MENU_ITEM_TOGGLE_P(_i("Fans check"), fans_check_enabled ? _T(MSG_ON) : _T(MSG_OFF), lcd_set_fan_check);
|
|
|
+ MENU_ITEM_TOGGLE_P(_T(MSG_FANS_CHECK), fans_check_enabled ? _T(MSG_ON) : _T(MSG_OFF), lcd_set_fan_check);
|
|
|
}
|
|
|
|
|
|
#ifdef TMC2130
|
|
@@ -7338,6 +7110,7 @@ void lcd_print_stop()
|
|
|
if (!card.sdprinting) {
|
|
|
SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_CANCEL);
|
|
|
}
|
|
|
+ cmdqueue_serial_disabled = false;
|
|
|
|
|
|
CRITICAL_SECTION_START;
|
|
|
|
|
@@ -7370,13 +7143,13 @@ void lcd_print_stop()
|
|
|
cancel_heatup = true;
|
|
|
|
|
|
current_position[Z_AXIS] += 10;
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60);
|
|
|
|
|
|
if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS])
|
|
|
{
|
|
|
current_position[X_AXIS] = X_CANCEL_POS;
|
|
|
current_position[Y_AXIS] = Y_CANCEL_POS;
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
}
|
|
|
st_synchronize();
|
|
|
|
|
@@ -7397,20 +7170,16 @@ void lcd_print_stop()
|
|
|
void lcd_sdcard_stop()
|
|
|
{
|
|
|
|
|
|
- lcd_set_cursor(0, 0);
|
|
|
- lcd_puts_P(_T(MSG_STOP_PRINT));
|
|
|
- lcd_set_cursor(2, 2);
|
|
|
- lcd_puts_P(_T(MSG_NO));
|
|
|
- lcd_set_cursor(2, 3);
|
|
|
- lcd_puts_P(_T(MSG_YES));
|
|
|
- lcd_set_cursor(0, 2); lcd_print(" ");
|
|
|
- lcd_set_cursor(0, 3); lcd_print(" ");
|
|
|
+ lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT));
|
|
|
+ lcd_puts_at_P(2, 2, _T(MSG_NO));
|
|
|
+ lcd_puts_at_P(2, 3, _T(MSG_YES));
|
|
|
+ lcd_putc_at(0, 2, ' ');
|
|
|
+ lcd_putc_at(0, 3, ' ');
|
|
|
|
|
|
if ((int32_t)lcd_encoder > 2) { lcd_encoder = 2; }
|
|
|
if ((int32_t)lcd_encoder < 1) { lcd_encoder = 1; }
|
|
|
|
|
|
- lcd_set_cursor(0, 1 + lcd_encoder);
|
|
|
- lcd_print(">");
|
|
|
+ lcd_putc_at(0, 1 + lcd_encoder, '>');
|
|
|
|
|
|
if (lcd_clicked())
|
|
|
{
|
|
@@ -7487,92 +7256,71 @@ 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()
|
|
|
{
|
|
|
- bool _result = true;
|
|
|
-
|
|
|
- #ifdef TMC2130
|
|
|
- FORCE_HIGH_POWER_START;
|
|
|
- #endif
|
|
|
+ lcd_clear();
|
|
|
+
|
|
|
+ FORCE_HIGH_POWER_START;
|
|
|
|
|
|
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);
|
|
|
-
|
|
|
+ lcd_printf_P(_T(MSG_CHECKING_X));
|
|
|
+ lcd_set_cursor(0,1), lcd_printf_P(PSTR("X: %u -> ..."),X);
|
|
|
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("Checking Y..."), X, Y);
|
|
|
- _result = lcd_selfcheck_axis_sg(Y_AXIS);
|
|
|
- Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y));
|
|
|
+
|
|
|
+
|
|
|
+ if (lcd_selfcheck_axis_sg(X_AXIS)){
|
|
|
+ X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X));
|
|
|
+ lcd_set_cursor(10,1), lcd_printf_P(PSTR("%u"),X);
|
|
|
+ lcd_puts_at_P(0,2,_T(MSG_CHECKING_Y));
|
|
|
+ lcd_set_cursor(0,3), lcd_printf_P(PSTR("Y: %u -> ..."),Y);
|
|
|
+ if (lcd_selfcheck_axis_sg(Y_AXIS))
|
|
|
+ {
|
|
|
+ Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y));
|
|
|
+ lcd_set_cursor(10,3),lcd_printf_P(PSTR("%u"),Y);
|
|
|
+ lcd_set_cursor(19, 3);
|
|
|
+ lcd_print(LCD_STR_UPLEVEL);
|
|
|
+ lcd_wait_for_click_delay(10);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- if (!_result) {
|
|
|
- lcd_belttest_print(_i("Error"), X, Y);
|
|
|
- } else {
|
|
|
- lcd_belttest_print(_i("Done"), X, Y);
|
|
|
- }
|
|
|
-
|
|
|
- #ifdef TMC2130
|
|
|
- FORCE_HIGH_POWER_END;
|
|
|
- #endif
|
|
|
-
|
|
|
+
|
|
|
+ FORCE_HIGH_POWER_END;
|
|
|
KEEPALIVE_STATE(NOT_BUSY);
|
|
|
- _delay(3000);
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
#ifdef IR_SENSOR_ANALOG
|
|
|
|
|
|
-void printf_IRSensorAnalogBoardChange(bool bPCBrev03b){
|
|
|
- printf_P(PSTR("Filament sensor board change detected: revision %S\n"), bPCBrev03b ? PSTR("03b or newer") : PSTR("03 or older"));
|
|
|
+void printf_IRSensorAnalogBoardChange(){
|
|
|
+ printf_P(PSTR("Filament sensor board change detected: revision%S\n"), FsensorIRVersionText());
|
|
|
}
|
|
|
|
|
|
static bool lcd_selftest_IRsensor(bool bStandalone)
|
|
|
{
|
|
|
- bool bAction;
|
|
|
- bool bPCBrev03b;
|
|
|
+ bool bPCBrev04;
|
|
|
uint16_t volt_IR_int;
|
|
|
- float volt_IR;
|
|
|
|
|
|
- volt_IR_int=current_voltage_raw_IR;
|
|
|
- bPCBrev03b=(volt_IR_int<((int)IRsensor_Hopen_TRESHOLD));
|
|
|
- volt_IR=VOLT_DIV_REF*((float)volt_IR_int/(1023*OVERSAMPLENR));
|
|
|
- printf_P(PSTR("Measured filament sensor high level: %4.2fV\n"),volt_IR);
|
|
|
- if(volt_IR_int < ((int)IRsensor_Hmin_TRESHOLD)){
|
|
|
+ volt_IR_int = current_voltage_raw_IR;
|
|
|
+ bPCBrev04=(volt_IR_int < IRsensor_Hopen_TRESHOLD);
|
|
|
+ printf_P(PSTR("Measured filament sensor high level: %4.2fV\n"), Raw2Voltage(volt_IR_int) );
|
|
|
+ if(volt_IR_int < IRsensor_Hmin_TRESHOLD){
|
|
|
if(!bStandalone)
|
|
|
lcd_selftest_error(TestError::FsensorLevel,"HIGH","");
|
|
|
return(false);
|
|
|
}
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("Please insert filament (but not load them!) into extruder and then press the knob."));
|
|
|
- volt_IR_int=current_voltage_raw_IR;
|
|
|
- volt_IR=VOLT_DIV_REF*((float)volt_IR_int/(1023*OVERSAMPLENR));
|
|
|
- printf_P(PSTR("Measured filament sensor low level: %4.2fV\n"),volt_IR);
|
|
|
- if(volt_IR_int > ((int)IRsensor_Lmax_TRESHOLD)){
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("Insert the filament (do not load it) into the extruder and then press the knob."));
|
|
|
+ volt_IR_int = current_voltage_raw_IR;
|
|
|
+ printf_P(PSTR("Measured filament sensor low level: %4.2fV\n"), Raw2Voltage(volt_IR_int));
|
|
|
+ if(volt_IR_int > (IRsensor_Lmax_TRESHOLD)){
|
|
|
if(!bStandalone)
|
|
|
lcd_selftest_error(TestError::FsensorLevel,"LOW","");
|
|
|
return(false);
|
|
|
}
|
|
|
- if((bPCBrev03b?1:0)!=(uint8_t)oFsensorPCB){
|
|
|
- printf_IRSensorAnalogBoardChange(bPCBrev03b);
|
|
|
- oFsensorPCB=bPCBrev03b?ClFsensorPCB::_Rev03b:ClFsensorPCB::_Old;
|
|
|
+ if((bPCBrev04 ? 1 : 0) != (uint8_t)oFsensorPCB){
|
|
|
+ oFsensorPCB=bPCBrev04 ? ClFsensorPCB::_Rev04 : ClFsensorPCB::_Old;
|
|
|
+ printf_IRSensorAnalogBoardChange();
|
|
|
eeprom_update_byte((uint8_t*)EEPROM_FSENSOR_PCB,(uint8_t)oFsensorPCB);
|
|
|
}
|
|
|
return(true);
|
|
@@ -7580,18 +7328,26 @@ static bool lcd_selftest_IRsensor(bool bStandalone)
|
|
|
|
|
|
static void lcd_detect_IRsensor(){
|
|
|
bool bAction;
|
|
|
-
|
|
|
+ bool loaded;
|
|
|
bMenuFSDetect = true;
|
|
|
- bAction = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is the filament loaded?"), false, false);
|
|
|
- if(!bAction){
|
|
|
+
|
|
|
+
|
|
|
+ loaded = ! READ(IR_SENSOR_PIN);
|
|
|
+ if(loaded ){
|
|
|
lcd_show_fullscreen_message_and_wait_P(_i("Please unload the filament first, then repeat this action."));
|
|
|
return;
|
|
|
+ } else {
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("Please check the IR sensor connection, unload filament if present."));
|
|
|
+ bAction = lcd_selftest_IRsensor(true);
|
|
|
+ }
|
|
|
+ if(bAction){
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("Sensor verified, remove the filament now."));
|
|
|
+
|
|
|
+ fsensor_not_responding = false;
|
|
|
+ } else {
|
|
|
+ lcd_show_fullscreen_message_and_wait_P(_i("Verification failed, remove the filament and try again."));
|
|
|
+
|
|
|
}
|
|
|
- bAction = lcd_selftest_IRsensor(true);
|
|
|
- if(bAction)
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("Sensor verified, remove the filament now."));
|
|
|
- else
|
|
|
- lcd_show_fullscreen_message_and_wait_P(_i("Verification failed, remove the filament and try again."));
|
|
|
bMenuFSDetect=false;
|
|
|
}
|
|
|
#endif
|
|
@@ -7606,16 +7362,22 @@ bool lcd_selftest()
|
|
|
int _progress = 0;
|
|
|
bool _result = true;
|
|
|
bool _swapped_fan = false;
|
|
|
-
|
|
|
-#if (0)
|
|
|
- bool bAction;
|
|
|
- bAction=lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Is the filament unloaded?"),false,true);
|
|
|
- if(!bAction)
|
|
|
- return(false);
|
|
|
+#ifdef IR_SENSOR_ANALOG
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if( oFsensorPCB == ClFsensorPCB::_Undef) {
|
|
|
+ if (!mmu_enabled) {
|
|
|
+ lcd_detect_IRsensor();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ eeprom_update_byte((uint8_t*)EEPROM_FSENSOR_PCB,0);
|
|
|
+ }
|
|
|
+ }
|
|
|
#endif
|
|
|
lcd_wait_for_cool_down();
|
|
|
lcd_clear();
|
|
|
- lcd_set_cursor(0, 0); lcd_puts_P(_i("Self test start "));
|
|
|
+ lcd_puts_at_P(0, 0, _i("Self test start "));
|
|
|
#ifdef TMC2130
|
|
|
FORCE_HIGH_POWER_START;
|
|
|
#endif
|
|
@@ -7687,11 +7449,7 @@ bool lcd_selftest()
|
|
|
if (_result)
|
|
|
{
|
|
|
_progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000);
|
|
|
-#ifndef TMC2130
|
|
|
- _result = lcd_selfcheck_endstops();
|
|
|
-#else
|
|
|
- _result = true;
|
|
|
-#endif
|
|
|
+ _result = lcd_selfcheck_endstops();
|
|
|
}
|
|
|
|
|
|
if (_result)
|
|
@@ -7746,26 +7504,26 @@ bool lcd_selftest()
|
|
|
|
|
|
|
|
|
|
|
|
- current_position[X_AXIS] += pgm_read_float(bed_ref_points_4);
|
|
|
- current_position[Y_AXIS] += pgm_read_float(bed_ref_points_4+1);
|
|
|
+ current_position[X_AXIS] = pgm_read_float(bed_ref_points_4);
|
|
|
+ current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1);
|
|
|
#ifdef TMC2130
|
|
|
|
|
|
current_position[Y_AXIS] += 4;
|
|
|
#endif
|
|
|
current_position[Z_AXIS] = current_position[Z_AXIS] + 10;
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
st_synchronize();
|
|
|
set_destination_to_current();
|
|
|
_progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500);
|
|
|
#ifdef TMC2130
|
|
|
- _result = homeaxis(Z_AXIS, false);
|
|
|
+ homeaxis(Z_AXIS);
|
|
|
#else
|
|
|
_result = lcd_selfcheck_axis(Z_AXIS, Z_MAX_POS);
|
|
|
#endif
|
|
|
|
|
|
|
|
|
current_position[Z_AXIS] += 20;
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
st_synchronize();
|
|
|
}
|
|
|
|
|
@@ -7773,7 +7531,7 @@ bool lcd_selftest()
|
|
|
if (_result)
|
|
|
{
|
|
|
current_position[Z_AXIS] = current_position[Z_AXIS] + 10;
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
st_synchronize();
|
|
|
_progress = lcd_selftest_screen(TestScreen::Home, 0, 2, true, 0);
|
|
|
bool bres = tmc2130_home_calibrate(X_AXIS);
|
|
@@ -7823,10 +7581,12 @@ bool lcd_selftest()
|
|
|
_progress = lcd_selftest_screen(TestScreen::FsensorOk, _progress, 3, true, 2000);
|
|
|
}
|
|
|
#endif
|
|
|
-
|
|
|
-#if (0)
|
|
|
+#if 0
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
_progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000);
|
|
|
- _result = lcd_selftest_IRsensor();
|
|
|
+ _result = lcd_selftest_IRsensor();
|
|
|
if (_result)
|
|
|
{
|
|
|
_progress = lcd_selftest_screen(TestScreen::FsensorOk, _progress, 3, true, 2000);
|
|
@@ -7869,7 +7629,7 @@ bool lcd_selftest()
|
|
|
|
|
|
static void reset_crash_det(unsigned char axis) {
|
|
|
current_position[axis] += 10;
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
st_synchronize();
|
|
|
if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET)) tmc2130_sg_stop_on_crash = true;
|
|
|
}
|
|
@@ -7890,17 +7650,15 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
|
|
tmc2130_home_exit();
|
|
|
enable_endstops(true);
|
|
|
|
|
|
- if (axis == X_AXIS) {
|
|
|
- raise_z_above(17,true);
|
|
|
- tmc2130_home_enter(Z_AXIS_MASK);
|
|
|
- st_synchronize();
|
|
|
- tmc2130_home_exit();
|
|
|
- }
|
|
|
+
|
|
|
+ raise_z_above(MESH_HOME_Z_SEARCH);
|
|
|
+ st_synchronize();
|
|
|
+ tmc2130_home_enter(1 << axis);
|
|
|
|
|
|
|
|
|
|
|
|
current_position[axis] -= (axis_length + margin);
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
|
|
|
|
|
|
st_synchronize();
|
|
@@ -7910,11 +7668,11 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
|
|
current_position_init = st_get_position_mm(axis);
|
|
|
|
|
|
current_position[axis] += 2 * margin;
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
st_synchronize();
|
|
|
|
|
|
current_position[axis] += axis_length;
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
|
|
|
st_synchronize();
|
|
|
|
|
@@ -7930,11 +7688,11 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
|
|
|
|
|
|
|
|
current_position[axis] -= margin;
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
st_synchronize();
|
|
|
|
|
|
current_position[axis] -= (axis_length + margin);
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
|
|
|
st_synchronize();
|
|
|
|
|
@@ -7942,6 +7700,7 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
|
|
|
|
|
measured_axis_length[1] = abs(current_position_final - current_position_init);
|
|
|
|
|
|
+ tmc2130_home_exit();
|
|
|
|
|
|
|
|
|
|
|
@@ -7958,8 +7717,10 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
|
|
|
|
|
lcd_selftest_error(TestError::Axis, _error_1, "");
|
|
|
current_position[axis] = 0;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
reset_crash_det(axis);
|
|
|
+ enable_endstops(true);
|
|
|
+ endstops_hit_on_purpose();
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
@@ -7976,14 +7737,15 @@ static bool lcd_selfcheck_axis_sg(unsigned char axis) {
|
|
|
|
|
|
lcd_selftest_error(TestError::Pulley, _error_1, "");
|
|
|
current_position[axis] = 0;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
reset_crash_det(axis);
|
|
|
-
|
|
|
+ endstops_hit_on_purpose();
|
|
|
return false;
|
|
|
}
|
|
|
current_position[axis] = 0;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
reset_crash_det(axis);
|
|
|
+ endstops_hit_on_purpose();
|
|
|
return true;
|
|
|
}
|
|
|
#endif
|
|
@@ -8003,13 +7765,13 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
|
|
|
|
|
|
if (_axis == X_AXIS) {
|
|
|
current_position[Z_AXIS] += 17;
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
}
|
|
|
|
|
|
do {
|
|
|
current_position[_axis] = current_position[_axis] - 1;
|
|
|
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
st_synchronize();
|
|
|
#ifdef TMC2130
|
|
|
if ((READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING))
|
|
@@ -8089,7 +7851,7 @@ static bool lcd_selfcheck_axis(int _axis, int _travel)
|
|
|
}
|
|
|
}
|
|
|
current_position[_axis] = 0;
|
|
|
- plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
|
|
|
+ plan_set_position_curposXYZE();
|
|
|
|
|
|
return _stepresult;
|
|
|
}
|
|
@@ -8112,17 +7874,17 @@ static bool lcd_selfcheck_pulleys(int axis)
|
|
|
current_position_init = current_position[axis];
|
|
|
|
|
|
current_position[axis] += 2;
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
for (i = 0; i < 5; i++) {
|
|
|
refresh_cmd_timeout();
|
|
|
current_position[axis] = current_position[axis] + move;
|
|
|
st_current_set(0, 850);
|
|
|
- plan_buffer_line_curposXYZE(200, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(200);
|
|
|
st_synchronize();
|
|
|
if (SilentModeMenu != SILENT_MODE_OFF) st_current_set(0, tmp_motor[0]);
|
|
|
else st_current_set(0, tmp_motor_loud[0]);
|
|
|
current_position[axis] = current_position[axis] - move;
|
|
|
- plan_buffer_line_curposXYZE(50, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(50);
|
|
|
st_synchronize();
|
|
|
if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
|
|
|
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) {
|
|
@@ -8138,6 +7900,9 @@ static bool lcd_selfcheck_pulleys(int axis)
|
|
|
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) {
|
|
|
endstop_triggered = true;
|
|
|
if (current_position_init - 1 <= current_position[axis] && current_position_init + 1 >= current_position[axis]) {
|
|
|
+ current_position[axis] += 10;
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
+ st_synchronize();
|
|
|
return(true);
|
|
|
}
|
|
|
else {
|
|
@@ -8147,7 +7912,7 @@ static bool lcd_selfcheck_pulleys(int axis)
|
|
|
}
|
|
|
else {
|
|
|
current_position[axis] -= 1;
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
st_synchronize();
|
|
|
if (_millis() > timeout_counter) {
|
|
|
lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", "");
|
|
@@ -8157,31 +7922,42 @@ static bool lcd_selfcheck_pulleys(int axis)
|
|
|
}
|
|
|
return(true);
|
|
|
}
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
static bool lcd_selfcheck_endstops()
|
|
|
{
|
|
|
bool _result = true;
|
|
|
|
|
|
- if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
|
|
|
+ if (
|
|
|
+ #ifndef TMC2130
|
|
|
+ ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
|
|
|
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ||
|
|
|
+ #endif
|
|
|
((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1))
|
|
|
{
|
|
|
+ #ifndef TMC2130
|
|
|
if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) current_position[0] += 10;
|
|
|
if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) current_position[1] += 10;
|
|
|
+ #endif
|
|
|
if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) current_position[2] += 10;
|
|
|
}
|
|
|
- plan_buffer_line_curposXYZE(manual_feedrate[0] / 60, active_extruder);
|
|
|
- _delay(500);
|
|
|
+ plan_buffer_line_curposXYZE(manual_feedrate[0] / 60);
|
|
|
+ st_synchronize();
|
|
|
|
|
|
- if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
|
|
|
+ if (
|
|
|
+ #ifndef TMC2130
|
|
|
+ ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ||
|
|
|
((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ||
|
|
|
+ #endif
|
|
|
((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1))
|
|
|
{
|
|
|
_result = false;
|
|
|
char _error[4] = "";
|
|
|
+ #ifndef TMC2130
|
|
|
if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "X");
|
|
|
if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Y");
|
|
|
+ #endif
|
|
|
if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Z");
|
|
|
lcd_selftest_error(TestError::Endstops, _error, "");
|
|
|
}
|
|
@@ -8189,7 +7965,6 @@ static bool lcd_selfcheck_endstops()
|
|
|
manage_inactivity(true);
|
|
|
return _result;
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
static bool lcd_selfcheck_check_heater(bool _isbed)
|
|
|
{
|
|
@@ -8276,106 +8051,79 @@ static void lcd_selftest_error(TestError testError, const char *_error_1, const
|
|
|
|
|
|
lcd_clear();
|
|
|
|
|
|
- lcd_set_cursor(0, 0);
|
|
|
- lcd_puts_P(_i("Selftest error !"));
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
- lcd_puts_P(_i("Please check :"));
|
|
|
+ lcd_puts_at_P(0, 0, _i("Selftest error !"));
|
|
|
+ lcd_puts_at_P(0, 1, _i("Please check :"));
|
|
|
|
|
|
switch (testError)
|
|
|
{
|
|
|
case TestError::Heater:
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Heater/Thermistor"));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Not connected"));
|
|
|
+ lcd_puts_at_P(0, 2, _i("Heater/Thermistor"));
|
|
|
+ lcd_puts_at_P(0, 3, _i("Not connected"));
|
|
|
break;
|
|
|
case TestError::Bed:
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Bed / Heater"));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
|
|
|
+ lcd_puts_at_P(0, 2, _i("Bed / Heater"));
|
|
|
+ lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR));
|
|
|
break;
|
|
|
case TestError::Endstops:
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Endstops"));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
|
|
|
+ lcd_puts_at_P(0, 2, _i("Endstops"));
|
|
|
+ lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR));
|
|
|
lcd_set_cursor(17, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
case TestError::Motor:
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_T(MSG_SELFTEST_MOTOR));
|
|
|
+ lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_MOTOR));
|
|
|
lcd_set_cursor(18, 2);
|
|
|
lcd_print(_error_1);
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Endstop"));
|
|
|
+ lcd_puts_at_P(0, 3, _i("Endstop"));
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_2);
|
|
|
break;
|
|
|
case TestError::Endstop:
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Endstop not hit"));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_T(MSG_SELFTEST_MOTOR));
|
|
|
+ lcd_puts_at_P(0, 2, _i("Endstop not hit"));
|
|
|
+ lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR));
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
case TestError::PrintFan:
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_T(MSG_SELFTEST_COOLING_FAN));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
|
|
|
+ lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_COOLING_FAN));
|
|
|
+ lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR));
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
case TestError::ExtruderFan:
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_T(MSG_SELFTEST_EXTRUDER_FAN));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
|
|
|
+ lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_EXTRUDER_FAN));
|
|
|
+ lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR));
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
case TestError::Pulley:
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Loose pulley"));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_T(MSG_SELFTEST_MOTOR));
|
|
|
+ lcd_puts_at_P(0, 2, _i("Loose pulley"));
|
|
|
+ lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR));
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
case TestError::Axis:
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Axis length"));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Axis"));
|
|
|
+ lcd_puts_at_P(0, 2, _i("Axis length"));
|
|
|
+ lcd_puts_at_P(0, 3, _i("Axis"));
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
case TestError::SwappedFan:
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_i("Front/left fans"));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("Swapped"));
|
|
|
+ lcd_puts_at_P(0, 2, _i("Front/left fans"));
|
|
|
+ lcd_puts_at_P(0, 3, _i("Swapped"));
|
|
|
lcd_set_cursor(18, 3);
|
|
|
lcd_print(_error_1);
|
|
|
break;
|
|
|
case TestError::WiringFsensor:
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_T(MSG_SELFTEST_FILAMENT_SENSOR));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_T(MSG_SELFTEST_WIRINGERROR));
|
|
|
+ lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR));
|
|
|
+ lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR));
|
|
|
break;
|
|
|
case TestError::TriggeringFsensor:
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_T(MSG_SELFTEST_FILAMENT_SENSOR));
|
|
|
- lcd_set_cursor(0, 3);
|
|
|
- lcd_puts_P(_i("False triggering"));
|
|
|
+ lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR));
|
|
|
+ lcd_puts_at_P(0, 3, _i("False triggering"));
|
|
|
break;
|
|
|
case TestError::FsensorLevel:
|
|
|
- lcd_set_cursor(0, 2);
|
|
|
- lcd_puts_P(_T(MSG_SELFTEST_FILAMENT_SENSOR));
|
|
|
+ lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR));
|
|
|
lcd_set_cursor(0, 3);
|
|
|
lcd_printf_P(_i("%s level expected"),_error_1);
|
|
|
break;
|
|
@@ -8454,7 +8202,7 @@ static bool selftest_irsensor()
|
|
|
mmu_load_step(false);
|
|
|
while (blocks_queued())
|
|
|
{
|
|
|
- if (PIN_GET(IR_SENSOR_PIN) == 0)
|
|
|
+ if (READ(IR_SENSOR_PIN) == 0)
|
|
|
{
|
|
|
lcd_selftest_error(TestError::TriggeringFsensor, "", "");
|
|
|
return false;
|
|
@@ -8484,23 +8232,18 @@ static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite,
|
|
|
bool _result = check_opposite;
|
|
|
lcd_clear();
|
|
|
|
|
|
- lcd_set_cursor(0, 0); lcd_puts_P(_T(MSG_SELFTEST_FAN));
|
|
|
+ lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN));
|
|
|
|
|
|
switch (_fan)
|
|
|
{
|
|
|
case 0:
|
|
|
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
- if(check_opposite == true) lcd_puts_P(_T(MSG_SELFTEST_COOLING_FAN));
|
|
|
- else lcd_puts_P(_T(MSG_SELFTEST_EXTRUDER_FAN));
|
|
|
- SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN);
|
|
|
- WRITE(EXTRUDER_0_AUTO_FAN_PIN, 1);
|
|
|
+ lcd_puts_at_P(0, 1, check_opposite ? _T(MSG_SELFTEST_COOLING_FAN) : _T(MSG_SELFTEST_EXTRUDER_FAN));
|
|
|
+ setExtruderAutoFanState(3);
|
|
|
break;
|
|
|
case 1:
|
|
|
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
- if (check_opposite == true) lcd_puts_P(_T(MSG_SELFTEST_EXTRUDER_FAN));
|
|
|
- else lcd_puts_P(_T(MSG_SELFTEST_COOLING_FAN));
|
|
|
+ lcd_puts_at_P(0, 1, check_opposite ? _T(MSG_SELFTEST_EXTRUDER_FAN) : _T(MSG_SELFTEST_COOLING_FAN));
|
|
|
SET_OUTPUT(FAN_PIN);
|
|
|
#ifdef FAN_SOFT_PWM
|
|
|
fanSpeedSoftPwm = 255;
|
|
@@ -8512,9 +8255,9 @@ static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite,
|
|
|
}
|
|
|
_delay(500);
|
|
|
|
|
|
- lcd_set_cursor(1, 2); lcd_puts_P(_T(MSG_SELFTEST_FAN_YES));
|
|
|
- lcd_set_cursor(0, 3); lcd_print(">");
|
|
|
- lcd_set_cursor(1, 3); lcd_puts_P(_T(MSG_SELFTEST_FAN_NO));
|
|
|
+ lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES));
|
|
|
+ lcd_putc_at(0, 3, '>');
|
|
|
+ lcd_puts_at_P(1, 3, _T(MSG_SELFTEST_FAN_NO));
|
|
|
|
|
|
int8_t enc_dif = int(_default)*3;
|
|
|
|
|
@@ -8523,38 +8266,21 @@ static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite,
|
|
|
lcd_button_pressed = false;
|
|
|
do
|
|
|
{
|
|
|
- switch (_fan)
|
|
|
- {
|
|
|
- case 0:
|
|
|
-
|
|
|
- SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN);
|
|
|
- WRITE(EXTRUDER_0_AUTO_FAN_PIN, 1);
|
|
|
- break;
|
|
|
- case 1:
|
|
|
-
|
|
|
- SET_OUTPUT(FAN_PIN);
|
|
|
-#ifdef FAN_SOFT_PWM
|
|
|
- fanSpeedSoftPwm = 255;
|
|
|
-#else
|
|
|
- analogWrite(FAN_PIN, 255);
|
|
|
-#endif
|
|
|
- break;
|
|
|
- }
|
|
|
if (abs((enc_dif - lcd_encoder_diff)) > 2) {
|
|
|
if (enc_dif > lcd_encoder_diff) {
|
|
|
_result = !check_opposite;
|
|
|
- lcd_set_cursor(0, 2); lcd_print(">");
|
|
|
- lcd_set_cursor(1, 2); lcd_puts_P(_T(MSG_SELFTEST_FAN_YES));
|
|
|
- lcd_set_cursor(0, 3); lcd_print(" ");
|
|
|
- lcd_set_cursor(1, 3); lcd_puts_P(_T(MSG_SELFTEST_FAN_NO));
|
|
|
+ lcd_putc_at(0, 2, '>');
|
|
|
+ lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES));
|
|
|
+ lcd_putc_at(0, 3, ' ');
|
|
|
+ lcd_puts_at_P(1, 3, _T(MSG_SELFTEST_FAN_NO));
|
|
|
}
|
|
|
|
|
|
if (enc_dif < lcd_encoder_diff) {
|
|
|
_result = check_opposite;
|
|
|
- lcd_set_cursor(0, 2); lcd_print(" ");
|
|
|
- lcd_set_cursor(1, 2); lcd_puts_P(_T(MSG_SELFTEST_FAN_YES));
|
|
|
- lcd_set_cursor(0, 3); lcd_print(">");
|
|
|
- lcd_set_cursor(1, 3); lcd_puts_P(_T(MSG_SELFTEST_FAN_NO));
|
|
|
+ lcd_putc_at(0, 2, ' ');
|
|
|
+ lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES));
|
|
|
+ lcd_putc_at(0, 3, '>');
|
|
|
+ lcd_puts_at_P(1, 3, _T(MSG_SELFTEST_FAN_NO));
|
|
|
}
|
|
|
enc_dif = 0;
|
|
|
lcd_encoder_diff = 0;
|
|
@@ -8566,8 +8292,7 @@ static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite,
|
|
|
|
|
|
} while (!lcd_clicked());
|
|
|
KEEPALIVE_STATE(IN_HANDLER);
|
|
|
- SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN);
|
|
|
- WRITE(EXTRUDER_0_AUTO_FAN_PIN, 0);
|
|
|
+ setExtruderAutoFanState(0);
|
|
|
SET_OUTPUT(FAN_PIN);
|
|
|
#ifdef FAN_SOFT_PWM
|
|
|
fanSpeedSoftPwm = 0;
|
|
@@ -8587,20 +8312,20 @@ static FanCheck lcd_selftest_fan_auto(int _fan)
|
|
|
case 0:
|
|
|
fanSpeed = 0;
|
|
|
manage_heater();
|
|
|
- setExtruderAutoFanState(EXTRUDER_0_AUTO_FAN_PIN, 1);
|
|
|
+ setExtruderAutoFanState(3);
|
|
|
#ifdef FAN_SOFT_PWM
|
|
|
extruder_autofan_last_check = _millis();
|
|
|
fan_measuring = true;
|
|
|
#endif
|
|
|
- _delay(2000);
|
|
|
-
|
|
|
+ _delay(2000);
|
|
|
+ setExtruderAutoFanState(0);
|
|
|
manage_heater();
|
|
|
|
|
|
- printf_P(PSTR("Test 1:\n"));
|
|
|
- printf_P(PSTR("Print fan speed: %d \n"), fan_speed[1]);
|
|
|
- printf_P(PSTR("Extr fan speed: %d \n"), fan_speed[0]);
|
|
|
+ puts_P(PSTR("Test 1:"));
|
|
|
+ printf_P(PSTR("Print fan speed: %d\n"), fan_speed[1]);
|
|
|
+ printf_P(PSTR("Extr fan speed: %d\n"), fan_speed[0]);
|
|
|
|
|
|
- if (!fan_speed[0]) {
|
|
|
+ if (fan_speed[0] < 20) {
|
|
|
return FanCheck::ExtruderFan;
|
|
|
}
|
|
|
#ifdef FAN_SOFT_PWM
|
|
@@ -8622,11 +8347,9 @@ static FanCheck lcd_selftest_fan_auto(int _fan)
|
|
|
#endif
|
|
|
for (uint8_t i = 0; i < 5; i++) {
|
|
|
delay_keep_alive(1000);
|
|
|
- lcd_set_cursor(18, 3);
|
|
|
- lcd_print("-");
|
|
|
+ lcd_putc_at(18, 3, '-');
|
|
|
delay_keep_alive(1000);
|
|
|
- lcd_set_cursor(18, 3);
|
|
|
- lcd_print("|");
|
|
|
+ lcd_putc_at(18, 3, '|');
|
|
|
}
|
|
|
fanSpeed = 0;
|
|
|
|
|
@@ -8636,9 +8359,9 @@ static FanCheck lcd_selftest_fan_auto(int _fan)
|
|
|
manage_heater();
|
|
|
manage_inactivity(true);
|
|
|
#endif
|
|
|
- printf_P(PSTR("Test 2:\n"));
|
|
|
- printf_P(PSTR("Print fan speed: %d \n"), fan_speed[1]);
|
|
|
- printf_P(PSTR("Extr fan speed: %d \n"), fan_speed[0]);
|
|
|
+ puts_P(PSTR("Test 2:"));
|
|
|
+ printf_P(PSTR("Print fan speed: %d\n"), fan_speed[1]);
|
|
|
+ printf_P(PSTR("Extr fan speed: %d\n"), fan_speed[0]);
|
|
|
if (!fan_speed[1]) {
|
|
|
return FanCheck::PrintFan;
|
|
|
}
|
|
@@ -8649,11 +8372,9 @@ static FanCheck lcd_selftest_fan_auto(int _fan)
|
|
|
|
|
|
for (uint8_t i = 0; i < 5; i++) {
|
|
|
delay_keep_alive(1000);
|
|
|
- lcd_set_cursor(18, 3);
|
|
|
- lcd_print("-");
|
|
|
+ lcd_putc_at(18, 3, '-');
|
|
|
delay_keep_alive(1000);
|
|
|
- lcd_set_cursor(18, 3);
|
|
|
- lcd_print("|");
|
|
|
+ lcd_putc_at(18, 3, '|');
|
|
|
}
|
|
|
fanSpeed = 0;
|
|
|
|
|
@@ -8678,7 +8399,7 @@ static FanCheck lcd_selftest_fan_auto(int _fan)
|
|
|
static int lcd_selftest_screen(TestScreen screen, int _progress, int _progress_scale, bool _clear, int _delay)
|
|
|
{
|
|
|
|
|
|
- lcd_update_enable(false);
|
|
|
+ lcd_update_enable(false);
|
|
|
|
|
|
const char *_indicator = (_progress >= _progress_scale) ? "-" : "|";
|
|
|
|
|
@@ -8691,8 +8412,8 @@ static int lcd_selftest_screen(TestScreen screen, int _progress, int _progress_s
|
|
|
if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN));
|
|
|
if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN));
|
|
|
if (screen == TestScreen::EndStops) lcd_puts_P(_i("Checking endstops"));
|
|
|
- if (screen == TestScreen::AxisX) lcd_puts_P(_i("Checking X axis "));
|
|
|
- if (screen == TestScreen::AxisY) lcd_puts_P(_i("Checking Y axis "));
|
|
|
+ if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X));
|
|
|
+ if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y));
|
|
|
if (screen == TestScreen::AxisZ) lcd_puts_P(_i("Checking Z axis "));
|
|
|
if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED));
|
|
|
if (screen == TestScreen::Hotend
|
|
@@ -8703,8 +8424,7 @@ static int lcd_selftest_screen(TestScreen screen, int _progress, int _progress_s
|
|
|
if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED));
|
|
|
if (screen == TestScreen::Home) lcd_puts_P(_i("Calibrating home"));
|
|
|
|
|
|
- lcd_set_cursor(0, 1);
|
|
|
- lcd_puts_P(separator);
|
|
|
+ lcd_puts_at_P(0, 1, separator);
|
|
|
if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk))
|
|
|
{
|
|
|
|
|
@@ -8726,20 +8446,20 @@ static int lcd_selftest_screen(TestScreen screen, int _progress, int _progress_s
|
|
|
{
|
|
|
|
|
|
|
|
|
- TestScreen _step_block = TestScreen::AxisX;
|
|
|
- lcd_selftest_screen_step(2, 2, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "X", _indicator);
|
|
|
+ TestScreen _step_block = TestScreen::AxisX;
|
|
|
+ lcd_selftest_screen_step(2, 2, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("X"), _indicator);
|
|
|
|
|
|
_step_block = TestScreen::AxisY;
|
|
|
- lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Y", _indicator);
|
|
|
+ lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator);
|
|
|
|
|
|
_step_block = TestScreen::AxisZ;
|
|
|
- lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Z", _indicator);
|
|
|
+ lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator);
|
|
|
|
|
|
_step_block = TestScreen::Bed;
|
|
|
- lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Bed", _indicator);
|
|
|
+ lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator);
|
|
|
|
|
|
- _step_block = TestScreen::Hotend;
|
|
|
- lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), "Hotend", _indicator);
|
|
|
+ _step_block = TestScreen::Hotend;
|
|
|
+ lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator);
|
|
|
}
|
|
|
|
|
|
if (_delay > 0) delay_keep_alive(_delay);
|
|
@@ -8748,28 +8468,26 @@ static int lcd_selftest_screen(TestScreen screen, int _progress, int _progress_s
|
|
|
return (_progress >= _progress_scale * 2) ? 0 : _progress;
|
|
|
}
|
|
|
|
|
|
-static void lcd_selftest_screen_step(int _row, int _col, int _state, const char *_name, const char *_indicator)
|
|
|
+static void lcd_selftest_screen_step(int _row, int _col, int _state, const char *_name_PROGMEM, const char *_indicator)
|
|
|
{
|
|
|
lcd_set_cursor(_col, _row);
|
|
|
+ uint8_t strlenNameP = strlen_P(_name_PROGMEM);
|
|
|
|
|
|
switch (_state)
|
|
|
{
|
|
|
case 1:
|
|
|
- lcd_print(_name);
|
|
|
- lcd_set_cursor(_col + strlen(_name), _row);
|
|
|
- lcd_print(":");
|
|
|
- lcd_set_cursor(_col + strlen(_name) + 1, _row);
|
|
|
+ lcd_puts_P(_name_PROGMEM);
|
|
|
+ lcd_putc_at(_col + strlenNameP, _row, ':');
|
|
|
+ lcd_set_cursor(_col + strlenNameP + 1, _row);
|
|
|
lcd_print(_indicator);
|
|
|
break;
|
|
|
case 2:
|
|
|
- lcd_print(_name);
|
|
|
- lcd_set_cursor(_col + strlen(_name), _row);
|
|
|
- lcd_print(":");
|
|
|
- lcd_set_cursor(_col + strlen(_name) + 1, _row);
|
|
|
- lcd_print("OK");
|
|
|
+ lcd_puts_P(_name_PROGMEM);
|
|
|
+ lcd_putc_at(_col + strlenNameP, _row, ':');
|
|
|
+ lcd_puts_at_P(_col + strlenNameP + 1, _row, PSTR("OK"));
|
|
|
break;
|
|
|
default:
|
|
|
- lcd_print(_name);
|
|
|
+ lcd_puts_P(_name_PROGMEM);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -8780,26 +8498,42 @@ static void lcd_selftest_screen_step(int _row, int _col, int _state, const char
|
|
|
|
|
|
static bool check_file(const char* filename) {
|
|
|
if (farm_mode) return true;
|
|
|
- bool result = false;
|
|
|
- uint32_t filesize;
|
|
|
card.openFile((char*)filename, true);
|
|
|
- filesize = card.getFileSize();
|
|
|
+ bool result = false;
|
|
|
+ const uint32_t filesize = card.getFileSize();
|
|
|
+ uint32_t startPos = 0;
|
|
|
+ const uint16_t bytesToCheck = min(END_FILE_SECTION, filesize);
|
|
|
+ uint8_t blocksPrinted = 0;
|
|
|
if (filesize > END_FILE_SECTION) {
|
|
|
- card.setIndex(filesize - END_FILE_SECTION);
|
|
|
-
|
|
|
+ startPos = filesize - END_FILE_SECTION;
|
|
|
+ card.setIndex(startPos);
|
|
|
}
|
|
|
-
|
|
|
- while (!card.eof() && !result) {
|
|
|
+ cmdqueue_reset();
|
|
|
+ cmdqueue_serial_disabled = true;
|
|
|
+
|
|
|
+ lcd_clear();
|
|
|
+ lcd_puts_at_P(0, 1, _i("Checking file"));
|
|
|
+ lcd_set_cursor(0, 2);
|
|
|
+ while (!card.eof() && !result) {
|
|
|
+ for (; blocksPrinted < (((card.get_sdpos() - startPos) * LCD_WIDTH) / bytesToCheck); blocksPrinted++)
|
|
|
+ lcd_print('\xFF');
|
|
|
+
|
|
|
card.sdprinting = true;
|
|
|
get_command();
|
|
|
result = check_commands();
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
+ for (; blocksPrinted < LCD_WIDTH; blocksPrinted++)
|
|
|
+ lcd_print('\xFF');
|
|
|
+ _delay(100);
|
|
|
+
|
|
|
+
|
|
|
+ cmdqueue_serial_disabled = false;
|
|
|
card.printingHasFinished();
|
|
|
+
|
|
|
strncpy_P(lcd_status_message, _T(WELCOME_MSG), LCD_WIDTH);
|
|
|
lcd_finishstatus();
|
|
|
return result;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
static void menu_action_sdfile(const char* filename)
|
|
@@ -8836,7 +8570,7 @@ static void menu_action_sdfile(const char* filename)
|
|
|
}
|
|
|
|
|
|
if (!check_file(filename)) {
|
|
|
- result = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("File incomplete. Continue anyway?"), false, false);
|
|
|
+ result = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("File incomplete. Continue anyway?"), false, false);
|
|
|
lcd_update_enable(true);
|
|
|
}
|
|
|
if (result) {
|
|
@@ -8967,6 +8701,7 @@ void lcd_ignore_click(bool b)
|
|
|
}
|
|
|
|
|
|
void lcd_finishstatus() {
|
|
|
+ SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED);
|
|
|
int len = strlen(lcd_status_message);
|
|
|
if (len > 0) {
|
|
|
while (len < LCD_WIDTH) {
|
|
@@ -8977,13 +8712,14 @@ void lcd_finishstatus() {
|
|
|
lcd_draw_update = 2;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
void lcd_setstatus(const char* message)
|
|
|
{
|
|
|
if (lcd_status_message_level > 0)
|
|
|
return;
|
|
|
- strncpy(lcd_status_message, message, LCD_WIDTH);
|
|
|
- lcd_finishstatus();
|
|
|
+ lcd_updatestatus(message);
|
|
|
}
|
|
|
+
|
|
|
void lcd_updatestatuspgm(const char *message){
|
|
|
strncpy_P(lcd_status_message, message, LCD_WIDTH);
|
|
|
lcd_status_message[LCD_WIDTH] = 0;
|
|
@@ -8998,12 +8734,29 @@ void lcd_setstatuspgm(const char* message)
|
|
|
return;
|
|
|
lcd_updatestatuspgm(message);
|
|
|
}
|
|
|
+
|
|
|
+void lcd_updatestatus(const char *message){
|
|
|
+ strncpy(lcd_status_message, message, LCD_WIDTH);
|
|
|
+ lcd_status_message[LCD_WIDTH] = 0;
|
|
|
+ lcd_finishstatus();
|
|
|
+
|
|
|
+ lcd_draw_update = 1;
|
|
|
+}
|
|
|
+
|
|
|
void lcd_setalertstatuspgm(const char* message)
|
|
|
{
|
|
|
lcd_setstatuspgm(message);
|
|
|
lcd_status_message_level = 1;
|
|
|
lcd_return_to_status();
|
|
|
}
|
|
|
+
|
|
|
+void lcd_setalertstatus(const char* message)
|
|
|
+{
|
|
|
+ lcd_setstatus(message);
|
|
|
+ lcd_status_message_level = 1;
|
|
|
+ lcd_return_to_status();
|
|
|
+}
|
|
|
+
|
|
|
void lcd_reset_alert_level()
|
|
|
{
|
|
|
lcd_status_message_level = 0;
|
|
@@ -9023,6 +8776,13 @@ void menu_lcd_longpress_func(void)
|
|
|
lcd_quick_feedback();
|
|
|
return;
|
|
|
}
|
|
|
+ if (menu_menu == lcd_hw_setup_menu)
|
|
|
+ {
|
|
|
+
|
|
|
+ lcd_quick_feedback();
|
|
|
+ lcd_experimental_toggle();
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
@@ -9186,3 +8946,39 @@ void lcd_crash_detect_disable()
|
|
|
eeprom_update_byte((uint8_t*)EEPROM_CRASH_DET, 0x00);
|
|
|
}
|
|
|
#endif
|
|
|
+
|
|
|
+void lcd_experimental_toggle()
|
|
|
+{
|
|
|
+ uint8_t oldVal = eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY);
|
|
|
+ if (oldVal == EEPROM_EMPTY_VALUE)
|
|
|
+ oldVal = 0;
|
|
|
+ else
|
|
|
+ oldVal = !oldVal;
|
|
|
+ eeprom_update_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, oldVal);
|
|
|
+}
|
|
|
+
|
|
|
+void lcd_experimental_menu()
|
|
|
+{
|
|
|
+ MENU_BEGIN();
|
|
|
+ MENU_ITEM_BACK_P(_T(MSG_BACK));
|
|
|
+
|
|
|
+#ifdef EXTRUDER_ALTFAN_DETECT
|
|
|
+ MENU_ITEM_TOGGLE_P(_N("ALTFAN det."), altfanOverride_get()?_T(MSG_OFF):_T(MSG_ON), altfanOverride_toggle);
|
|
|
+#endif
|
|
|
+
|
|
|
+ MENU_END();
|
|
|
+}
|
|
|
+
|
|
|
+#ifdef PINDA_TEMP_COMP
|
|
|
+void lcd_pinda_temp_compensation_toggle()
|
|
|
+{
|
|
|
+ uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION);
|
|
|
+ if (pinda_temp_compensation == EEPROM_EMPTY_VALUE)
|
|
|
+ pinda_temp_compensation = 1;
|
|
|
+ else
|
|
|
+ pinda_temp_compensation = !pinda_temp_compensation;
|
|
|
+ eeprom_update_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION, pinda_temp_compensation);
|
|
|
+ SERIAL_ECHOLNPGM("SuperPINDA:");
|
|
|
+ SERIAL_ECHOLN(pinda_temp_compensation);
|
|
|
+}
|
|
|
+#endif
|