|
@@ -27,6 +27,10 @@
|
|
#include "pat9125.h"
|
|
#include "pat9125.h"
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#ifdef FILAMENT_SENSOR
|
|
|
|
+#include "fsensor.h"
|
|
|
|
+#endif
|
|
|
|
+
|
|
#ifdef TMC2130
|
|
#ifdef TMC2130
|
|
#include "tmc2130.h"
|
|
#include "tmc2130.h"
|
|
#endif
|
|
#endif
|
|
@@ -38,12 +42,7 @@
|
|
|
|
|
|
extern int lcd_change_fil_state;
|
|
extern int lcd_change_fil_state;
|
|
extern bool fans_check_enabled;
|
|
extern bool fans_check_enabled;
|
|
-extern bool fsensor_autoload_enabled;
|
|
|
|
|
|
|
|
-#ifdef PAT9125
|
|
|
|
-extern bool fsensor_not_responding;
|
|
|
|
-extern bool fsensor_enabled;
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
int scrollstuff = 0;
|
|
int scrollstuff = 0;
|
|
char longFilenameOLD[LONG_FILENAME_LENGTH];
|
|
char longFilenameOLD[LONG_FILENAME_LENGTH];
|
|
@@ -2506,7 +2505,7 @@ void lcd_alright() {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-#ifdef PAT9125
|
|
+#ifdef FILAMENT_SENSOR
|
|
static void lcd_menu_AutoLoadFilament()
|
|
static void lcd_menu_AutoLoadFilament()
|
|
{
|
|
{
|
|
if (degHotend0() > EXTRUDE_MINTEMP)
|
|
if (degHotend0() > EXTRUDE_MINTEMP)
|
|
@@ -2526,7 +2525,7 @@ static void lcd_menu_AutoLoadFilament()
|
|
}
|
|
}
|
|
menu_back_if_clicked();
|
|
menu_back_if_clicked();
|
|
}
|
|
}
|
|
-#endif
|
|
+#endif
|
|
|
|
|
|
static void lcd_LoadFilament()
|
|
static void lcd_LoadFilament()
|
|
{
|
|
{
|
|
@@ -4024,7 +4023,7 @@ static void lcd_crash_mode_info2()
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-#ifdef PAT9125
|
|
+#ifdef FILAMENT_SENSOR
|
|
static void lcd_filament_autoload_info()
|
|
static void lcd_filament_autoload_info()
|
|
{
|
|
{
|
|
uint8_t nlines;
|
|
uint8_t nlines;
|
|
@@ -4050,7 +4049,7 @@ uint8_t nlines;
|
|
}
|
|
}
|
|
menu_back_if_clicked();
|
|
menu_back_if_clicked();
|
|
}
|
|
}
|
|
-#endif
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
static void lcd_silent_mode_set() {
|
|
static void lcd_silent_mode_set() {
|
|
@@ -4107,7 +4106,7 @@ static void lcd_crash_mode_set()
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
-#ifdef PAT9125
|
|
+#ifdef FILAMENT_SENSOR
|
|
static void lcd_fsensor_state_set()
|
|
static void lcd_fsensor_state_set()
|
|
{
|
|
{
|
|
FSensorStateMenu = !FSensorStateMenu;
|
|
FSensorStateMenu = !FSensorStateMenu;
|
|
@@ -4121,7 +4120,7 @@ static void lcd_fsensor_state_set()
|
|
menu_submenu(lcd_fsensor_fail);
|
|
menu_submenu(lcd_fsensor_fail);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-#endif
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
#if !SDSORT_USES_RAM
|
|
#if !SDSORT_USES_RAM
|
|
@@ -4581,130 +4580,120 @@ void lcd_settings_linearity_correction_menu(void)
|
|
*/
|
|
*/
|
|
static void lcd_settings_menu()
|
|
static void lcd_settings_menu()
|
|
{
|
|
{
|
|
- EEPROM_read(EEPROM_SILENT, (uint8_t*)&SilentModeMenu, sizeof(SilentModeMenu));
|
|
+ EEPROM_read(EEPROM_SILENT, (uint8_t*)&SilentModeMenu, sizeof(SilentModeMenu));
|
|
- MENU_BEGIN();
|
|
+ MENU_BEGIN();
|
|
- MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
+ MENU_ITEM_BACK_P(_T(MSG_MAIN));
|
|
|
|
|
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Temperature"), lcd_control_temperature_menu);
|
|
|
|
+ if (!homing_flag)
|
|
|
|
+ MENU_ITEM_SUBMENU_P(_i("Move axis"), lcd_move_menu_1mm);
|
|
|
|
+ if (!isPrintPaused)
|
|
|
|
+ MENU_ITEM_GCODE_P(_i("Disable steppers"), PSTR("M84"));
|
|
|
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Temperature"), lcd_control_temperature_menu);
|
|
|
|
- if (!homing_flag)
|
|
|
|
- {
|
|
|
|
- MENU_ITEM_SUBMENU_P(_i("Move axis"), lcd_move_menu_1mm);
|
|
|
|
- }
|
|
|
|
- if (!isPrintPaused)
|
|
|
|
- {
|
|
|
|
- MENU_ITEM_GCODE_P(_i("Disable steppers"), PSTR("M84"));
|
|
|
|
- }
|
|
|
|
#ifndef TMC2130
|
|
#ifndef TMC2130
|
|
- if (!farm_mode) {
|
|
+ if (!farm_mode)
|
|
- switch (SilentModeMenu) {
|
|
+ {
|
|
- case SILENT_MODE_POWER: MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_OFF), lcd_silent_mode_set); break;
|
|
+ switch (SilentModeMenu)
|
|
- case SILENT_MODE_SILENT: MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_ON), lcd_silent_mode_set); break;
|
|
+ {
|
|
- case SILENT_MODE_AUTO: MENU_ITEM_FUNCTION_P(_T(MSG_AUTO_MODE_ON), lcd_silent_mode_set); break;
|
|
+ case SILENT_MODE_POWER: MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_OFF), lcd_silent_mode_set); break;
|
|
- default: MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_OFF), lcd_silent_mode_set); break;
|
|
+ case SILENT_MODE_SILENT: MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_ON), lcd_silent_mode_set); break;
|
|
- }
|
|
+ case SILENT_MODE_AUTO: MENU_ITEM_FUNCTION_P(_T(MSG_AUTO_MODE_ON), lcd_silent_mode_set); break;
|
|
- }
|
|
+ default: MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_OFF), lcd_silent_mode_set); break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-#ifdef PAT9125
|
|
+#ifdef FILAMENT_SENSOR
|
|
-#ifndef DEBUG_DISABLE_FSENSORCHECK
|
|
+ if (FSensorStateMenu == 0)
|
|
- if (FSensorStateMenu == 0) {
|
|
+ {
|
|
- if (fsensor_not_responding){
|
|
+ if (fsensor_not_responding)
|
|
-
|
|
+ {
|
|
- MENU_ITEM_FUNCTION_P(_i("Fil. sensor [N/A]"), lcd_fsensor_state_set);
|
|
+
|
|
- MENU_ITEM_SUBMENU_P(_T(MSG_FSENS_AUTOLOAD_NA), lcd_fsensor_fail);
|
|
+ MENU_ITEM_FUNCTION_P(_i("Fil. sensor [N/A]"), lcd_fsensor_state_set);
|
|
- }
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_FSENS_AUTOLOAD_NA), lcd_fsensor_fail);
|
|
- else{
|
|
+ }
|
|
-
|
|
+ else
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_OFF), lcd_fsensor_state_set);
|
|
+ {
|
|
- MENU_ITEM_SUBMENU_P(_T(MSG_FSENS_AUTOLOAD_NA), lcd_filament_autoload_info);
|
|
+
|
|
- }
|
|
+ MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_OFF), lcd_fsensor_state_set);
|
|
- } else {
|
|
+ MENU_ITEM_SUBMENU_P(_T(MSG_FSENS_AUTOLOAD_NA), lcd_filament_autoload_info);
|
|
-
|
|
+ }
|
|
- MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_ON), lcd_fsensor_state_set);
|
|
+ }
|
|
-
|
|
+ else
|
|
-
|
|
+ {
|
|
- if (fsensor_autoload_enabled) {
|
|
+
|
|
- MENU_ITEM_FUNCTION_P(_i("F. autoload [on]"), lcd_set_filament_autoload);
|
|
+ MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_ON), lcd_fsensor_state_set);
|
|
- }
|
|
+ if (fsensor_autoload_enabled)
|
|
- else {
|
|
+ MENU_ITEM_FUNCTION_P(_i("F. autoload [on]"), lcd_set_filament_autoload);
|
|
- MENU_ITEM_FUNCTION_P(_i("F. autoload [off]"), lcd_set_filament_autoload);
|
|
+ else
|
|
- }
|
|
+ MENU_ITEM_FUNCTION_P(_i("F. autoload [off]"), lcd_set_filament_autoload);
|
|
-
|
|
+ }
|
|
- }
|
|
+#endif
|
|
-#endif
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
- if (fans_check_enabled == true) {
|
|
+ if (fans_check_enabled == true)
|
|
- MENU_ITEM_FUNCTION_P(_i("Fans check [on]"), lcd_set_fan_check);
|
|
+ MENU_ITEM_FUNCTION_P(_i("Fans check [on]"), lcd_set_fan_check);
|
|
- }
|
|
+ else
|
|
- else {
|
|
+ MENU_ITEM_FUNCTION_P(_i("Fans check [off]"), lcd_set_fan_check);
|
|
- MENU_ITEM_FUNCTION_P(_i("Fans check [off]"), lcd_set_fan_check);
|
|
|
|
- }
|
|
|
|
|
|
|
|
#ifdef TMC2130
|
|
#ifdef TMC2130
|
|
- if(!farm_mode)
|
|
+ if(!farm_mode)
|
|
- {
|
|
+ {
|
|
- if (SilentModeMenu == SILENT_MODE_NORMAL) { MENU_ITEM_FUNCTION_P(_T(MSG_STEALTH_MODE_OFF), lcd_silent_mode_set); }
|
|
+ if (SilentModeMenu == SILENT_MODE_NORMAL) { MENU_ITEM_FUNCTION_P(_T(MSG_STEALTH_MODE_OFF), lcd_silent_mode_set); }
|
|
- else MENU_ITEM_FUNCTION_P(_T(MSG_STEALTH_MODE_ON), lcd_silent_mode_set);
|
|
+ else MENU_ITEM_FUNCTION_P(_T(MSG_STEALTH_MODE_ON), lcd_silent_mode_set);
|
|
- if (SilentModeMenu == SILENT_MODE_NORMAL)
|
|
+ if (SilentModeMenu == SILENT_MODE_NORMAL)
|
|
- {
|
|
+ {
|
|
- if (CrashDetectMenu == 0) { MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_OFF), lcd_crash_mode_set); }
|
|
+ if (CrashDetectMenu == 0) { MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_OFF), lcd_crash_mode_set); }
|
|
- else MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_ON), lcd_crash_mode_set);
|
|
+ else MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_ON), lcd_crash_mode_set);
|
|
- }
|
|
+ }
|
|
- else MENU_ITEM_SUBMENU_P(_T(MSG_CRASHDETECT_NA), lcd_crash_mode_info);
|
|
+ else MENU_ITEM_SUBMENU_P(_T(MSG_CRASHDETECT_NA), lcd_crash_mode_info);
|
|
- }
|
|
+ }
|
|
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
- if (temp_cal_active == false) {
|
|
+ if (temp_cal_active == false)
|
|
MENU_ITEM_FUNCTION_P(_i("Temp. cal. [off]"), lcd_temp_calibration_set);
|
|
MENU_ITEM_FUNCTION_P(_i("Temp. cal. [off]"), lcd_temp_calibration_set);
|
|
- }
|
|
+ else
|
|
- else {
|
|
|
|
MENU_ITEM_FUNCTION_P(_i("Temp. cal. [on]"), lcd_temp_calibration_set);
|
|
MENU_ITEM_FUNCTION_P(_i("Temp. cal. [on]"), lcd_temp_calibration_set);
|
|
- }
|
|
+
|
|
#ifdef HAS_SECOND_SERIAL_PORT
|
|
#ifdef HAS_SECOND_SERIAL_PORT
|
|
- if (selectedSerialPort == 0) {
|
|
+ if (selectedSerialPort == 0)
|
|
- MENU_ITEM_FUNCTION_P(_i("RPi port [off]"), lcd_second_serial_set);
|
|
+ MENU_ITEM_FUNCTION_P(_i("RPi port [off]"), lcd_second_serial_set);
|
|
- }
|
|
+ else
|
|
- else {
|
|
+ MENU_ITEM_FUNCTION_P(_i("RPi port [on]"), lcd_second_serial_set);
|
|
- MENU_ITEM_FUNCTION_P(_i("RPi port [on]"), lcd_second_serial_set);
|
|
|
|
- }
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
- if (!isPrintPaused && !homing_flag)
|
|
+ if (!isPrintPaused && !homing_flag)
|
|
- {
|
|
|
|
MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);
|
|
MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);
|
|
- }
|
|
|
|
|
|
|
|
#if (LANG_MODE != 0)
|
|
#if (LANG_MODE != 0)
|
|
MENU_ITEM_SUBMENU_P(_i("Select language"), lcd_language_menu);
|
|
MENU_ITEM_SUBMENU_P(_i("Select language"), lcd_language_menu);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
- if (card.ToshibaFlashAir_isEnabled()) {
|
|
+ if (card.ToshibaFlashAir_isEnabled())
|
|
- MENU_ITEM_FUNCTION_P(_i("SD card [FlshAir]"), lcd_toshiba_flash_air_compatibility_toggle);
|
|
+ MENU_ITEM_FUNCTION_P(_i("SD card [FlshAir]"), lcd_toshiba_flash_air_compatibility_toggle);
|
|
- } else {
|
|
+ else
|
|
- MENU_ITEM_FUNCTION_P(_i("SD card [normal]"), lcd_toshiba_flash_air_compatibility_toggle);
|
|
+ MENU_ITEM_FUNCTION_P(_i("SD card [normal]"), lcd_toshiba_flash_air_compatibility_toggle);
|
|
- }
|
|
|
|
|
|
|
|
- #ifdef SDCARD_SORT_ALPHA
|
|
+#ifdef SDCARD_SORT_ALPHA
|
|
- if (!farm_mode) {
|
|
+ if (!farm_mode)
|
|
- uint8_t sdSort;
|
|
+ {
|
|
- EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));
|
|
+ uint8_t sdSort;
|
|
- switch (sdSort) {
|
|
+ EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));
|
|
|
|
+ switch (sdSort)
|
|
|
|
+ {
|
|
case SD_SORT_TIME: MENU_ITEM_FUNCTION_P(_i("Sort: [Time]"), lcd_sort_type_set); break;
|
|
case SD_SORT_TIME: MENU_ITEM_FUNCTION_P(_i("Sort: [Time]"), lcd_sort_type_set); break;
|
|
case SD_SORT_ALPHA: MENU_ITEM_FUNCTION_P(_i("Sort: [Alphabet]"), lcd_sort_type_set); break;
|
|
case SD_SORT_ALPHA: MENU_ITEM_FUNCTION_P(_i("Sort: [Alphabet]"), lcd_sort_type_set); break;
|
|
default: MENU_ITEM_FUNCTION_P(_i("Sort: [None]"), lcd_sort_type_set);
|
|
default: MENU_ITEM_FUNCTION_P(_i("Sort: [None]"), lcd_sort_type_set);
|
|
- }
|
|
+ }
|
|
- }
|
|
+ }
|
|
- #endif
|
|
+#endif
|
|
|
|
|
|
- if (farm_mode)
|
|
+ if (farm_mode)
|
|
- {
|
|
+ {
|
|
- MENU_ITEM_SUBMENU_P(PSTR("Farm number"), lcd_farm_no);
|
|
+ MENU_ITEM_SUBMENU_P(PSTR("Farm number"), lcd_farm_no);
|
|
MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode);
|
|
MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode);
|
|
- }
|
|
+ }
|
|
|
|
|
|
MENU_END();
|
|
MENU_END();
|
|
}
|
|
}
|
|
@@ -5962,7 +5951,7 @@ static void lcd_main_menu()
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#else
|
|
#else
|
|
- #ifdef PAT9125
|
|
+ #ifdef FILAMENT_SENSOR
|
|
if ( ((fsensor_autoload_enabled == true) && (fsensor_enabled == true)))
|
|
if ( ((fsensor_autoload_enabled == true) && (fsensor_enabled == true)))
|
|
MENU_ITEM_SUBMENU_P(_i("AutoLoad filament"), lcd_menu_AutoLoadFilament);
|
|
MENU_ITEM_SUBMENU_P(_i("AutoLoad filament"), lcd_menu_AutoLoadFilament);
|
|
else
|
|
else
|
|
@@ -6092,16 +6081,14 @@ static void lcd_tune_menu()
|
|
MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);
|
|
MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-#ifndef DEBUG_DISABLE_FSENSORCHECK
|
|
+#ifdef FILAMENT_SENSOR
|
|
-#ifdef PAT9125
|
|
|
|
if (FSensorStateMenu == 0) {
|
|
if (FSensorStateMenu == 0) {
|
|
MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_OFF), lcd_fsensor_state_set);
|
|
MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_OFF), lcd_fsensor_state_set);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_ON), lcd_fsensor_state_set);
|
|
MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_ON), lcd_fsensor_state_set);
|
|
}
|
|
}
|
|
-#endif
|
|
+#endif
|
|
-#endif
|
|
|
|
|
|
|
|
#ifdef TMC2130
|
|
#ifdef TMC2130
|
|
if(!farm_mode)
|
|
if(!farm_mode)
|
|
@@ -6454,16 +6441,16 @@ bool lcd_selftest()
|
|
if (_result)
|
|
if (_result)
|
|
{
|
|
{
|
|
_progress = lcd_selftest_screen(8, _progress, 3, true, 2000);
|
|
_progress = lcd_selftest_screen(8, _progress, 3, true, 2000);
|
|
-#ifdef PAT9125
|
|
+#ifdef FILAMENT_SENSOR
|
|
_progress = lcd_selftest_screen(9, _progress, 3, true, 2000);
|
|
_progress = lcd_selftest_screen(9, _progress, 3, true, 2000);
|
|
_result = lcd_selftest_fsensor();
|
|
_result = lcd_selftest_fsensor();
|
|
-#endif
|
|
+#endif
|
|
}
|
|
}
|
|
if (_result)
|
|
if (_result)
|
|
{
|
|
{
|
|
-#ifdef PAT9125
|
|
+#ifdef FILAMENT_SENSOR
|
|
_progress = lcd_selftest_screen(10, _progress, 3, true, 2000);
|
|
_progress = lcd_selftest_screen(10, _progress, 3, true, 2000);
|
|
-#endif
|
|
+#endif
|
|
_progress = lcd_selftest_screen(11, _progress, 3, true, 5000);
|
|
_progress = lcd_selftest_screen(11, _progress, 3, true, 5000);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
@@ -7012,17 +6999,18 @@ static void lcd_selftest_error(int _error_no, const char *_error_1, const char *
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-#ifdef PAT9125
|
|
+#ifdef FILAMENT_SENSOR
|
|
-static bool lcd_selftest_fsensor() {
|
|
+static bool lcd_selftest_fsensor(void)
|
|
|
|
+{
|
|
fsensor_init();
|
|
fsensor_init();
|
|
if (fsensor_not_responding)
|
|
if (fsensor_not_responding)
|
|
{
|
|
{
|
|
const char *_err;
|
|
const char *_err;
|
|
lcd_selftest_error(11, _err, _err);
|
|
lcd_selftest_error(11, _err, _err);
|
|
}
|
|
}
|
|
- return(!fsensor_not_responding);
|
|
+ return (!fsensor_not_responding);
|
|
}
|
|
}
|
|
-#endif
|
|
+#endif
|
|
|
|
|
|
static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite)
|
|
static bool lcd_selftest_manual_fan_check(int _fan, bool check_opposite)
|
|
{
|
|
{
|