Host keep alive messages
This commit is contained in:
parent
2b657ba786
commit
9e73c96223
|
|
@ -261,7 +261,7 @@
|
||||||
#define SD_SORT_ALPHA 1
|
#define SD_SORT_ALPHA 1
|
||||||
#define SD_SORT_NONE 2
|
#define SD_SORT_NONE 2
|
||||||
|
|
||||||
#define SDSORT_LIMIT 40 // Maximum number of sorted items (10-256).
|
#define SDSORT_LIMIT 20 // Maximum number of sorted items (10-256).
|
||||||
#define FOLDER_SORTING -1 // -1=above 0=none 1=below
|
#define FOLDER_SORTING -1 // -1=above 0=none 1=below
|
||||||
#define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code.
|
#define SDSORT_GCODE false // Allow turning sorting on/off with LCD and M34 g-code.
|
||||||
#define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting.
|
#define SDSORT_USES_RAM true // Pre-allocate a static array for faster pre-sorting.
|
||||||
|
|
|
||||||
|
|
@ -318,8 +318,6 @@ extern void digipot_i2c_set_current( int channel, float current );
|
||||||
extern void digipot_i2c_init();
|
extern void digipot_i2c_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//Long pause
|
//Long pause
|
||||||
extern int saved_feedmultiply;
|
extern int saved_feedmultiply;
|
||||||
extern float HotendTempBckp;
|
extern float HotendTempBckp;
|
||||||
|
|
@ -352,8 +350,29 @@ float d_ReadData();
|
||||||
void bed_analysis(float x_dimension, float y_dimension, int x_points_num, int y_points_num, float shift_x, float shift_y);
|
void bed_analysis(float x_dimension, float y_dimension, int x_points_num, int y_points_num, float shift_x, float shift_y);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
float temp_comp_interpolation(float temperature);
|
float temp_comp_interpolation(float temperature);
|
||||||
void temp_compensation_apply();
|
void temp_compensation_apply();
|
||||||
void temp_compensation_start();
|
void temp_compensation_start();
|
||||||
void wait_for_heater(long codenum);
|
void wait_for_heater(long codenum);
|
||||||
void serialecho_temperatures();
|
void serialecho_temperatures();
|
||||||
|
|
||||||
|
#ifdef HOST_KEEPALIVE_FEATURE
|
||||||
|
|
||||||
|
// States for managing Marlin and host communication
|
||||||
|
// Marlin sends messages if blocked or busy
|
||||||
|
enum MarlinBusyState {
|
||||||
|
NOT_BUSY, // Not in a handler
|
||||||
|
IN_HANDLER, // Processing a GCode
|
||||||
|
IN_PROCESS, // Known to be blocking command input (as in G29)
|
||||||
|
PAUSED_FOR_USER, // Blocking pending any input
|
||||||
|
PAUSED_FOR_INPUT // Blocking pending text input (concept)
|
||||||
|
};
|
||||||
|
|
||||||
|
#define KEEPALIVE_STATE(n) do { busy_state = n;} while (0)
|
||||||
|
extern void host_keepalive();
|
||||||
|
extern MarlinBusyState busy_state;
|
||||||
|
|
||||||
|
#endif //HOST_KEEPALIVE_FEATURE
|
||||||
|
|
||||||
|
#endif //ifndef marlin.h
|
||||||
|
|
|
||||||
|
|
@ -372,20 +372,10 @@ int fanSpeed=0;
|
||||||
bool cancel_heatup = false ;
|
bool cancel_heatup = false ;
|
||||||
|
|
||||||
#ifdef HOST_KEEPALIVE_FEATURE
|
#ifdef HOST_KEEPALIVE_FEATURE
|
||||||
// States for managing Marlin and host communication
|
|
||||||
// Marlin sends messages if blocked or busy
|
MarlinBusyState busy_state = NOT_BUSY;
|
||||||
enum MarlinBusyState {
|
|
||||||
NOT_BUSY, // Not in a handler
|
|
||||||
IN_HANDLER, // Processing a GCode
|
|
||||||
IN_PROCESS, // Known to be blocking command input (as in G29)
|
|
||||||
PAUSED_FOR_USER, // Blocking pending any input
|
|
||||||
PAUSED_FOR_INPUT // Blocking pending text input (concept)
|
|
||||||
};
|
|
||||||
|
|
||||||
static MarlinBusyState busy_state = NOT_BUSY;
|
|
||||||
static long prev_busy_signal_ms = -1;
|
static long prev_busy_signal_ms = -1;
|
||||||
uint8_t host_keepalive_interval = HOST_KEEPALIVE_INTERVAL;
|
uint8_t host_keepalive_interval = HOST_KEEPALIVE_INTERVAL;
|
||||||
#define KEEPALIVE_STATE(n) do { busy_state = n; } while (0)
|
|
||||||
#else
|
#else
|
||||||
#define host_keepalive();
|
#define host_keepalive();
|
||||||
#define KEEPALIVE_STATE(n);
|
#define KEEPALIVE_STATE(n);
|
||||||
|
|
@ -1099,6 +1089,7 @@ void setup()
|
||||||
world2machine_reset();
|
world2machine_reset();
|
||||||
|
|
||||||
lcd_init();
|
lcd_init();
|
||||||
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
if (!READ(BTN_ENC))
|
if (!READ(BTN_ENC))
|
||||||
{
|
{
|
||||||
_delay_ms(1000);
|
_delay_ms(1000);
|
||||||
|
|
@ -1120,7 +1111,7 @@ void setup()
|
||||||
|
|
||||||
|
|
||||||
_delay_ms(2000);
|
_delay_ms(2000);
|
||||||
|
|
||||||
char level = reset_menu();
|
char level = reset_menu();
|
||||||
factory_reset(level, false);
|
factory_reset(level, false);
|
||||||
|
|
||||||
|
|
@ -1266,6 +1257,7 @@ void setup()
|
||||||
// Store the currently running firmware into an eeprom,
|
// Store the currently running firmware into an eeprom,
|
||||||
// so the next time the firmware gets updated, it will know from which version it has been updated.
|
// so the next time the firmware gets updated, it will know from which version it has been updated.
|
||||||
update_current_firmware_version_to_eeprom();
|
update_current_firmware_version_to_eeprom();
|
||||||
|
KEEPALIVE_STATE(NOT_BUSY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void trace();
|
void trace();
|
||||||
|
|
@ -1351,7 +1343,7 @@ void host_keepalive() {
|
||||||
long ms = millis();
|
long ms = millis();
|
||||||
if (host_keepalive_interval && busy_state != NOT_BUSY) {
|
if (host_keepalive_interval && busy_state != NOT_BUSY) {
|
||||||
if (ms - prev_busy_signal_ms < 1000UL * host_keepalive_interval) return;
|
if (ms - prev_busy_signal_ms < 1000UL * host_keepalive_interval) return;
|
||||||
switch (busy_state) {
|
switch (busy_state) {
|
||||||
case IN_HANDLER:
|
case IN_HANDLER:
|
||||||
case IN_PROCESS:
|
case IN_PROCESS:
|
||||||
SERIAL_ECHO_START;
|
SERIAL_ECHO_START;
|
||||||
|
|
@ -1432,7 +1424,6 @@ void loop()
|
||||||
manage_heater();
|
manage_heater();
|
||||||
isPrintPaused ? manage_inactivity(true) : manage_inactivity(false);
|
isPrintPaused ? manage_inactivity(true) : manage_inactivity(false);
|
||||||
checkHitEndstops();
|
checkHitEndstops();
|
||||||
host_keepalive();
|
|
||||||
lcd_update();
|
lcd_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2460,7 +2451,7 @@ void process_commands()
|
||||||
prepare_arc_move(false);
|
prepare_arc_move(false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: // G4 dwell
|
case 4: // G4 dwell
|
||||||
codenum = 0;
|
codenum = 0;
|
||||||
if(code_seen('P')) codenum = code_value(); // milliseconds to wait
|
if(code_seen('P')) codenum = code_value(); // milliseconds to wait
|
||||||
if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait
|
if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait
|
||||||
|
|
@ -2493,10 +2484,7 @@ void process_commands()
|
||||||
#endif //FWRETRACT
|
#endif //FWRETRACT
|
||||||
case 28: //G28 Home all Axis one at a time
|
case 28: //G28 Home all Axis one at a time
|
||||||
homing_flag = true;
|
homing_flag = true;
|
||||||
|
#ifdef ENABLE_AUTO_BED_LEVELING
|
||||||
KEEPALIVE_STATE(IN_HANDLER);
|
|
||||||
|
|
||||||
#ifdef ENABLE_AUTO_BED_LEVELING
|
|
||||||
plan_bed_level_matrix.set_to_identity(); //Reset the plane ("erase" all leveling data)
|
plan_bed_level_matrix.set_to_identity(); //Reset the plane ("erase" all leveling data)
|
||||||
#endif //ENABLE_AUTO_BED_LEVELING
|
#endif //ENABLE_AUTO_BED_LEVELING
|
||||||
|
|
||||||
|
|
@ -2943,6 +2931,7 @@ void process_commands()
|
||||||
enquecommand_front_P((PSTR("G28 W0")));
|
enquecommand_front_P((PSTR("G28 W0")));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
KEEPALIVE_STATE(NOT_BUSY); //no need to print busy messages as we print current temperatures periodicaly
|
||||||
SERIAL_ECHOLNPGM("PINDA probe calibration start");
|
SERIAL_ECHOLNPGM("PINDA probe calibration start");
|
||||||
custom_message = true;
|
custom_message = true;
|
||||||
custom_message_type = 4;
|
custom_message_type = 4;
|
||||||
|
|
@ -3540,9 +3529,9 @@ void process_commands()
|
||||||
while (*src == ' ') ++src;
|
while (*src == ' ') ++src;
|
||||||
if (!hasP && !hasS && *src != '\0') {
|
if (!hasP && !hasS && *src != '\0') {
|
||||||
lcd_setstatus(src);
|
lcd_setstatus(src);
|
||||||
} else {
|
} else {
|
||||||
LCD_MESSAGERPGM(MSG_USERWAIT);
|
LCD_MESSAGERPGM(MSG_USERWAIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
lcd_ignore_click(); //call lcd_ignore_click aslo for else ???
|
lcd_ignore_click(); //call lcd_ignore_click aslo for else ???
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
@ -3754,7 +3743,6 @@ void process_commands()
|
||||||
{
|
{
|
||||||
// Only Z calibration?
|
// Only Z calibration?
|
||||||
bool onlyZ = code_seen('Z');
|
bool onlyZ = code_seen('Z');
|
||||||
|
|
||||||
if (!onlyZ) {
|
if (!onlyZ) {
|
||||||
setTargetBed(0);
|
setTargetBed(0);
|
||||||
setTargetHotend(0, 0);
|
setTargetHotend(0, 0);
|
||||||
|
|
@ -3777,7 +3765,9 @@ void process_commands()
|
||||||
memset(axis_known_position, 0, sizeof(axis_known_position));
|
memset(axis_known_position, 0, sizeof(axis_known_position));
|
||||||
|
|
||||||
// Let the user move the Z axes up to the end stoppers.
|
// Let the user move the Z axes up to the end stoppers.
|
||||||
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
if (lcd_calibrate_z_end_stop_manual( onlyZ )) {
|
if (lcd_calibrate_z_end_stop_manual( onlyZ )) {
|
||||||
|
KEEPALIVE_STATE(IN_HANDLER);
|
||||||
refresh_cmd_timeout();
|
refresh_cmd_timeout();
|
||||||
if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) {
|
if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) {
|
||||||
lcd_wait_for_cool_down();
|
lcd_wait_for_cool_down();
|
||||||
|
|
@ -3857,6 +3847,7 @@ void process_commands()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Timeouted.
|
// Timeouted.
|
||||||
|
KEEPALIVE_STATE(IN_HANDLER);
|
||||||
}
|
}
|
||||||
lcd_update_enable(true);
|
lcd_update_enable(true);
|
||||||
break;
|
break;
|
||||||
|
|
@ -3887,8 +3878,10 @@ void process_commands()
|
||||||
|
|
||||||
case 47:
|
case 47:
|
||||||
// M47: Prusa3D: Show end stops dialog on the display.
|
// M47: Prusa3D: Show end stops dialog on the display.
|
||||||
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
lcd_diag_show_end_stops();
|
lcd_diag_show_end_stops();
|
||||||
break;
|
KEEPALIVE_STATE(IN_HANDLER);
|
||||||
|
break;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
case 48: // M48: scan the bed induction sensor points, print the sensor trigger coordinates to the serial line for visualization on the PC.
|
case 48: // M48: scan the bed induction sensor points, print the sensor trigger coordinates to the serial line for visualization on the PC.
|
||||||
|
|
@ -5070,8 +5063,7 @@ Sigma_Exit:
|
||||||
if (code_seen('S')) temp=code_value();
|
if (code_seen('S')) temp=code_value();
|
||||||
if (code_seen('C')) c=code_value();
|
if (code_seen('C')) c=code_value();
|
||||||
|
|
||||||
KEEPALIVE_STATE(NOT_BUSY);
|
PID_autotune(temp, e, c);
|
||||||
PID_autotune(temp, e, c);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 400: // M400 finish all moves
|
case 400: // M400 finish all moves
|
||||||
|
|
@ -5433,7 +5425,9 @@ case 404: //M404 Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or disp
|
||||||
lcd_loading_filament();
|
lcd_loading_filament();
|
||||||
while ((lcd_change_fil_state == 0)||(lcd_change_fil_state != 1)){
|
while ((lcd_change_fil_state == 0)||(lcd_change_fil_state != 1)){
|
||||||
lcd_change_fil_state = 0;
|
lcd_change_fil_state = 0;
|
||||||
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
lcd_alright();
|
lcd_alright();
|
||||||
|
KEEPALIVE_STATE(IN_HANDLER);
|
||||||
switch(lcd_change_fil_state){
|
switch(lcd_change_fil_state){
|
||||||
|
|
||||||
// Filament failed to load so load it again
|
// Filament failed to load so load it again
|
||||||
|
|
@ -6095,7 +6089,7 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument s
|
||||||
static int killCount = 0; // make the inactivity button a bit less responsive
|
static int killCount = 0; // make the inactivity button a bit less responsive
|
||||||
const int KILL_DELAY = 10000;
|
const int KILL_DELAY = 10000;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(buflen < (BUFSIZE-1)){
|
if(buflen < (BUFSIZE-1)){
|
||||||
get_command();
|
get_command();
|
||||||
}
|
}
|
||||||
|
|
@ -6371,7 +6365,7 @@ void calculate_volumetric_multipliers() {
|
||||||
|
|
||||||
void delay_keep_alive(unsigned int ms)
|
void delay_keep_alive(unsigned int ms)
|
||||||
{
|
{
|
||||||
for (;;) {
|
for (;;) {
|
||||||
manage_heater();
|
manage_heater();
|
||||||
// Manage inactivity, but don't disable steppers on timeout.
|
// Manage inactivity, but don't disable steppers on timeout.
|
||||||
manage_inactivity(true);
|
manage_inactivity(true);
|
||||||
|
|
|
||||||
|
|
@ -705,7 +705,7 @@ void CardReader::getfilename_sorted(const uint16_t nr) {
|
||||||
* - Most RAM: Buffer the directory and return filenames from RAM
|
* - Most RAM: Buffer the directory and return filenames from RAM
|
||||||
*/
|
*/
|
||||||
void CardReader::presort() {
|
void CardReader::presort() {
|
||||||
|
|
||||||
uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT);
|
uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT);
|
||||||
|
|
||||||
if (sdSort == SD_SORT_NONE) return; //sd sort is turned off
|
if (sdSort == SD_SORT_NONE) return; //sd sort is turned off
|
||||||
|
|
|
||||||
|
|
@ -220,7 +220,7 @@ unsigned long watchmillis[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0);
|
||||||
pid_cycle = 0;
|
pid_cycle = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SERIAL_ECHOLN("PID Autotune start");
|
SERIAL_ECHOLN("PID Autotune start");
|
||||||
|
|
||||||
disable_heater(); // switch off all heaters.
|
disable_heater(); // switch off all heaters.
|
||||||
|
|
@ -336,13 +336,13 @@ unsigned long watchmillis[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0);
|
||||||
p=soft_pwm_bed;
|
p=soft_pwm_bed;
|
||||||
SERIAL_PROTOCOLPGM("ok B:");
|
SERIAL_PROTOCOLPGM("ok B:");
|
||||||
}else{
|
}else{
|
||||||
p=soft_pwm[extruder];
|
p=soft_pwm[extruder];
|
||||||
SERIAL_PROTOCOLPGM("ok T:");
|
SERIAL_PROTOCOLPGM("ok T:");
|
||||||
}
|
}
|
||||||
|
|
||||||
SERIAL_PROTOCOL(input);
|
SERIAL_PROTOCOL(input);
|
||||||
SERIAL_PROTOCOLPGM(" @:");
|
SERIAL_PROTOCOLPGM(" @:");
|
||||||
SERIAL_PROTOCOLLN(p);
|
SERIAL_PROTOCOLLN(p);
|
||||||
|
|
||||||
temp_millis = millis();
|
temp_millis = millis();
|
||||||
}
|
}
|
||||||
|
|
@ -686,6 +686,7 @@ void manage_heater()
|
||||||
volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]=0.01;
|
volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]=0.01;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
host_keepalive();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PGM_RD_W(x) (short)pgm_read_word(&x)
|
#define PGM_RD_W(x) (short)pgm_read_word(&x)
|
||||||
|
|
|
||||||
|
|
@ -1283,13 +1283,14 @@ void lcd_menu_statistics()
|
||||||
lcd.print(itostr3(_days));
|
lcd.print(itostr3(_days));
|
||||||
|
|
||||||
|
|
||||||
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
while (!lcd_clicked())
|
while (!lcd_clicked())
|
||||||
{
|
{
|
||||||
manage_heater();
|
manage_heater();
|
||||||
manage_inactivity(true);
|
manage_inactivity(true);
|
||||||
delay(100);
|
delay(100);
|
||||||
}
|
}
|
||||||
|
KEEPALIVE_STATE(NOT_BUSY);
|
||||||
|
|
||||||
lcd_quick_feedback();
|
lcd_quick_feedback();
|
||||||
lcd_return_to_status();
|
lcd_return_to_status();
|
||||||
|
|
@ -1367,6 +1368,7 @@ void lcd_service_mode_show_result() {
|
||||||
} else lcd_print_at_PGM(11, i + 1, PSTR("N/A"));
|
} else lcd_print_at_PGM(11, i + 1, PSTR("N/A"));
|
||||||
}
|
}
|
||||||
delay_keep_alive(500);
|
delay_keep_alive(500);
|
||||||
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
while (!lcd_clicked()) {
|
while (!lcd_clicked()) {
|
||||||
delay_keep_alive(100);
|
delay_keep_alive(100);
|
||||||
}
|
}
|
||||||
|
|
@ -1393,6 +1395,7 @@ void lcd_service_mode_show_result() {
|
||||||
while (!lcd_clicked()) {
|
while (!lcd_clicked()) {
|
||||||
delay_keep_alive(100);
|
delay_keep_alive(100);
|
||||||
}
|
}
|
||||||
|
KEEPALIVE_STATE(NOT_BUSY);
|
||||||
delay_keep_alive(500);
|
delay_keep_alive(500);
|
||||||
lcd_set_custom_characters_arrows();
|
lcd_set_custom_characters_arrows();
|
||||||
lcd_return_to_status();
|
lcd_return_to_status();
|
||||||
|
|
@ -1865,6 +1868,7 @@ void lcd_show_fullscreen_message_and_wait_P(const char *msg)
|
||||||
const char *msg_next = lcd_display_message_fullscreen_P(msg);
|
const char *msg_next = lcd_display_message_fullscreen_P(msg);
|
||||||
bool multi_screen = msg_next != NULL;
|
bool multi_screen = msg_next != NULL;
|
||||||
|
|
||||||
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
// Until confirmed by a button click.
|
// Until confirmed by a button click.
|
||||||
for (;;) {
|
for (;;) {
|
||||||
// Wait for 5 seconds before displaying the next text.
|
// Wait for 5 seconds before displaying the next text.
|
||||||
|
|
@ -1874,6 +1878,7 @@ void lcd_show_fullscreen_message_and_wait_P(const char *msg)
|
||||||
while (lcd_clicked()) ;
|
while (lcd_clicked()) ;
|
||||||
delay(10);
|
delay(10);
|
||||||
while (lcd_clicked()) ;
|
while (lcd_clicked()) ;
|
||||||
|
KEEPALIVE_STATE(IN_HANDLER);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1887,6 +1892,7 @@ void lcd_show_fullscreen_message_and_wait_P(const char *msg)
|
||||||
|
|
||||||
void lcd_wait_for_click()
|
void lcd_wait_for_click()
|
||||||
{
|
{
|
||||||
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
manage_heater();
|
manage_heater();
|
||||||
manage_inactivity(true);
|
manage_inactivity(true);
|
||||||
|
|
@ -1894,6 +1900,7 @@ void lcd_wait_for_click()
|
||||||
while (lcd_clicked()) ;
|
while (lcd_clicked()) ;
|
||||||
delay(10);
|
delay(10);
|
||||||
while (lcd_clicked()) ;
|
while (lcd_clicked()) ;
|
||||||
|
KEEPALIVE_STATE(IN_HANDLER);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1901,7 +1908,6 @@ void lcd_wait_for_click()
|
||||||
|
|
||||||
int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting, bool default_yes)
|
int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow_timeouting, bool default_yes)
|
||||||
{
|
{
|
||||||
|
|
||||||
lcd_display_message_fullscreen_P(msg);
|
lcd_display_message_fullscreen_P(msg);
|
||||||
|
|
||||||
if (default_yes) {
|
if (default_yes) {
|
||||||
|
|
@ -1923,6 +1929,7 @@ int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow
|
||||||
// Wait for user confirmation or a timeout.
|
// Wait for user confirmation or a timeout.
|
||||||
unsigned long previous_millis_cmd = millis();
|
unsigned long previous_millis_cmd = millis();
|
||||||
int8_t enc_dif = encoderDiff;
|
int8_t enc_dif = encoderDiff;
|
||||||
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (allow_timeouting && millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS)
|
if (allow_timeouting && millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -1948,6 +1955,7 @@ int8_t lcd_show_fullscreen_message_yes_no_and_wait_P(const char *msg, bool allow
|
||||||
while (lcd_clicked());
|
while (lcd_clicked());
|
||||||
delay(10);
|
delay(10);
|
||||||
while (lcd_clicked());
|
while (lcd_clicked());
|
||||||
|
KEEPALIVE_STATE(IN_HANDLER);
|
||||||
return yes;
|
return yes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4800,6 +4808,7 @@ static bool lcd_selftest_fan_dialog(int _fan)
|
||||||
lcd.setCursor(1, 3); lcd_printPGM(MSG_SELFTEST_FAN_NO);
|
lcd.setCursor(1, 3); lcd_printPGM(MSG_SELFTEST_FAN_NO);
|
||||||
|
|
||||||
int8_t enc_dif = 0;
|
int8_t enc_dif = 0;
|
||||||
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
switch (_fan)
|
switch (_fan)
|
||||||
|
|
@ -4840,7 +4849,7 @@ static bool lcd_selftest_fan_dialog(int _fan)
|
||||||
delay(100);
|
delay(100);
|
||||||
|
|
||||||
} while (!lcd_clicked());
|
} while (!lcd_clicked());
|
||||||
|
KEEPALIVE_STATE(IN_HANDLER);
|
||||||
SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN);
|
SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN);
|
||||||
WRITE(EXTRUDER_0_AUTO_FAN_PIN, 0);
|
WRITE(EXTRUDER_0_AUTO_FAN_PIN, 0);
|
||||||
SET_OUTPUT(FAN_PIN);
|
SET_OUTPUT(FAN_PIN);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue