|
|
@ -94,6 +94,7 @@ static struct {
|
|
|
|
} flags;
|
|
|
|
} flags;
|
|
|
|
|
|
|
|
|
|
|
|
namespace ExtUI {
|
|
|
|
namespace ExtUI {
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __SAM3X8E__
|
|
|
|
#ifdef __SAM3X8E__
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Implement a special millis() to allow time measurement
|
|
|
|
* Implement a special millis() to allow time measurement
|
|
|
@ -134,12 +135,7 @@ namespace ExtUI {
|
|
|
|
return (uint32_t)(currTime / (F_CPU / 8000));
|
|
|
|
return (uint32_t)(currTime / (F_CPU / 8000));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
#endif // __SAM3X8E__
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Implement for AVR
|
|
|
|
|
|
|
|
FORCE_INLINE uint32_t safe_millis() { return millis(); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void delay_us(unsigned long us) {
|
|
|
|
void delay_us(unsigned long us) {
|
|
|
|
DELAY_US(us);
|
|
|
|
DELAY_US(us);
|
|
|
@ -287,12 +283,14 @@ namespace ExtUI {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void setActiveTool(const extruder_t extruder, bool no_move) {
|
|
|
|
void setActiveTool(const extruder_t extruder, bool no_move) {
|
|
|
|
|
|
|
|
#if EXTRUDERS > 1
|
|
|
|
const uint8_t e = extruder - E0;
|
|
|
|
const uint8_t e = extruder - E0;
|
|
|
|
#if DO_SWITCH_EXTRUDER || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
|
|
|
|
#if DO_SWITCH_EXTRUDER || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER)
|
|
|
|
if (e != active_extruder)
|
|
|
|
if (e != active_extruder)
|
|
|
|
tool_change(e, 0, no_move);
|
|
|
|
tool_change(e, 0, no_move);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
active_extruder = e;
|
|
|
|
active_extruder = e;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extruder_t getActiveTool() {
|
|
|
|
extruder_t getActiveTool() {
|
|
|
@ -533,22 +531,24 @@ namespace ExtUI {
|
|
|
|
|
|
|
|
|
|
|
|
float getFeedrate_percent() { return feedrate_percentage; }
|
|
|
|
float getFeedrate_percent() { return feedrate_percentage; }
|
|
|
|
|
|
|
|
|
|
|
|
void enqueueCommands(progmem_str gcode) {
|
|
|
|
void enqueueCommands_P(PGM_P const gcode) {
|
|
|
|
enqueue_and_echo_commands_P((PGM_P)gcode);
|
|
|
|
enqueue_and_echo_commands_P(gcode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool isAxisPositionKnown(const axis_t axis) {
|
|
|
|
bool isAxisPositionKnown(const axis_t axis) {
|
|
|
|
return TEST(axis_known_position, axis);
|
|
|
|
return TEST(axis_known_position, axis);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
progmem_str getFirmwareName_str() {
|
|
|
|
PGM_P getFirmwareName_str() {
|
|
|
|
return F("Marlin " SHORT_BUILD_VERSION);
|
|
|
|
static const char firmware_name[] PROGMEM = "Marlin " SHORT_BUILD_VERSION;
|
|
|
|
|
|
|
|
return firmware_name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void setTargetTemp_celsius(float value, const heater_t heater) {
|
|
|
|
void setTargetTemp_celsius(float value, const heater_t heater) {
|
|
|
|
#if HAS_HEATED_BED
|
|
|
|
#if HAS_HEATED_BED
|
|
|
|
if (heater == BED)
|
|
|
|
if (heater == BED)
|
|
|
|
thermalManager.setTargetBed(clamp(value,0,200));
|
|
|
|
thermalManager.setTargetBed(clamp(value,0,200));
|
|
|
|
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
thermalManager.setTargetHotend(clamp(value,0,500), heater - H0);
|
|
|
|
thermalManager.setTargetHotend(clamp(value,0,500), heater - H0);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -579,7 +579,7 @@ namespace ExtUI {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool isPrinting() {
|
|
|
|
bool isPrinting() {
|
|
|
|
return (planner.movesplanned() || IS_SD_PRINTING() || isPrintingFromMedia());
|
|
|
|
return (planner.movesplanned() || isPrintingFromMedia() || IFSD(IS_SD_PRINTING(), false));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool isMediaInserted() {
|
|
|
|
bool isMediaInserted() {
|
|
|
@ -593,19 +593,20 @@ namespace ExtUI {
|
|
|
|
#if ENABLED(PARK_HEAD_ON_PAUSE)
|
|
|
|
#if ENABLED(PARK_HEAD_ON_PAUSE)
|
|
|
|
enqueue_and_echo_commands_P(PSTR("M125"));
|
|
|
|
enqueue_and_echo_commands_P(PSTR("M125"));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
ExtUI::onStatusChanged(PSTR(MSG_PRINT_PAUSED));
|
|
|
|
ui.set_status_P(PSTR(MSG_PRINT_PAUSED));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void resumePrint() {
|
|
|
|
void resumePrint() {
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
|
|
|
|
ui.set_status_P(PSTR(MSG_FILAMENT_CHANGE_RESUME_1));
|
|
|
|
#if ENABLED(PARK_HEAD_ON_PAUSE)
|
|
|
|
#if ENABLED(PARK_HEAD_ON_PAUSE)
|
|
|
|
|
|
|
|
wait_for_heatup = wait_for_user = false;
|
|
|
|
enqueue_and_echo_commands_P(PSTR("M24"));
|
|
|
|
enqueue_and_echo_commands_P(PSTR("M24"));
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
card.startFileprint();
|
|
|
|
card.startFileprint();
|
|
|
|
print_job_timer.start();
|
|
|
|
print_job_timer.start();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
ExtUI::onStatusChanged(PSTR(MSG_PRINTING));
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -613,7 +614,7 @@ namespace ExtUI {
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
wait_for_heatup = wait_for_user = false;
|
|
|
|
wait_for_heatup = wait_for_user = false;
|
|
|
|
card.flag.abort_sd_printing = true;
|
|
|
|
card.flag.abort_sd_printing = true;
|
|
|
|
ExtUI::onStatusChanged(PSTR(MSG_PRINT_ABORTED));
|
|
|
|
ui.set_status_P(PSTR(MSG_PRINT_ABORTED));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -621,7 +622,7 @@ namespace ExtUI {
|
|
|
|
|
|
|
|
|
|
|
|
void FileList::refresh() { num_files = 0xFFFF; }
|
|
|
|
void FileList::refresh() { num_files = 0xFFFF; }
|
|
|
|
|
|
|
|
|
|
|
|
bool FileList::seek(uint16_t pos, bool skip_range_check) {
|
|
|
|
bool FileList::seek(const uint16_t pos, const bool skip_range_check) {
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
if (!skip_range_check && pos > (count() - 1)) return false;
|
|
|
|
if (!skip_range_check && pos > (count() - 1)) return false;
|
|
|
|
const uint16_t nr =
|
|
|
|
const uint16_t nr =
|
|
|
@ -632,6 +633,8 @@ namespace ExtUI {
|
|
|
|
|
|
|
|
|
|
|
|
card.getfilename_sorted(nr);
|
|
|
|
card.getfilename_sorted(nr);
|
|
|
|
return card.filename && card.filename[0] != '\0';
|
|
|
|
return card.filename && card.filename[0] != '\0';
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
return false;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -671,7 +674,7 @@ namespace ExtUI {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void FileList::changeDir(const char *dirname) {
|
|
|
|
void FileList::changeDir(const char * const dirname) {
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
#if ENABLED(SDSUPPORT)
|
|
|
|
card.chdir(dirname);
|
|
|
|
card.chdir(dirname);
|
|
|
|
num_files = 0xFFFF;
|
|
|
|
num_files = 0xFFFF;
|
|
|
@ -713,20 +716,6 @@ void MarlinUI::update() {
|
|
|
|
ExtUI::onIdle();
|
|
|
|
ExtUI::onIdle();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MarlinUI::setstatus(const char * const message, const bool persist/*=false*/) { ExtUI::onStatusChanged(message); }
|
|
|
|
|
|
|
|
void MarlinUI::setstatusPGM(PGM_P const message, int8_t level/*=0*/) { ExtUI::onStatusChanged((progmem_str)message); }
|
|
|
|
|
|
|
|
void MarlinUI::setalertstatusPGM(PGM_P const message) { setstatusPGM(message, 0); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MarlinUI::status_printf_P(const uint8_t level, const char * const fmt, ...) {
|
|
|
|
|
|
|
|
char buff[64];
|
|
|
|
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
va_start(args, fmt);
|
|
|
|
|
|
|
|
vsnprintf_P(buff, sizeof(buff), fmt, args);
|
|
|
|
|
|
|
|
va_end(args);
|
|
|
|
|
|
|
|
buff[63] = '\0';
|
|
|
|
|
|
|
|
ExtUI::onStatusChanged(buff);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MarlinUI::kill_screen(PGM_P const msg) {
|
|
|
|
void MarlinUI::kill_screen(PGM_P const msg) {
|
|
|
|
if (!flags.printer_killed) {
|
|
|
|
if (!flags.printer_killed) {
|
|
|
|
flags.printer_killed = true;
|
|
|
|
flags.printer_killed = true;
|
|
|
|