mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-01-31 06:02:16 +00:00
🎨 Misc. LCD cleanup (#25400)
This commit is contained in:
parent
c68a4c085d
commit
96bc084f3d
76 changed files with 541 additions and 951 deletions
|
@ -2092,7 +2092,7 @@
|
|||
//#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
|
||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
//#define BABYSTEP_HOTEND_Z_OFFSET // For multiple hotends, babystep relative Z offsets
|
||||
//#define BABYSTEP_ZPROBE_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
|
||||
//#define BABYSTEP_GFX_OVERLAY // Enable graphical overlay on Z-offset editor
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ void LevelingBilinear::extrapolate_unprobed_bed_level() {
|
|||
}
|
||||
}
|
||||
|
||||
void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values /*= NULL*/) {
|
||||
void LevelingBilinear::print_leveling_grid(const bed_mesh_t* _z_values/*=nullptr*/) {
|
||||
// print internal grid(s) or just the one passed as a parameter
|
||||
SERIAL_ECHOLNPGM("Bilinear Leveling Grid:");
|
||||
print_2d_array(GRID_MAX_POINTS_X, GRID_MAX_POINTS_Y, 3, _z_values ? *_z_values[0] : z_values[0]);
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
static void reset();
|
||||
static void set_grid(const xy_pos_t& _grid_spacing, const xy_pos_t& _grid_start);
|
||||
static void extrapolate_unprobed_bed_level();
|
||||
static void print_leveling_grid(const bed_mesh_t* _z_values = NULL);
|
||||
static void print_leveling_grid(const bed_mesh_t *_z_values=nullptr);
|
||||
static void refresh_bed_level();
|
||||
static bool has_mesh() { return !!grid_spacing.x; }
|
||||
static bool mesh_is_valid() { return has_mesh(); }
|
||||
|
|
|
@ -670,6 +670,8 @@
|
|||
#error "MILLISECONDS_PREHEAT_TIME is now PREHEAT_TIME_HOTEND_MS."
|
||||
#elif defined(EXPERIMENTAL_SCURVE)
|
||||
#error "EXPERIMENTAL_SCURVE is no longer needed and should be removed."
|
||||
#elif defined(BABYSTEP_ZPROBE_GFX_OVERLAY)
|
||||
#error "BABYSTEP_ZPROBE_GFX_OVERLAY is now BABYSTEP_GFX_OVERLAY."
|
||||
#endif
|
||||
|
||||
// L64xx stepper drivers have been removed
|
||||
|
@ -1042,10 +1044,10 @@ static_assert(X_MAX_LENGTH >= X_BED_SIZE, "Movement bounds (X_MIN_POS, X_MAX_POS
|
|||
#error "MESH_BED_LEVELING and BABYSTEP_ZPROBE_OFFSET is not a valid combination"
|
||||
#elif ENABLED(BABYSTEP_ZPROBE_OFFSET) && !HAS_BED_PROBE
|
||||
#error "BABYSTEP_ZPROBE_OFFSET requires a probe."
|
||||
#elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI)
|
||||
#error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a Graphical LCD."
|
||||
#elif ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
#error "BABYSTEP_ZPROBE_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
|
||||
#elif ENABLED(BABYSTEP_GFX_OVERLAY) && NONE(HAS_MARLINUI_U8GLIB, IS_DWIN_MARLINUI)
|
||||
#error "BABYSTEP_GFX_OVERLAY requires a Graphical LCD."
|
||||
#elif ENABLED(BABYSTEP_GFX_OVERLAY) && DISABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
#error "BABYSTEP_GFX_OVERLAY requires a BABYSTEP_ZPROBE_OFFSET."
|
||||
#elif ENABLED(BABYSTEP_HOTEND_Z_OFFSET) && !HAS_HOTEND_OFFSET
|
||||
#error "BABYSTEP_HOTEND_Z_OFFSET requires 2 or more HOTENDS."
|
||||
#elif BOTH(BABYSTEP_ALWAYS_AVAILABLE, MOVE_Z_WHEN_IDLE)
|
||||
|
|
|
@ -628,7 +628,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
|||
|
||||
#endif // AUTO_BED_LEVELING_UBL
|
||||
|
||||
#if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
|
||||
#if EITHER(BABYSTEP_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
|
||||
|
||||
//
|
||||
// Draw knob rotation => Z motion key for:
|
||||
|
@ -746,7 +746,7 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
|
|||
}
|
||||
}
|
||||
|
||||
#endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
|
||||
#endif // BABYSTEP_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
|
||||
|
||||
#endif // HAS_MARLINUI_MENU
|
||||
|
||||
|
|
|
@ -565,7 +565,7 @@ void MarlinUI::draw_status_message(const bool blink) {
|
|||
|
||||
#endif // AUTO_BED_LEVELING_UBL
|
||||
|
||||
#if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
|
||||
#if EITHER(BABYSTEP_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
|
||||
|
||||
void MarlinUI::zoffset_overlay(const int8_t dir) {
|
||||
const int rot_up = TERN(OVERLAY_GFX_REVERSE, ICON_RotateCCW, ICON_RotateCW),
|
||||
|
@ -587,7 +587,7 @@ void MarlinUI::draw_status_message(const bool blink) {
|
|||
DWIN_ICON_Show(ICON, rot_up, LCD_PIXEL_WIDTH - 10 - 48, arrow_y);
|
||||
}
|
||||
|
||||
#endif // BABYSTEP_ZPROBE_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
|
||||
#endif // BABYSTEP_GFX_OVERLAY || MESH_EDIT_GFX_OVERLAY
|
||||
|
||||
#endif // HAS_MARLINUI_MENU
|
||||
|
||||
|
|
|
@ -1271,7 +1271,6 @@ void EachMomentUpdate() {
|
|||
|
||||
if ((Printing() != HMI_flag.printing_flag) && !HMI_flag.home_flag) {
|
||||
HMI_flag.printing_flag = Printing();
|
||||
DEBUG_ECHOLNPGM("printing_flag: ", HMI_flag.printing_flag);
|
||||
if (HMI_flag.printing_flag)
|
||||
DWIN_Print_Started();
|
||||
else if (HMI_flag.abort_flag)
|
||||
|
@ -1282,7 +1281,6 @@ void EachMomentUpdate() {
|
|||
|
||||
if ((printingIsPaused() != HMI_flag.pause_flag) && !HMI_flag.home_flag) {
|
||||
HMI_flag.pause_flag = printingIsPaused();
|
||||
DEBUG_ECHOLNPGM("pause_flag: ", HMI_flag.pause_flag);
|
||||
if (HMI_flag.pause_flag)
|
||||
DWIN_Print_Pause();
|
||||
else if (HMI_flag.abort_flag)
|
||||
|
@ -1628,7 +1626,6 @@ void DWIN_LevelingDone() {
|
|||
|
||||
// Started a Print Job
|
||||
void DWIN_Print_Started() {
|
||||
DEBUG_ECHOLNPGM("DWIN_Print_Started: ", SD_Printing());
|
||||
TERN_(HAS_GCODE_PREVIEW, if (Host_Printing()) Preview_Invalidate());
|
||||
_percent_done = 0;
|
||||
_remain_time = 0;
|
||||
|
@ -1642,20 +1639,17 @@ void DWIN_Print_Started() {
|
|||
|
||||
// Pause a print job
|
||||
void DWIN_Print_Pause() {
|
||||
DEBUG_ECHOLNPGM("DWIN_Print_Pause");
|
||||
ICON_ResumeOrPause();
|
||||
}
|
||||
|
||||
// Resume print job
|
||||
void DWIN_Print_Resume() {
|
||||
DEBUG_ECHOLNPGM("DWIN_Print_Resume");
|
||||
ICON_ResumeOrPause();
|
||||
LCD_MESSAGE(MSG_RESUME_PRINT);
|
||||
}
|
||||
|
||||
// Ended print job
|
||||
void DWIN_Print_Finished() {
|
||||
DEBUG_ECHOLNPGM("DWIN_Print_Finished");
|
||||
TERN_(POWER_LOSS_RECOVERY, if (card.isPrinting()) recovery.cancel());
|
||||
HMI_flag.pause_flag = false;
|
||||
wait_for_heatup = false;
|
||||
|
@ -1666,7 +1660,6 @@ void DWIN_Print_Finished() {
|
|||
|
||||
// Print was aborted
|
||||
void DWIN_Print_Aborted() {
|
||||
DEBUG_ECHOLNPGM("DWIN_Print_Aborted");
|
||||
DWIN_Print_Finished();
|
||||
}
|
||||
|
||||
|
@ -1714,7 +1707,6 @@ void DWIN_SetColorDefaults() {
|
|||
}
|
||||
|
||||
void DWIN_SetDataDefaults() {
|
||||
DEBUG_ECHOLNPGM("DWIN_SetDataDefaults");
|
||||
DWIN_SetColorDefaults();
|
||||
DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color);
|
||||
TERN_(PIDTEMP, HMI_data.HotendPidT = DEF_HOTENDPIDT);
|
||||
|
@ -1738,13 +1730,10 @@ void DWIN_SetDataDefaults() {
|
|||
}
|
||||
|
||||
void DWIN_CopySettingsTo(char * const buff) {
|
||||
DEBUG_ECHOLNPGM("DWIN_CopySettingsTo");
|
||||
DEBUG_ECHOLNPGM("HMI_data: ", sizeof(HMI_data_t));
|
||||
memcpy(buff, &HMI_data, eeprom_data_size);
|
||||
}
|
||||
|
||||
void DWIN_CopySettingsFrom(const char * const buff) {
|
||||
DEBUG_ECHOLNPGM("DWIN_CopySettingsFrom");
|
||||
memcpy(&HMI_data, buff, sizeof(HMI_data_t));
|
||||
if (HMI_data.Text_Color == HMI_data.Background_Color) DWIN_SetColorDefaults();
|
||||
DWINUI::SetColors(HMI_data.Text_Color, HMI_data.Background_Color, HMI_data.StatusBg_Color);
|
||||
|
@ -1764,18 +1753,14 @@ void DWIN_CopySettingsFrom(const char * const buff) {
|
|||
|
||||
// Initialize or re-initialize the LCD
|
||||
void MarlinUI::init_lcd() {
|
||||
DEBUG_ECHOLNPGM("MarlinUI::init_lcd");
|
||||
delay(750); // wait to wakeup screen
|
||||
const bool hs = DWIN_Handshake(); UNUSED(hs);
|
||||
DEBUG_ECHOPGM("DWIN_Handshake ");
|
||||
DEBUG_ECHOLNF(hs ? F("ok.") : F("error."));
|
||||
DWIN_Frame_SetDir(1);
|
||||
DWIN_JPG_CacheTo1(Language_English);
|
||||
Encoder_Configuration();
|
||||
}
|
||||
|
||||
void DWIN_InitScreen() {
|
||||
DEBUG_ECHOLNPGM("DWIN_InitScreen");
|
||||
DWIN_SetColorDefaults();
|
||||
HMI_Init(); // draws boot screen
|
||||
DWINUI::init();
|
||||
|
@ -2034,7 +2019,6 @@ void AutoHome() { queue.inject_P(G28_STR); }
|
|||
#if EITHER(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP)
|
||||
const_float_t step_zoffset = round((MenuData.Value / 100.0f) * planner.settings.axis_steps_per_mm[Z_AXIS]) - babystep.accum;
|
||||
if (BABYSTEP_ALLOWED()) babystep.add_steps(Z_AXIS, step_zoffset);
|
||||
//DEBUG_ECHOLNF(F("BB Steps: "), step_zoffset);
|
||||
#endif
|
||||
}
|
||||
void SetZOffset() {
|
||||
|
|
|
@ -135,7 +135,7 @@ bool Has_Preview() {
|
|||
Get_Value(buf, ";MAXZ:", fileprop.height);
|
||||
fileprop.height -= tmp;
|
||||
posptr = strstr(buf, tbstart);
|
||||
if (posptr != NULL) {
|
||||
if (posptr != nullptr) {
|
||||
fileprop.thumbstart = indx + (posptr - &buf[0]);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -70,7 +70,6 @@ char FileNavigator::currentfoldername[MAX_PATH_LEN + 1]; // Current folde
|
|||
FileNavigator::FileNavigator() { reset(); }
|
||||
|
||||
void FileNavigator::reset() {
|
||||
DEBUG_ECHOLNPGM("reset()");
|
||||
currentfoldername[0] = '\0';
|
||||
currentfolderdepth = 0;
|
||||
currentindex = 0;
|
||||
|
@ -86,7 +85,6 @@ void FileNavigator::refresh() { filelist.refresh(); }
|
|||
|
||||
void FileNavigator::changeDIR(const char *folder) {
|
||||
if (currentfolderdepth >= MAX_FOLDER_DEPTH) return; // limit the folder depth
|
||||
DEBUG_ECHOLNPGM("FD:" , folderdepth, " FP:",currentindex, " currentfolder:", currentfoldername, " enter:", folder);
|
||||
currentfolderindex[currentfolderdepth] = currentindex;
|
||||
strcat(currentfoldername, folder);
|
||||
strcat(currentfoldername, "/");
|
||||
|
@ -96,7 +94,6 @@ void FileNavigator::changeDIR(const char *folder) {
|
|||
}
|
||||
|
||||
void FileNavigator::upDIR() {
|
||||
DEBUG_ECHOLNPGM("upDIR() from D:", currentfolderdepth, " N:", currentfoldername);
|
||||
if (!filelist.isAtRootDir()) {
|
||||
filelist.upDir();
|
||||
currentfolderdepth--;
|
||||
|
@ -117,7 +114,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
|
|||
if (skip == 0) return;
|
||||
while (skip > 0) {
|
||||
if (filelist.seek(currentindex)) {
|
||||
DEBUG_ECHOLNPGM("CI:", currentindex, " FD:", currentfolderdepth, " N:", skip, " ", filelist.longFilename());
|
||||
if (!filelist.isDir()) {
|
||||
skip--;
|
||||
currentindex++;
|
||||
|
@ -151,8 +147,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
|
|||
}
|
||||
lastpanelindex = index;
|
||||
|
||||
DEBUG_ECHOLNPGM("index=", index, " currentindex=", currentindex);
|
||||
|
||||
if (currentindex == 0 && currentfolderdepth > 0) { // Add a link to go up a folder
|
||||
// The new panel ignores entries that don't end in .GCO or .gcode so add and pad them.
|
||||
if (paneltype <= AC_panel_new) {
|
||||
|
@ -166,12 +160,8 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
|
|||
filesneeded--;
|
||||
}
|
||||
|
||||
for (uint16_t seek = currentindex; seek < currentindex + filesneeded; seek++) {
|
||||
if (filelist.seek(seek)) {
|
||||
sendFile(paneltype);
|
||||
DEBUG_ECHOLNPGM("-", seek, " '", filelist.longFilename(), "' '", currentfoldername, "", filelist.shortFilename(), "'");
|
||||
}
|
||||
}
|
||||
for (uint16_t seek = currentindex; seek < currentindex + filesneeded; seek++)
|
||||
if (filelist.seek(seek)) sendFile(paneltype);
|
||||
}
|
||||
|
||||
void FileNavigator::sendFile(panel_type_t paneltype) {
|
||||
|
@ -212,7 +202,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
|
|||
#else // Flat file list
|
||||
|
||||
void FileNavigator::getFiles(uint16_t index, panel_type_t paneltype, uint8_t filesneeded) {
|
||||
DEBUG_ECHOLNPGM("getFiles() I:", index," L:", lastpanelindex);
|
||||
// if we're searching backwards, jump back to start and search forward
|
||||
if (index < lastpanelindex) {
|
||||
reset();
|
||||
|
@ -248,7 +237,6 @@ void FileNavigator::skiptofileindex(uint16_t skip) {
|
|||
TFTSer.println(filelist.shortFilename());
|
||||
if (currentfolderdepth > 0) TFTSer.print(currentfoldername);
|
||||
TFTSer.println(filelist.longFilename());
|
||||
DEBUG_ECHOLNPGM("/", currentfoldername, "", filelist.shortFilename(), " ", filelist.longFilename());
|
||||
}
|
||||
|
||||
#endif // Flat file list
|
||||
|
|
|
@ -704,7 +704,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
|||
break;
|
||||
|
||||
case 16: { // A16 set hotend temp
|
||||
unsigned int tempvalue;
|
||||
uint16_t tempvalue;
|
||||
if (CodeSeen('S')) {
|
||||
tempvalue = constrain(CodeValue(), 0, 275);
|
||||
setTargetTemp_celsius(tempvalue, (extruder_t)E0);
|
||||
|
@ -719,7 +719,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
|||
break;
|
||||
|
||||
case 17: { // A17 set heated bed temp
|
||||
unsigned int tempbed;
|
||||
uint16_t tempbed;
|
||||
if (CodeSeen('S')) {
|
||||
tempbed = constrain(CodeValue(), 0, 100);
|
||||
setTargetTemp_celsius(tempbed, (heater_t)BED);
|
||||
|
@ -777,7 +777,7 @@ void AnycubicTFTClass::GetCommandFromTFT() {
|
|||
case 22: // A22 move X/Y/Z or extrude
|
||||
if (!isPrinting()) {
|
||||
float coorvalue;
|
||||
unsigned int movespeed = 0;
|
||||
uint16_t movespeed = 0;
|
||||
char commandStr[30];
|
||||
char fullCommandStr[38];
|
||||
|
||||
|
|
|
@ -141,7 +141,6 @@ void DGUSDisplay::ProcessRx() {
|
|||
if (!LCD_SERIAL.available() && LCD_SERIAL.buffer_overruns()) {
|
||||
// Overrun, but reset the flag only when the buffer is empty
|
||||
// We want to extract as many as valid datagrams possible...
|
||||
DEBUG_ECHOPGM("OVFL");
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
//LCD_SERIAL.reset_rx_overun();
|
||||
LCD_SERIAL.flush();
|
||||
|
@ -205,17 +204,11 @@ void DGUSDisplay::ProcessRx() {
|
|||
| Command DataLen (in Words) */
|
||||
if (command == DGUS_CMD_READVAR) {
|
||||
const uint16_t vp = tmp[0] << 8 | tmp[1];
|
||||
//const uint8_t dlen = tmp[2] << 1; // Convert to Bytes. (Display works with words)
|
||||
//DEBUG_ECHOPGM(" vp=", vp, " dlen=", dlen);
|
||||
DGUS_VP_Variable ramcopy;
|
||||
if (populate_VPVar(vp, &ramcopy)) {
|
||||
if (ramcopy.set_by_display_handler)
|
||||
ramcopy.set_by_display_handler(ramcopy, &tmp[3]);
|
||||
else
|
||||
DEBUG_ECHOLNPGM(" VPVar found, no handler.");
|
||||
}
|
||||
else
|
||||
DEBUG_ECHOLNPGM(" VPVar not found:", vp);
|
||||
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
break;
|
||||
|
@ -260,9 +253,7 @@ bool DGUSDisplay::Initialized = false,
|
|||
#define sw_barrier() asm volatile("": : :"memory");
|
||||
|
||||
bool populate_VPVar(const uint16_t VP, DGUS_VP_Variable * const ramcopy) {
|
||||
//DEBUG_ECHOPGM("populate_VPVar ", VP);
|
||||
const DGUS_VP_Variable *pvp = DGUSLCD_FindVPVar(VP);
|
||||
//DEBUG_ECHOLNPGM(" pvp ", (uint16_t )pvp);
|
||||
if (!pvp) return false;
|
||||
memcpy_P(ramcopy, pvp, sizeof(DGUS_VP_Variable));
|
||||
return true;
|
||||
|
|
|
@ -112,8 +112,6 @@ void DGUSScreenHandler::setstatusmessagePGM(PGM_P const msg) {
|
|||
// Send an 8 bit or 16 bit value to the display.
|
||||
void DGUSScreenHandler::DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var) {
|
||||
if (var.memadr) {
|
||||
//DEBUG_ECHOPGM(" DGUS_LCD_SendWordValueToDisplay ", var.VP);
|
||||
//DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr);
|
||||
if (var.size > 1)
|
||||
dgusdisplay.WriteVariable(var.VP, *(int16_t*)var.memadr);
|
||||
else
|
||||
|
@ -124,8 +122,6 @@ void DGUSScreenHandler::DGUSLCD_SendWordValueToDisplay(DGUS_VP_Variable &var) {
|
|||
// Send an uint8_t between 0 and 255 to the display, but scale to a percentage (0..100)
|
||||
void DGUSScreenHandler::DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var) {
|
||||
if (var.memadr) {
|
||||
//DEBUG_ECHOPGM(" DGUS_LCD_SendWordValueToDisplay ", var.VP);
|
||||
//DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr);
|
||||
uint16_t tmp = *(uint8_t *) var.memadr + 1; // +1 -> avoid rounding issues for the display.
|
||||
tmp = map(tmp, 0, 255, 0, 100);
|
||||
dgusdisplay.WriteVariable(var.VP, tmp);
|
||||
|
@ -134,9 +130,7 @@ void DGUSScreenHandler::DGUSLCD_SendPercentageToDisplay(DGUS_VP_Variable &var) {
|
|||
|
||||
// Send the current print progress to the display.
|
||||
void DGUSScreenHandler::DGUSLCD_SendPrintProgressToDisplay(DGUS_VP_Variable &var) {
|
||||
//DEBUG_ECHOPGM(" DGUSLCD_SendPrintProgressToDisplay ", var.VP);
|
||||
uint16_t tmp = ExtUI::getProgress_percent();
|
||||
//DEBUG_ECHOLNPGM(" data ", tmp);
|
||||
dgusdisplay.WriteVariable(var.VP, tmp);
|
||||
}
|
||||
|
||||
|
@ -153,9 +147,7 @@ void DGUSScreenHandler::DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var) {
|
|||
void DGUSScreenHandler::DGUSLCD_PercentageToUint8(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
if (var.memadr) {
|
||||
const uint16_t value = BE16_P(val_ptr);
|
||||
DEBUG_ECHOLNPGM("Got percent:", value);
|
||||
*(uint8_t*)var.memadr = map(constrain(value, 0, 100), 0, 100, 0, 255);
|
||||
DEBUG_ECHOLNPGM("Set uint8:", *(uint8_t*)var.memadr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -236,8 +228,6 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) {
|
|||
|
||||
void DGUSScreenHandler::DGUSLCD_SendFanStatusToDisplay(DGUS_VP_Variable &var) {
|
||||
if (var.memadr) {
|
||||
DEBUG_ECHOPGM(" DGUSLCD_SendFanStatusToDisplay ", var.VP);
|
||||
DEBUG_ECHOLNPGM(" data ", *(uint8_t *)var.memadr);
|
||||
uint16_t data_to_send = 0;
|
||||
if (*(uint8_t *) var.memadr) data_to_send = 1;
|
||||
dgusdisplay.WriteVariable(var.VP, data_to_send);
|
||||
|
@ -249,8 +239,6 @@ void DGUSScreenHandler::DGUSLCD_SendStringToDisplayPGM(DGUS_VP_Variable &var) {
|
|||
// Send heater status value to the display.
|
||||
void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var) {
|
||||
if (var.memadr) {
|
||||
DEBUG_ECHOPGM(" DGUSLCD_SendHeaterStatusToDisplay ", var.VP);
|
||||
DEBUG_ECHOLNPGM(" data ", *(int16_t *)var.memadr);
|
||||
uint16_t data_to_send = 0;
|
||||
if (*(int16_t *) var.memadr) data_to_send = 1;
|
||||
dgusdisplay.WriteVariable(var.VP, data_to_send);
|
||||
|
@ -263,11 +251,8 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var)
|
|||
// In FYSETC UI design there are 10 statuses to loop
|
||||
static uint16_t period = 0;
|
||||
static uint16_t index = 0;
|
||||
//DEBUG_ECHOPGM(" DGUSLCD_SendWaitingStatusToDisplay ", var.VP);
|
||||
//DEBUG_ECHOLNPGM(" data ", BE16_P(&index));
|
||||
if (period++ > DGUS_UI_WAITING_STATUS_PERIOD) {
|
||||
dgusdisplay.WriteVariable(var.VP, index);
|
||||
//DEBUG_ECHOLNPGM(" data ", BE16_P(&index));
|
||||
if (++index >= DGUS_UI_WAITING_STATUS) index = 0;
|
||||
period = 0;
|
||||
}
|
||||
|
@ -309,17 +294,14 @@ void DGUSScreenHandler::DGUSLCD_SendHeaterStatusToDisplay(DGUS_VP_Variable &var)
|
|||
const int16_t scroll = (int16_t)BE16_P(val_ptr);
|
||||
if (scroll) {
|
||||
top_file += scroll;
|
||||
DEBUG_ECHOPGM("new topfile calculated:", top_file);
|
||||
if (top_file < 0) {
|
||||
top_file = 0;
|
||||
DEBUG_ECHOLNPGM("Top of filelist reached");
|
||||
}
|
||||
else {
|
||||
int16_t max_top = filelist.count() - DGUS_SD_FILESPERSCREEN;
|
||||
NOLESS(max_top, 0);
|
||||
NOMORE(top_file, max_top);
|
||||
}
|
||||
DEBUG_ECHOPGM("new topfile adjusted:", top_file);
|
||||
}
|
||||
else if (!filelist.isAtRootDir()) {
|
||||
IF_DISABLED(DGUS_LCD_UI_MKS, filelist.upDir());
|
||||
|
@ -374,7 +356,6 @@ const DGUS_VP_Variable* DGUSLCD_FindVPVar(const uint16_t vp) {
|
|||
++ret;
|
||||
} while (1);
|
||||
|
||||
DEBUG_ECHOLNPGM("FindVPVar NOT FOUND ", vp);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -444,8 +425,6 @@ void DGUSScreenHandler::HandleFlowRateChanged(DGUS_VP_Variable &var, void *val_p
|
|||
}
|
||||
|
||||
void DGUSScreenHandler::HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleManualExtrude");
|
||||
|
||||
const int16_t movevalue = BE16_P(val_ptr);
|
||||
float target = movevalue * 0.01f;
|
||||
ExtUI::extruder_t target_extruder;
|
||||
|
@ -467,19 +446,16 @@ void DGUSScreenHandler::HandleManualExtrude(DGUS_VP_Variable &var, void *val_ptr
|
|||
|
||||
#if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
|
||||
void DGUSScreenHandler::HandleManualMoveOption(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleManualMoveOption");
|
||||
*(uint16_t*)var.memadr = BE16_P(val_ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
void DGUSScreenHandler::HandleMotorLockUnlock(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleMotorLockUnlock");
|
||||
const int16_t lock = BE16_P(val_ptr);
|
||||
queue.enqueue_one_now(lock ? F("M18") : F("M17"));
|
||||
}
|
||||
|
||||
void DGUSScreenHandler::HandleSettings(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleSettings");
|
||||
const uint16_t value = BE16_P(val_ptr);
|
||||
switch (value) {
|
||||
default: break;
|
||||
|
@ -495,7 +471,6 @@ void DGUSScreenHandler::HandleSettings(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
|
||||
void DGUSScreenHandler::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
const uint16_t value_raw = BE16_P(val_ptr);
|
||||
DEBUG_ECHOLNPGM("HandleStepPerMMChanged:", value_raw);
|
||||
const float value = (float)value_raw / 10;
|
||||
ExtUI::axis_t axis;
|
||||
switch (var.VP) {
|
||||
|
@ -504,15 +479,12 @@ void DGUSScreenHandler::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_
|
|||
case VP_Z_STEP_PER_MM: axis = ExtUI::axis_t::Z; break;
|
||||
default: return;
|
||||
}
|
||||
DEBUG_ECHOLNPGM("value:", value);
|
||||
ExtUI::setAxisSteps_per_mm(value, axis);
|
||||
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(axis));
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
||||
void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
const uint16_t value_raw = BE16_P(val_ptr);
|
||||
DEBUG_ECHOLNPGM("HandleStepPerMMExtruderChanged:", value_raw);
|
||||
const float value = (float)value_raw / 10;
|
||||
ExtUI::extruder_t extruder;
|
||||
switch (var.VP) {
|
||||
|
@ -524,16 +496,12 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo
|
|||
#endif
|
||||
#endif
|
||||
}
|
||||
DEBUG_ECHOLNPGM("value:", value);
|
||||
ExtUI::setAxisSteps_per_mm(value, extruder);
|
||||
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(extruder));
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
||||
#if HAS_PID_HEATING
|
||||
void DGUSScreenHandler::HandlePIDAutotune(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandlePIDAutotune");
|
||||
|
||||
char buf[32] = {0};
|
||||
|
||||
switch (var.VP) {
|
||||
|
@ -568,8 +536,6 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo
|
|||
|
||||
#if HAS_BED_PROBE
|
||||
void DGUSScreenHandler::HandleProbeOffsetZChanged(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleProbeOffsetZChanged");
|
||||
|
||||
const float offset = float(int16_t(BE16_P(val_ptr))) / 100.0f;
|
||||
ExtUI::setZOffset_mm(offset);
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
|
@ -579,14 +545,11 @@ void DGUSScreenHandler::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, vo
|
|||
|
||||
#if HAS_FAN
|
||||
void DGUSScreenHandler::HandleFanControl(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleFanControl");
|
||||
*(uint8_t*)var.memadr = *(uint8_t*)var.memadr > 0 ? 0 : 255;
|
||||
}
|
||||
#endif
|
||||
|
||||
void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleHeaterControl");
|
||||
|
||||
uint8_t preheat_temp = 0;
|
||||
switch (var.VP) {
|
||||
#if HAS_HOTEND
|
||||
|
@ -614,8 +577,6 @@ void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr
|
|||
#if ENABLED(DGUS_PREHEAT_UI)
|
||||
|
||||
void DGUSScreenHandler::HandlePreheat(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandlePreheat");
|
||||
|
||||
const uint16_t preheat_option = BE16_P(val_ptr);
|
||||
switch (preheat_option) {
|
||||
default:
|
||||
|
@ -654,7 +615,6 @@ void DGUSScreenHandler::HandleHeaterControl(DGUS_VP_Variable &var, void *val_ptr
|
|||
#endif
|
||||
|
||||
void DGUSScreenHandler::UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup) {
|
||||
DEBUG_ECHOLNPGM("SetNewScreen: ", newscreen);
|
||||
if (!popup) {
|
||||
memmove(&past_screens[1], &past_screens[0], sizeof(past_screens) - 1);
|
||||
past_screens[0] = current_screen;
|
||||
|
@ -665,18 +625,14 @@ void DGUSScreenHandler::UpdateNewScreen(DGUSLCD_Screens newscreen, bool popup) {
|
|||
}
|
||||
|
||||
void DGUSScreenHandler::PopToOldScreen() {
|
||||
DEBUG_ECHOLNPGM("PopToOldScreen s=", past_screens[0]);
|
||||
GotoScreen(past_screens[0], true);
|
||||
memmove(&past_screens[0], &past_screens[1], sizeof(past_screens) - 1);
|
||||
past_screens[sizeof(past_screens) - 1] = DGUSLCD_SCREEN_MAIN;
|
||||
}
|
||||
|
||||
void DGUSScreenHandler::UpdateScreenVPData() {
|
||||
DEBUG_ECHOPGM(" UpdateScreenVPData Screen: ", current_screen);
|
||||
|
||||
const uint16_t *VPList = DGUSLCD_FindScreenVPMapList(current_screen);
|
||||
if (!VPList) {
|
||||
DEBUG_ECHOLNPGM(" NO SCREEN FOR: ", current_screen);
|
||||
ScreenComplete = true;
|
||||
return; // nothing to do, likely a bug or boring screen.
|
||||
}
|
||||
|
@ -687,10 +643,8 @@ void DGUSScreenHandler::UpdateScreenVPData() {
|
|||
bool sent_one = false;
|
||||
do {
|
||||
uint16_t VP = pgm_read_word(VPList);
|
||||
DEBUG_ECHOPGM(" VP: ", VP);
|
||||
if (!VP) {
|
||||
update_ptr = 0;
|
||||
DEBUG_ECHOLNPGM(" UpdateScreenVPData done");
|
||||
ScreenComplete = true;
|
||||
return; // Screen completed.
|
||||
}
|
||||
|
@ -703,14 +657,10 @@ void DGUSScreenHandler::UpdateScreenVPData() {
|
|||
// Send the VP to the display, but try to avoid overrunning the Tx Buffer.
|
||||
// But send at least one VP, to avoid getting stalled.
|
||||
if (rcpy.send_to_display_handler && (!sent_one || expected_tx <= dgusdisplay.GetFreeTxBuffer())) {
|
||||
//DEBUG_ECHOPGM(" calling handler for ", rcpy.VP);
|
||||
sent_one = true;
|
||||
rcpy.send_to_display_handler(rcpy);
|
||||
}
|
||||
else {
|
||||
// auto x=dgusdisplay.GetFreeTxBuffer();
|
||||
//DEBUG_ECHOLNPGM(" tx almost full: ", x);
|
||||
//DEBUG_ECHOPGM(" update_ptr ", update_ptr);
|
||||
ScreenComplete = false;
|
||||
return; // please call again!
|
||||
}
|
||||
|
@ -725,7 +675,6 @@ void DGUSScreenHandler::GotoScreen(DGUSLCD_Screens screen, bool ispopup) {
|
|||
}
|
||||
|
||||
void DGUSDisplay::RequestScreen(DGUSLCD_Screens screen) {
|
||||
DEBUG_ECHOLNPGM("GotoScreen ", screen);
|
||||
const unsigned char gotoscreen[] = { 0x5A, 0x01, (unsigned char) (screen >> 8U), (unsigned char) (screen & 0xFFU) };
|
||||
WriteVariable(0x84, gotoscreen, sizeof(gotoscreen));
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ public:
|
|||
// Send a float value to the display.
|
||||
// Display will get a 4-byte integer scaled to the number of digits:
|
||||
// Tell the display the number of digits and it cheats by displaying a dot between...
|
||||
template<unsigned int decimals>
|
||||
template<uint16_t decimals>
|
||||
static void DGUSLCD_SendFloatAsLongValueToDisplay(DGUS_VP_Variable &var) {
|
||||
if (var.memadr) {
|
||||
float f = *(float *)var.memadr;
|
||||
|
@ -203,7 +203,7 @@ public:
|
|||
// Send a float value to the display.
|
||||
// Display will get a 2-byte integer scaled to the number of digits:
|
||||
// Tell the display the number of digits and it cheats by displaying a dot between...
|
||||
template<unsigned int decimals>
|
||||
template<uint16_t decimals>
|
||||
static void DGUSLCD_SendFloatAsIntValueToDisplay(DGUS_VP_Variable &var) {
|
||||
if (var.memadr) {
|
||||
float f = *(float *)var.memadr;
|
||||
|
|
|
@ -258,7 +258,7 @@ constexpr uint16_t VP_BED_STATUS = 0x331C;
|
|||
constexpr uint16_t VP_MOVE_OPTION = 0x3400;
|
||||
|
||||
// Step per mm
|
||||
constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , 2 byte unsigned int , 0~1638.4
|
||||
constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , uint16_t , 0~1638.4
|
||||
//constexpr uint16_t VP_X2_STEP_PER_MM = 0x3602;
|
||||
constexpr uint16_t VP_Y_STEP_PER_MM = 0x3604;
|
||||
//constexpr uint16_t VP_Y2_STEP_PER_MM = 0x3606;
|
||||
|
@ -272,10 +272,10 @@ constexpr uint16_t VP_E1_STEP_PER_MM = 0x3612;
|
|||
//constexpr uint16_t VP_E5_STEP_PER_MM = 0x361A;
|
||||
|
||||
// PIDs
|
||||
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4
|
||||
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4
|
||||
constexpr uint16_t VP_E0_PID_I = 0x3702;
|
||||
constexpr uint16_t VP_E0_PID_D = 0x3704;
|
||||
constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , 2 byte unsigned int , 0~1638.4
|
||||
constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , uint16_t , 0~1638.4
|
||||
constexpr uint16_t VP_E1_PID_I = 0x3708;
|
||||
constexpr uint16_t VP_E1_PID_D = 0x370A;
|
||||
constexpr uint16_t VP_BED_PID_P = 0x3710;
|
||||
|
|
|
@ -134,8 +134,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
// meaning "return to previous screen"
|
||||
DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1];
|
||||
|
||||
DEBUG_ECHOLNPGM("\n DEBUG target", target);
|
||||
|
||||
if (target == DGUSLCD_SCREEN_POPUP) {
|
||||
// Special handling for popup is to return to previous menu
|
||||
if (current_screen == DGUSLCD_SCREEN_POPUP && confirm_action_cb) confirm_action_cb();
|
||||
|
@ -151,8 +149,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
}
|
||||
|
||||
void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleManualMove");
|
||||
|
||||
int16_t movevalue = swap16(*(uint16_t*)val_ptr);
|
||||
#if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
|
||||
if (movevalue) {
|
||||
|
@ -161,7 +157,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
}
|
||||
#endif
|
||||
char axiscode;
|
||||
unsigned int speed = 1500; // FIXME: get default feedrate for manual moves, don't hardcode.
|
||||
uint16_t speed = _mf[X_AXIS]; // Default feedrate for manual moves
|
||||
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
|
@ -171,16 +167,21 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
if (!ExtUI::canMove(ExtUI::axis_t::X)) goto cannotmove;
|
||||
break;
|
||||
|
||||
case VP_MOVE_Y:
|
||||
axiscode = 'Y';
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
|
||||
break;
|
||||
#if HAS_Y_AXIS
|
||||
case VP_MOVE_Y:
|
||||
axiscode = 'Y';
|
||||
speed = _mf[Y_AXIS];
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case VP_MOVE_Z:
|
||||
axiscode = 'Z';
|
||||
speed = 300; // default to 5mm/s
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
|
||||
break;
|
||||
#if HAS_Z_AXIS
|
||||
case VP_MOVE_Z:
|
||||
axiscode = 'Z';
|
||||
speed = _mf[Z_AXIS];
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case VP_HOME_ALL: // only used for homing
|
||||
axiscode = '\0';
|
||||
|
@ -190,63 +191,42 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
|
||||
if (!movevalue) {
|
||||
// homing
|
||||
DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode));
|
||||
char buf[6] = "G28 X";
|
||||
buf[4] = axiscode;
|
||||
//DEBUG_ECHOPGM(" ", buf);
|
||||
queue.enqueue_one_now(buf);
|
||||
//DEBUG_ECHOLNPGM(" ✓");
|
||||
ForceCompleteUpdate();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// movement
|
||||
DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode));
|
||||
bool old_relative_mode = relative_mode;
|
||||
if (!relative_mode) {
|
||||
//DEBUG_ECHOPGM(" G91");
|
||||
queue.enqueue_now(F("G91"));
|
||||
//DEBUG_ECHOPGM(" ✓ ");
|
||||
}
|
||||
if (!relative_mode) queue.enqueue_now(F("G91"));
|
||||
char buf[32]; // G1 X9999.99 F12345
|
||||
unsigned int backup_speed = MMS_TO_MMM(feedrate_mm_s);
|
||||
const uint16_t backup_speed = MMS_TO_MMM(feedrate_mm_s);
|
||||
char sign[] = "\0";
|
||||
int16_t value = movevalue / 100;
|
||||
if (movevalue < 0) { value = -value; sign[0] = '-'; }
|
||||
int16_t fraction = ABS(movevalue) % 100;
|
||||
snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed);
|
||||
//DEBUG_ECHOPGM(" ", buf);
|
||||
queue.enqueue_one_now(buf);
|
||||
//DEBUG_ECHOLNPGM(" ✓ ");
|
||||
if (backup_speed != speed) {
|
||||
snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed);
|
||||
queue.enqueue_one_now(buf);
|
||||
//DEBUG_ECHOPGM(" ", buf);
|
||||
}
|
||||
// while (!enqueue_and_echo_command(buf)) idle();
|
||||
//DEBUG_ECHOLNPGM(" ✓ ");
|
||||
if (!old_relative_mode) {
|
||||
//DEBUG_ECHOPGM("G90");
|
||||
queue.enqueue_now(F("G90"));
|
||||
//DEBUG_ECHOPGM(" ✓ ");
|
||||
}
|
||||
//while (!enqueue_and_echo_command(buf)) idle();
|
||||
if (!old_relative_mode) queue.enqueue_now(F("G90"));
|
||||
}
|
||||
|
||||
ForceCompleteUpdate();
|
||||
DEBUG_ECHOLNPGM("manmv done.");
|
||||
return;
|
||||
|
||||
cannotmove:
|
||||
DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode));
|
||||
return;
|
||||
}
|
||||
|
||||
#if HAS_PID_HEATING
|
||||
void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
uint16_t rawvalue = swap16(*(uint16_t*)val_ptr);
|
||||
DEBUG_ECHOLNPGM("V1:", rawvalue);
|
||||
float value = (float)rawvalue / 10;
|
||||
DEBUG_ECHOLNPGM("V2:", value);
|
||||
float newvalue = 0;
|
||||
|
||||
switch (var.VP) {
|
||||
|
@ -268,7 +248,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
#endif
|
||||
}
|
||||
|
||||
DEBUG_ECHOLNPGM("V3:", newvalue);
|
||||
*(float *)var.memadr = newvalue;
|
||||
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
|
@ -277,7 +256,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
|
||||
#if ENABLED(BABYSTEPPING)
|
||||
void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleLiveAdjustZ");
|
||||
int16_t flag = swap16(*(uint16_t*)val_ptr),
|
||||
steps = flag ? -20 : 20;
|
||||
ExtUI::smartAdjustAxis_steps(steps, ExtUI::axis_t::Z, true);
|
||||
|
@ -288,8 +266,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
#if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
|
||||
|
||||
void DGUSScreenHandler::HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleFilamentOption");
|
||||
|
||||
uint8_t e_temp = 0;
|
||||
filament_data.heated = false;
|
||||
uint16_t preheat_option = swap16(*(uint16_t*)val_ptr);
|
||||
|
@ -360,7 +336,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
}
|
||||
|
||||
void DGUSScreenHandler::HandleFilamentLoadUnload(DGUS_VP_Variable &var) {
|
||||
DEBUG_ECHOLNPGM("HandleFilamentLoadUnload");
|
||||
if (filament_data.action <= 0) return;
|
||||
|
||||
// If we close to the target temperature, we can start load or unload the filament
|
||||
|
|
|
@ -257,7 +257,7 @@ constexpr uint16_t VP_BED_STATUS = 0x331C;
|
|||
constexpr uint16_t VP_MOVE_OPTION = 0x3400;
|
||||
|
||||
// Step per mm
|
||||
constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , 2 byte unsigned int , 0~1638.4
|
||||
constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , uint16_t , 0~1638.4
|
||||
//constexpr uint16_t VP_X2_STEP_PER_MM = 0x3602;
|
||||
constexpr uint16_t VP_Y_STEP_PER_MM = 0x3604;
|
||||
//constexpr uint16_t VP_Y2_STEP_PER_MM = 0x3606;
|
||||
|
@ -271,7 +271,7 @@ constexpr uint16_t VP_E0_STEP_PER_MM = 0x3610;
|
|||
//constexpr uint16_t VP_E5_STEP_PER_MM = 0x361A;
|
||||
|
||||
// PIDs
|
||||
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4
|
||||
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4
|
||||
constexpr uint16_t VP_E0_PID_I = 0x3702;
|
||||
constexpr uint16_t VP_E0_PID_D = 0x3704;
|
||||
constexpr uint16_t VP_BED_PID_P = 0x3710;
|
||||
|
|
|
@ -134,8 +134,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
// meaning "return to previous screen"
|
||||
DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1];
|
||||
|
||||
DEBUG_ECHOLNPGM("\n DEBUG target", target);
|
||||
|
||||
if (target == DGUSLCD_SCREEN_POPUP) {
|
||||
// Special handling for popup is to return to previous menu
|
||||
if (current_screen == DGUSLCD_SCREEN_POPUP && confirm_action_cb) confirm_action_cb();
|
||||
|
@ -151,8 +149,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
}
|
||||
|
||||
void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleManualMove");
|
||||
|
||||
int16_t movevalue = swap16(*(uint16_t*)val_ptr);
|
||||
#if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
|
||||
if (movevalue) {
|
||||
|
@ -161,7 +157,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
}
|
||||
#endif
|
||||
char axiscode;
|
||||
unsigned int speed = 1500; // FIXME: get default feedrate for manual moves, don't hardcode.
|
||||
uint16_t speed = _mf[X_AXIS]; // Default feedrate for manual moves
|
||||
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
|
@ -171,16 +167,21 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
if (!ExtUI::canMove(ExtUI::axis_t::X)) goto cannotmove;
|
||||
break;
|
||||
|
||||
case VP_MOVE_Y:
|
||||
axiscode = 'Y';
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
|
||||
break;
|
||||
#if HAS_Y_AXIS
|
||||
case VP_MOVE_Y:
|
||||
axiscode = 'Y';
|
||||
speed = _mf[Y_AXIS];
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case VP_MOVE_Z:
|
||||
axiscode = 'Z';
|
||||
speed = 300; // default to 5mm/s
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
|
||||
break;
|
||||
#if HAS_Z_AXIS
|
||||
case VP_MOVE_Z:
|
||||
axiscode = 'Z';
|
||||
speed = _mf[Z_AXIS];
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case VP_HOME_ALL: // only used for homing
|
||||
axiscode = '\0';
|
||||
|
@ -190,63 +191,42 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
|
||||
if (!movevalue) {
|
||||
// homing
|
||||
DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode));
|
||||
char buf[6] = "G28 X";
|
||||
buf[4] = axiscode;
|
||||
//DEBUG_ECHOPGM(" ", buf);
|
||||
queue.enqueue_one_now(buf);
|
||||
//DEBUG_ECHOLNPGM(" ✓");
|
||||
ForceCompleteUpdate();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// movement
|
||||
DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode));
|
||||
bool old_relative_mode = relative_mode;
|
||||
if (!relative_mode) {
|
||||
//DEBUG_ECHOPGM(" G91");
|
||||
queue.enqueue_now(F("G91"));
|
||||
//DEBUG_ECHOPGM(" ✓ ");
|
||||
}
|
||||
const bool old_relative_mode = relative_mode;
|
||||
if (!relative_mode) queue.enqueue_now(F("G91"));
|
||||
char buf[32]; // G1 X9999.99 F12345
|
||||
unsigned int backup_speed = MMS_TO_MMM(feedrate_mm_s);
|
||||
const uint16_t backup_speed = MMS_TO_MMM(feedrate_mm_s);
|
||||
char sign[] = "\0";
|
||||
int16_t value = movevalue / 100;
|
||||
if (movevalue < 0) { value = -value; sign[0] = '-'; }
|
||||
int16_t fraction = ABS(movevalue) % 100;
|
||||
snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed);
|
||||
//DEBUG_ECHOPGM(" ", buf);
|
||||
queue.enqueue_one_now(buf);
|
||||
//DEBUG_ECHOLNPGM(" ✓ ");
|
||||
if (backup_speed != speed) {
|
||||
snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed);
|
||||
queue.enqueue_one_now(buf);
|
||||
//DEBUG_ECHOPGM(" ", buf);
|
||||
}
|
||||
// while (!enqueue_and_echo_command(buf)) idle();
|
||||
//DEBUG_ECHOLNPGM(" ✓ ");
|
||||
if (!old_relative_mode) {
|
||||
//DEBUG_ECHOPGM("G90");
|
||||
queue.enqueue_now(F("G90"));
|
||||
//DEBUG_ECHOPGM(" ✓ ");
|
||||
}
|
||||
//while (!enqueue_and_echo_command(buf)) idle();
|
||||
if (!old_relative_mode) queue.enqueue_now(F("G90"));
|
||||
}
|
||||
|
||||
ForceCompleteUpdate();
|
||||
DEBUG_ECHOLNPGM("manmv done.");
|
||||
return;
|
||||
|
||||
cannotmove:
|
||||
DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode));
|
||||
return;
|
||||
}
|
||||
|
||||
#if HAS_PID_HEATING
|
||||
void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
uint16_t rawvalue = swap16(*(uint16_t*)val_ptr);
|
||||
DEBUG_ECHOLNPGM("V1:", rawvalue);
|
||||
float value = (float)rawvalue / 10;
|
||||
DEBUG_ECHOLNPGM("V2:", value);
|
||||
float newvalue = 0;
|
||||
|
||||
switch (var.VP) {
|
||||
|
@ -268,7 +248,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
#endif
|
||||
}
|
||||
|
||||
DEBUG_ECHOLNPGM("V3:", newvalue);
|
||||
*(float *)var.memadr = newvalue;
|
||||
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
|
@ -277,7 +256,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
|
||||
#if ENABLED(BABYSTEPPING)
|
||||
void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleLiveAdjustZ");
|
||||
int16_t flag = swap16(*(uint16_t*)val_ptr),
|
||||
steps = flag ? -20 : 20;
|
||||
ExtUI::smartAdjustAxis_steps(steps, ExtUI::axis_t::Z, true);
|
||||
|
@ -288,8 +266,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
#if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
|
||||
|
||||
void DGUSScreenHandler::HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleFilamentOption");
|
||||
|
||||
uint8_t e_temp = 0;
|
||||
filament_data.heated = false;
|
||||
uint16_t preheat_option = swap16(*(uint16_t*)val_ptr);
|
||||
|
@ -360,7 +336,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
}
|
||||
|
||||
void DGUSScreenHandler::HandleFilamentLoadUnload(DGUS_VP_Variable &var) {
|
||||
DEBUG_ECHOLNPGM("HandleFilamentLoadUnload");
|
||||
if (filament_data.action <= 0) return;
|
||||
|
||||
// If we close to the target temperature, we can start load or unload the filament
|
||||
|
|
|
@ -256,10 +256,10 @@ constexpr uint16_t VP_E1_STATUS = 0x3412;
|
|||
constexpr uint16_t VP_MOVE_OPTION = 0x3500;
|
||||
|
||||
// // PIDs
|
||||
// constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4
|
||||
// constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4
|
||||
// constexpr uint16_t VP_E0_PID_I = 0x3702;
|
||||
// constexpr uint16_t VP_E0_PID_D = 0x3704;
|
||||
// constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , 2 byte unsigned int , 0~1638.4
|
||||
// constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , uint16_t , 0~1638.4
|
||||
// constexpr uint16_t VP_E1_PID_I = 0x3708;
|
||||
// constexpr uint16_t VP_E1_PID_D = 0x370A;
|
||||
// constexpr uint16_t VP_BED_PID_P = 0x3710;
|
||||
|
@ -414,7 +414,7 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
constexpr uint16_t VP_FAN3_STATUS = 0x2716;
|
||||
|
||||
// Step per mm
|
||||
constexpr uint16_t VP_X_STEP_PER_MM = 0x2900; // at the moment , 2 byte unsigned int , 0~1638.4
|
||||
constexpr uint16_t VP_X_STEP_PER_MM = 0x2900; // at the moment , uint16_t , 0~1638.4
|
||||
constexpr uint16_t VP_Y_STEP_PER_MM = 0x2904;
|
||||
constexpr uint16_t VP_Z_STEP_PER_MM = 0x2908;
|
||||
constexpr uint16_t VP_E0_STEP_PER_MM = 0x2910;
|
||||
|
@ -521,10 +521,10 @@ constexpr uint16_t SP_T_Bed_Set = 0x5040;
|
|||
constexpr uint16_t VP_PrintTime_S = 0x3504;
|
||||
|
||||
// PIDs
|
||||
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4
|
||||
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4
|
||||
constexpr uint16_t VP_E0_PID_I = 0x3702;
|
||||
constexpr uint16_t VP_E0_PID_D = 0x3704;
|
||||
constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , 2 byte unsigned int , 0~1638.4
|
||||
constexpr uint16_t VP_E1_PID_P = 0x3706; // at the moment , uint16_t , 0~1638.4
|
||||
constexpr uint16_t VP_E1_PID_I = 0x3708;
|
||||
constexpr uint16_t VP_E1_PID_D = 0x370A;
|
||||
constexpr uint16_t VP_BED_PID_P = 0x3710;
|
||||
|
|
|
@ -80,8 +80,6 @@ void DGUSScreenHandlerMKS::sendinfoscreen(const void *line1, const void *line2,
|
|||
|
||||
void DGUSScreenHandlerMKS::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) {
|
||||
if (var.memadr) {
|
||||
//DEBUG_ECHOPGM(" DGUS_LCD_SendWordValueToDisplay ", var.VP);
|
||||
//DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr);
|
||||
uint16_t tmp = *(uint8_t *) var.memadr; // +1 -> avoid rounding issues for the display.
|
||||
// tmp = map(tmp, 0, 255, 0, 100);
|
||||
dgusdisplay.WriteVariable(var.VP, tmp);
|
||||
|
@ -90,7 +88,6 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendFanToDisplay(DGUS_VP_Variable &var) {
|
|||
|
||||
void DGUSScreenHandlerMKS::DGUSLCD_SendBabyStepToDisplay(DGUS_VP_Variable &var) {
|
||||
float value = current_position.z;
|
||||
DEBUG_ECHOLNPAIR_F(" >> ", value, 6);
|
||||
value *= cpow(10, 2);
|
||||
dgusdisplay.WriteVariable(VP_SD_Print_Baby, (uint16_t)value);
|
||||
}
|
||||
|
@ -106,14 +103,11 @@ void DGUSScreenHandlerMKS::DGUSLCD_SendPrintTimeToDisplay(DGUS_VP_Variable &var)
|
|||
void DGUSScreenHandlerMKS::DGUSLCD_SetUint8(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
if (var.memadr) {
|
||||
const uint16_t value = BE16_P(val_ptr);
|
||||
DEBUG_ECHOLNPGM("Got uint8:", value);
|
||||
*(uint8_t*)var.memadr = map(constrain(value, 0, 255), 0, 255, 0, 255);
|
||||
DEBUG_ECHOLNPGM("Set uint8:", *(uint8_t*)var.memadr);
|
||||
}
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::DGUSLCD_SendGbkToDisplay(DGUS_VP_Variable &var) {
|
||||
DEBUG_ECHOLNPGM(" data ", *(uint16_t *)var.memadr);
|
||||
uint16_t *tmp = (uint16_t*) var.memadr;
|
||||
dgusdisplay.WriteVariable(var.VP, tmp, var.size, true);
|
||||
}
|
||||
|
@ -278,8 +272,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
// meaning "return to previous screen"
|
||||
DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1];
|
||||
|
||||
DEBUG_ECHOLNPGM("\n DEBUG target", target);
|
||||
|
||||
// when the dgus had reboot, it will enter the DGUSLCD_SCREEN_MAIN page,
|
||||
// so user can change any page to use this function, an it will check
|
||||
// if robin nano is printing. when it is, dgus will enter the printing
|
||||
|
@ -313,7 +305,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
|
||||
void DGUSScreenHandlerMKS::ScreenBackChange(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
const uint16_t target = BE16_P(val_ptr);
|
||||
DEBUG_ECHOLNPGM(" back = 0x%x", target);
|
||||
switch (target) {
|
||||
}
|
||||
}
|
||||
|
@ -327,7 +318,6 @@ void DGUSScreenHandlerMKS::ZoffsetConfirm(DGUS_VP_Variable &var, void *val_ptr)
|
|||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::GetTurnOffCtrl(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("GetTurnOffCtrl\n");
|
||||
const uint16_t value = BE16_P(val_ptr);
|
||||
switch (value) {
|
||||
case 0 ... 1: DGUSAutoTurnOff = (bool)value; break;
|
||||
|
@ -336,7 +326,6 @@ void DGUSScreenHandlerMKS::GetTurnOffCtrl(DGUS_VP_Variable &var, void *val_ptr)
|
|||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::GetMinExtrudeTemp(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("GetMinExtrudeTemp");
|
||||
const uint16_t value = BE16_P(val_ptr);
|
||||
TERN_(PREVENT_COLD_EXTRUSION, thermalManager.extrude_min_temp = value);
|
||||
mks_min_extrusion_temp = value;
|
||||
|
@ -344,7 +333,6 @@ void DGUSScreenHandlerMKS::GetMinExtrudeTemp(DGUS_VP_Variable &var, void *val_pt
|
|||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::GetZoffsetDistance(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("GetZoffsetDistance");
|
||||
const uint16_t value = BE16_P(val_ptr);
|
||||
float val_distance = 0;
|
||||
switch (value) {
|
||||
|
@ -358,7 +346,6 @@ void DGUSScreenHandlerMKS::GetZoffsetDistance(DGUS_VP_Variable &var, void *val_p
|
|||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::GetManualMovestep(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("\nGetManualMovestep");
|
||||
*(uint16_t *)var.memadr = BE16_P(val_ptr);
|
||||
}
|
||||
|
||||
|
@ -395,7 +382,6 @@ void DGUSScreenHandlerMKS::GetOffsetValue(DGUS_VP_Variable &var, void *val_ptr)
|
|||
#if HAS_BED_PROBE
|
||||
const int32_t value = BE32_P(val_ptr);
|
||||
const float Offset = value / 100.0f;
|
||||
DEBUG_ECHOLNPGM("\nget int6 offset >> ", value, 6);
|
||||
|
||||
switch (var.VP) {
|
||||
default: break;
|
||||
|
@ -743,8 +729,6 @@ void DGUSScreenHandlerMKS::TMC_ChangeConfig(DGUS_VP_Variable &var, void *val_ptr
|
|||
}
|
||||
|
||||
void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleManualMove");
|
||||
|
||||
int16_t movevalue = BE16_P(val_ptr);
|
||||
|
||||
// Choose Move distance
|
||||
|
@ -752,69 +736,64 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
else if (manualMoveStep == 0x02) manualMoveStep = 100;
|
||||
else if (manualMoveStep == 0x03) manualMoveStep = 1000;
|
||||
|
||||
DEBUG_ECHOLNPGM("QUEUE LEN:", queue.ring_buffer.length);
|
||||
|
||||
if (!print_job_timer.isPaused() && !queue.ring_buffer.empty())
|
||||
return;
|
||||
|
||||
char axiscode;
|
||||
unsigned int speed = 1500; // FIXME: get default feedrate for manual moves, don't hardcode.
|
||||
uint16_t speed = _mf[X_AXIS]; // Default feedrate for manual moves
|
||||
|
||||
switch (var.VP) { // switch X Y Z or Home
|
||||
default: return;
|
||||
case VP_MOVE_X:
|
||||
DEBUG_ECHOLNPGM("X Move");
|
||||
axiscode = 'X';
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::X)) goto cannotmove;
|
||||
break;
|
||||
|
||||
case VP_MOVE_Y:
|
||||
DEBUG_ECHOLNPGM("Y Move");
|
||||
axiscode = 'Y';
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
|
||||
break;
|
||||
#if HAS_Y_AXIS
|
||||
case VP_MOVE_Y:
|
||||
axiscode = 'Y';
|
||||
speed = _mf[Y_AXIS];
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case VP_MOVE_Z:
|
||||
DEBUG_ECHOLNPGM("Z Move");
|
||||
axiscode = 'Z';
|
||||
speed = 300; // default to 5mm/s
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
|
||||
break;
|
||||
#if HAS_Z_AXIS
|
||||
case VP_MOVE_Z:
|
||||
axiscode = 'Z';
|
||||
speed = _mf[Z_AXIS];
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case VP_MOTOR_LOCK_UNLOK:
|
||||
DEBUG_ECHOLNPGM("Motor Unlock");
|
||||
movevalue = 5;
|
||||
axiscode = '\0';
|
||||
// return ;
|
||||
break;
|
||||
|
||||
case VP_HOME_ALL: // only used for homing
|
||||
DEBUG_ECHOLNPGM("Home all");
|
||||
axiscode = '\0';
|
||||
axiscode = '\0';
|
||||
movevalue = 0; // ignore value sent from display, this VP is _ONLY_ for homing.
|
||||
//return;
|
||||
break;
|
||||
|
||||
case VP_X_HOME:
|
||||
DEBUG_ECHOLNPGM("X Home");
|
||||
axiscode = 'X';
|
||||
axiscode = 'X';
|
||||
movevalue = 0;
|
||||
break;
|
||||
|
||||
case VP_Y_HOME:
|
||||
DEBUG_ECHOLNPGM("Y Home");
|
||||
axiscode = 'Y';
|
||||
movevalue = 0;
|
||||
break;
|
||||
#if HAS_Y_AXIS
|
||||
case VP_Y_HOME:
|
||||
axiscode = 'Y';
|
||||
movevalue = 0;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case VP_Z_HOME:
|
||||
DEBUG_ECHOLNPGM("Z Home");
|
||||
axiscode = 'Z';
|
||||
movevalue = 0;
|
||||
break;
|
||||
#if HAS_Z_AXIS
|
||||
case VP_Z_HOME:
|
||||
axiscode = 'Z';
|
||||
movevalue = 0;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
DEBUG_ECHOPGM("movevalue = ", movevalue);
|
||||
if (movevalue != 0 && movevalue != 5) { // get move distance
|
||||
switch (movevalue) {
|
||||
case 0x0001: movevalue = manualMoveStep; break;
|
||||
|
@ -824,21 +803,16 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
}
|
||||
|
||||
if (!movevalue) {
|
||||
// homing
|
||||
DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode));
|
||||
// char buf[6] = "G28 X";
|
||||
// buf[4] = axiscode;
|
||||
|
||||
char buf[6];
|
||||
sprintf(buf, "G28 %c", axiscode);
|
||||
//DEBUG_ECHOPGM(" ", buf);
|
||||
queue.enqueue_one_now(buf);
|
||||
//DEBUG_ECHOLNPGM(" ✓");
|
||||
ForceCompleteUpdate();
|
||||
return;
|
||||
}
|
||||
else if (movevalue == 5) {
|
||||
DEBUG_ECHOPGM("send M84");
|
||||
char buf[6];
|
||||
snprintf_P(buf,6,PSTR("M84 %c"), axiscode);
|
||||
queue.enqueue_one_now(buf);
|
||||
|
@ -847,45 +821,30 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
}
|
||||
else {
|
||||
// movement
|
||||
DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode));
|
||||
bool old_relative_mode = relative_mode;
|
||||
|
||||
if (!relative_mode) {
|
||||
//DEBUG_ECHOPGM(" G91");
|
||||
queue.enqueue_now(F("G91"));
|
||||
//DEBUG_ECHOPGM(" ✓ ");
|
||||
}
|
||||
const bool old_relative_mode = relative_mode;
|
||||
if (!relative_mode) queue.enqueue_now(F("G91"));
|
||||
char buf[32]; // G1 X9999.99 F12345
|
||||
// unsigned int backup_speed = MMS_TO_MMM(feedrate_mm_s);
|
||||
//const uint16_t backup_speed = MMS_TO_MMM(feedrate_mm_s);
|
||||
char sign[] = "\0";
|
||||
int16_t value = movevalue / 100;
|
||||
if (movevalue < 0) { value = -value; sign[0] = '-'; }
|
||||
int16_t fraction = ABS(movevalue) % 100;
|
||||
const int16_t fraction = ABS(movevalue) % 100;
|
||||
snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed);
|
||||
queue.enqueue_one_now(buf);
|
||||
|
||||
//if (backup_speed != speed) {
|
||||
// snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed);
|
||||
// queue.enqueue_one_now(buf);
|
||||
// //DEBUG_ECHOPGM(" ", buf);
|
||||
//}
|
||||
|
||||
//while (!enqueue_and_echo_command(buf)) idle();
|
||||
//DEBUG_ECHOLNPGM(" ✓ ");
|
||||
if (!old_relative_mode) {
|
||||
//DEBUG_ECHOPGM("G90");
|
||||
//queue.enqueue_now(F("G90"));
|
||||
queue.enqueue_now(F("G90"));
|
||||
//DEBUG_ECHOPGM(" ✓ ");
|
||||
}
|
||||
|
||||
if (!old_relative_mode) queue.enqueue_now(F("G90"));
|
||||
}
|
||||
|
||||
ForceCompleteUpdate();
|
||||
DEBUG_ECHOLNPGM("manmv done.");
|
||||
return;
|
||||
|
||||
cannotmove:
|
||||
DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -902,10 +861,7 @@ void DGUSScreenHandlerMKS::GetParkPos(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::HandleChangeLevelPoint(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleChangeLevelPoint");
|
||||
|
||||
const int16_t value_raw = BE16_P(val_ptr);
|
||||
DEBUG_ECHOLNPGM("value_raw:", value_raw);
|
||||
|
||||
*(int16_t*)var.memadr = value_raw;
|
||||
|
||||
|
@ -914,14 +870,9 @@ void DGUSScreenHandlerMKS::HandleChangeLevelPoint(DGUS_VP_Variable &var, void *v
|
|||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleStepPerMMChanged");
|
||||
|
||||
const uint16_t value_raw = BE16_P(val_ptr);
|
||||
const float value = (float)value_raw;
|
||||
|
||||
DEBUG_ECHOLNPGM("value_raw:", value_raw);
|
||||
DEBUG_ECHOLNPGM("value:", value);
|
||||
|
||||
ExtUI::axis_t axis;
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
|
@ -930,20 +881,14 @@ void DGUSScreenHandlerMKS::HandleStepPerMMChanged(DGUS_VP_Variable &var, void *v
|
|||
case VP_Z_STEP_PER_MM: axis = ExtUI::axis_t::Z; break;
|
||||
}
|
||||
ExtUI::setAxisSteps_per_mm(value, axis);
|
||||
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(axis));
|
||||
settings.save();
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleStepPerMMExtruderChanged");
|
||||
|
||||
const uint16_t value_raw = BE16_P(val_ptr);
|
||||
const float value = (float)value_raw;
|
||||
|
||||
DEBUG_ECHOLNPGM("value_raw:", value_raw);
|
||||
DEBUG_ECHOLNPGM("value:", value);
|
||||
|
||||
ExtUI::extruder_t extruder;
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
|
@ -955,20 +900,14 @@ void DGUSScreenHandlerMKS::HandleStepPerMMExtruderChanged(DGUS_VP_Variable &var,
|
|||
#endif
|
||||
}
|
||||
ExtUI::setAxisSteps_per_mm(value, extruder);
|
||||
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisSteps_per_mm(extruder));
|
||||
settings.save();
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::HandleMaxSpeedChange(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleMaxSpeedChange");
|
||||
|
||||
const uint16_t value_raw = BE16_P(val_ptr);
|
||||
const float value = (float)value_raw;
|
||||
|
||||
DEBUG_ECHOLNPGM("value_raw:", value_raw);
|
||||
DEBUG_ECHOLNPGM("value:", value);
|
||||
|
||||
ExtUI::axis_t axis;
|
||||
switch (var.VP) {
|
||||
case VP_X_MAX_SPEED: axis = ExtUI::axis_t::X; break;
|
||||
|
@ -977,20 +916,14 @@ void DGUSScreenHandlerMKS::HandleMaxSpeedChange(DGUS_VP_Variable &var, void *val
|
|||
default: return;
|
||||
}
|
||||
ExtUI::setAxisMaxFeedrate_mm_s(value, axis);
|
||||
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxFeedrate_mm_s(axis));
|
||||
settings.save();
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::HandleExtruderMaxSpeedChange(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleExtruderMaxSpeedChange");
|
||||
|
||||
const uint16_t value_raw = BE16_P(val_ptr);
|
||||
const float value = (float)value_raw;
|
||||
|
||||
DEBUG_ECHOLNPGM("value_raw:", value_raw);
|
||||
DEBUG_ECHOLNPGM("value:", value);
|
||||
|
||||
ExtUI::extruder_t extruder;
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
|
@ -1002,20 +935,14 @@ void DGUSScreenHandlerMKS::HandleExtruderMaxSpeedChange(DGUS_VP_Variable &var, v
|
|||
case VP_E1_MAX_SPEED: extruder = ExtUI::extruder_t::E1; break;
|
||||
}
|
||||
ExtUI::setAxisMaxFeedrate_mm_s(value, extruder);
|
||||
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxFeedrate_mm_s(extruder));
|
||||
settings.save();
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::HandleMaxAccChange(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleMaxAccChange");
|
||||
|
||||
const uint16_t value_raw = BE16_P(val_ptr);
|
||||
const float value = (float)value_raw;
|
||||
|
||||
DEBUG_ECHOLNPGM("value_raw:", value_raw);
|
||||
DEBUG_ECHOLNPGM("value:", value);
|
||||
|
||||
ExtUI::axis_t axis;
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
|
@ -1024,16 +951,12 @@ void DGUSScreenHandlerMKS::HandleMaxAccChange(DGUS_VP_Variable &var, void *val_p
|
|||
case VP_Z_ACC_MAX_SPEED: axis = ExtUI::axis_t::Z; break;
|
||||
}
|
||||
ExtUI::setAxisMaxAcceleration_mm_s2(value, axis);
|
||||
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxAcceleration_mm_s2(axis));
|
||||
settings.save();
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::HandleExtruderAccChange(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleExtruderAccChange");
|
||||
|
||||
uint16_t value_raw = BE16_P(val_ptr);
|
||||
DEBUG_ECHOLNPGM("value_raw:", value_raw);
|
||||
float value = (float)value_raw;
|
||||
ExtUI::extruder_t extruder;
|
||||
switch (var.VP) {
|
||||
|
@ -1045,9 +968,7 @@ void DGUSScreenHandlerMKS::HandleExtruderAccChange(DGUS_VP_Variable &var, void *
|
|||
case VP_E1_ACC_MAX_SPEED: extruder = ExtUI::extruder_t::E1; settings.load(); break;
|
||||
#endif
|
||||
}
|
||||
DEBUG_ECHOLNPGM("value:", value);
|
||||
ExtUI::setAxisMaxAcceleration_mm_s2(value, extruder);
|
||||
DEBUG_ECHOLNPGM("value_set:", ExtUI::getAxisMaxAcceleration_mm_s2(extruder));
|
||||
settings.save();
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
@ -1087,9 +1008,7 @@ void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr)
|
|||
#if HAS_PID_HEATING
|
||||
void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
const uint16_t rawvalue = BE16_P(val_ptr);
|
||||
DEBUG_ECHOLNPGM("V1:", rawvalue);
|
||||
const float value = 1.0f * rawvalue;
|
||||
DEBUG_ECHOLNPGM("V2:", value);
|
||||
const float value = float(rawvalue);
|
||||
float newvalue = 0;
|
||||
|
||||
switch (var.VP) {
|
||||
|
@ -1111,7 +1030,6 @@ void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr)
|
|||
#endif
|
||||
}
|
||||
|
||||
DEBUG_ECHOLNPGM("V3:", newvalue);
|
||||
*(float *)var.memadr = newvalue;
|
||||
|
||||
settings.save();
|
||||
|
@ -1121,7 +1039,6 @@ void DGUSScreenHandlerMKS::HandleAccChange(DGUS_VP_Variable &var, void *val_ptr)
|
|||
|
||||
#if ENABLED(BABYSTEPPING)
|
||||
void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleLiveAdjustZ");
|
||||
const float step = ZOffset_distance;
|
||||
|
||||
const uint16_t flag = BE16_P(val_ptr);
|
||||
|
@ -1166,7 +1083,6 @@ void DGUSScreenHandlerMKS::GetManualFilament(DGUS_VP_Variable &var, void *val_pt
|
|||
const uint16_t value_len = BE16_P(val_ptr);
|
||||
const float value = (float)value_len;
|
||||
|
||||
DEBUG_ECHOLNPGM("GetManualFilament:", value);
|
||||
distanceFilament = value;
|
||||
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
|
@ -1175,7 +1091,6 @@ void DGUSScreenHandlerMKS::GetManualFilament(DGUS_VP_Variable &var, void *val_pt
|
|||
void DGUSScreenHandlerMKS::GetManualFilamentSpeed(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
const uint16_t value_len = BE16_P(val_ptr);
|
||||
filamentSpeed_mm_s = value_len;
|
||||
DEBUG_ECHOLNPGM("GetManualFilamentSpeed:", value_len);
|
||||
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
}
|
||||
|
@ -1264,20 +1179,16 @@ void GcodeSuite::M1002() {
|
|||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::FilamentLoad(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("FilamentLoad");
|
||||
FilamentLoadUnload(var, val_ptr, 1);
|
||||
}
|
||||
|
||||
void DGUSScreenHandlerMKS::FilamentUnLoad(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("FilamentUnLoad");
|
||||
FilamentLoadUnload(var, val_ptr, -1);
|
||||
}
|
||||
|
||||
#if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
|
||||
|
||||
void DGUSScreenHandler::HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleFilamentOption");
|
||||
|
||||
uint8_t e_temp = 0;
|
||||
filament_data.heated = false;
|
||||
uint16_t preheat_option = BE16_P(val_ptr);
|
||||
|
@ -1345,7 +1256,6 @@ void DGUSScreenHandlerMKS::FilamentUnLoad(DGUS_VP_Variable &var, void *val_ptr)
|
|||
}
|
||||
|
||||
void DGUSScreenHandler::HandleFilamentLoadUnload(DGUS_VP_Variable &var) {
|
||||
DEBUG_ECHOLNPGM("HandleFilamentLoadUnload");
|
||||
if (filament_data.action <= 0) return;
|
||||
|
||||
// If we close to the target temperature, we can start load or unload the filament
|
||||
|
|
|
@ -247,7 +247,7 @@ constexpr uint16_t VP_BED_STATUS = 0x331C;
|
|||
constexpr uint16_t VP_MOVE_OPTION = 0x3400;
|
||||
|
||||
// Step per mm
|
||||
constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , 2 byte unsigned int , 0~1638.4
|
||||
constexpr uint16_t VP_X_STEP_PER_MM = 0x3600; // at the moment , uint16_t , 0~1638.4
|
||||
//constexpr uint16_t VP_X2_STEP_PER_MM = 0x3602;
|
||||
constexpr uint16_t VP_Y_STEP_PER_MM = 0x3604;
|
||||
//constexpr uint16_t VP_Y2_STEP_PER_MM = 0x3606;
|
||||
|
@ -261,7 +261,7 @@ constexpr uint16_t VP_E0_STEP_PER_MM = 0x3610;
|
|||
//constexpr uint16_t VP_E5_STEP_PER_MM = 0x361A;
|
||||
|
||||
// PIDs
|
||||
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , 2 byte unsigned int , 0~1638.4
|
||||
constexpr uint16_t VP_E0_PID_P = 0x3700; // at the moment , uint16_t , 0~1638.4
|
||||
constexpr uint16_t VP_E0_PID_I = 0x3702;
|
||||
constexpr uint16_t VP_E0_PID_D = 0x3704;
|
||||
constexpr uint16_t VP_BED_PID_P = 0x3710;
|
||||
|
|
|
@ -134,8 +134,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
// meaning "return to previous screen"
|
||||
DGUSLCD_Screens target = (DGUSLCD_Screens)tmp[1];
|
||||
|
||||
DEBUG_ECHOLNPGM("\n DEBUG target", target);
|
||||
|
||||
if (target == DGUSLCD_SCREEN_POPUP) {
|
||||
// Special handling for popup is to return to previous menu
|
||||
if (current_screen == DGUSLCD_SCREEN_POPUP && confirm_action_cb) confirm_action_cb();
|
||||
|
@ -151,8 +149,6 @@ void DGUSScreenHandler::ScreenChangeHook(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
}
|
||||
|
||||
void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleManualMove");
|
||||
|
||||
int16_t movevalue = swap16(*(uint16_t*)val_ptr);
|
||||
#if ENABLED(DGUS_UI_MOVE_DIS_OPTION)
|
||||
if (movevalue) {
|
||||
|
@ -161,7 +157,7 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
}
|
||||
#endif
|
||||
char axiscode;
|
||||
unsigned int speed = 1500; // FIXME: get default feedrate for manual moves, don't hardcode.
|
||||
uint16_t speed = _mf[X_AXIS]; // Default feedrate for manual moves
|
||||
|
||||
switch (var.VP) {
|
||||
default: return;
|
||||
|
@ -171,16 +167,21 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
if (!ExtUI::canMove(ExtUI::axis_t::X)) goto cannotmove;
|
||||
break;
|
||||
|
||||
case VP_MOVE_Y:
|
||||
axiscode = 'Y';
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
|
||||
break;
|
||||
#if HAS_Y_AXIS
|
||||
case VP_MOVE_Y:
|
||||
axiscode = 'Y';
|
||||
speed = _mf[Y_AXIS];
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Y)) goto cannotmove;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case VP_MOVE_Z:
|
||||
axiscode = 'Z';
|
||||
speed = 300; // default to 5mm/s
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
|
||||
break;
|
||||
#if HAS_Z_AXIS
|
||||
case VP_MOVE_Z:
|
||||
axiscode = 'Z';
|
||||
speed = _mf[Z_AXIS];
|
||||
if (!ExtUI::canMove(ExtUI::axis_t::Z)) goto cannotmove;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case VP_HOME_ALL: // only used for homing
|
||||
axiscode = '\0';
|
||||
|
@ -190,63 +191,42 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
|
||||
if (!movevalue) {
|
||||
// homing
|
||||
DEBUG_ECHOPGM(" homing ", AS_CHAR(axiscode));
|
||||
char buf[6] = "G28 X";
|
||||
buf[4] = axiscode;
|
||||
//DEBUG_ECHOPGM(" ", buf);
|
||||
queue.enqueue_one_now(buf);
|
||||
//DEBUG_ECHOLNPGM(" ✓");
|
||||
ForceCompleteUpdate();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// movement
|
||||
DEBUG_ECHOPGM(" move ", AS_CHAR(axiscode));
|
||||
bool old_relative_mode = relative_mode;
|
||||
if (!relative_mode) {
|
||||
//DEBUG_ECHOPGM(" G91");
|
||||
queue.enqueue_now(F("G91"));
|
||||
//DEBUG_ECHOPGM(" ✓ ");
|
||||
}
|
||||
const bool old_relative_mode = relative_mode;
|
||||
if (!relative_mode) queue.enqueue_now(F("G91"));
|
||||
char buf[32]; // G1 X9999.99 F12345
|
||||
unsigned int backup_speed = MMS_TO_MMM(feedrate_mm_s);
|
||||
const uint16_t backup_speed = MMS_TO_MMM(feedrate_mm_s);
|
||||
char sign[] = "\0";
|
||||
int16_t value = movevalue / 100;
|
||||
if (movevalue < 0) { value = -value; sign[0] = '-'; }
|
||||
int16_t fraction = ABS(movevalue) % 100;
|
||||
snprintf_P(buf, 32, PSTR("G0 %c%s%d.%02d F%d"), axiscode, sign, value, fraction, speed);
|
||||
//DEBUG_ECHOPGM(" ", buf);
|
||||
queue.enqueue_one_now(buf);
|
||||
//DEBUG_ECHOLNPGM(" ✓ ");
|
||||
if (backup_speed != speed) {
|
||||
snprintf_P(buf, 32, PSTR("G0 F%d"), backup_speed);
|
||||
queue.enqueue_one_now(buf);
|
||||
//DEBUG_ECHOPGM(" ", buf);
|
||||
}
|
||||
// while (!enqueue_and_echo_command(buf)) idle();
|
||||
//DEBUG_ECHOLNPGM(" ✓ ");
|
||||
if (!old_relative_mode) {
|
||||
//DEBUG_ECHOPGM("G90");
|
||||
queue.enqueue_now(F("G90"));
|
||||
//DEBUG_ECHOPGM(" ✓ ");
|
||||
}
|
||||
//while (!enqueue_and_echo_command(buf)) idle();
|
||||
if (!old_relative_mode) queue.enqueue_now(F("G90"));
|
||||
}
|
||||
|
||||
ForceCompleteUpdate();
|
||||
DEBUG_ECHOLNPGM("manmv done.");
|
||||
return;
|
||||
|
||||
cannotmove:
|
||||
DEBUG_ECHOLNPGM(" cannot move ", AS_CHAR(axiscode));
|
||||
return;
|
||||
}
|
||||
|
||||
#if HAS_PID_HEATING
|
||||
void DGUSScreenHandler::HandleTemperaturePIDChanged(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
uint16_t rawvalue = swap16(*(uint16_t*)val_ptr);
|
||||
DEBUG_ECHOLNPGM("V1:", rawvalue);
|
||||
float value = (float)rawvalue / 10;
|
||||
DEBUG_ECHOLNPGM("V2:", value);
|
||||
float newvalue = 0;
|
||||
|
||||
switch (var.VP) {
|
||||
|
@ -268,7 +248,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
#endif
|
||||
}
|
||||
|
||||
DEBUG_ECHOLNPGM("V3:", newvalue);
|
||||
*(float *)var.memadr = newvalue;
|
||||
|
||||
skipVP = var.VP; // don't overwrite value the next update time as the display might autoincrement in parallel
|
||||
|
@ -277,7 +256,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
|
||||
#if ENABLED(BABYSTEPPING)
|
||||
void DGUSScreenHandler::HandleLiveAdjustZ(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleLiveAdjustZ");
|
||||
int16_t flag = swap16(*(uint16_t*)val_ptr),
|
||||
steps = flag ? -20 : 20;
|
||||
ExtUI::smartAdjustAxis_steps(steps, ExtUI::axis_t::Z, true);
|
||||
|
@ -288,8 +266,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
#if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
|
||||
|
||||
void DGUSScreenHandler::HandleFilamentOption(DGUS_VP_Variable &var, void *val_ptr) {
|
||||
DEBUG_ECHOLNPGM("HandleFilamentOption");
|
||||
|
||||
uint8_t e_temp = 0;
|
||||
filament_data.heated = false;
|
||||
uint16_t preheat_option = swap16(*(uint16_t*)val_ptr);
|
||||
|
@ -360,7 +336,6 @@ void DGUSScreenHandler::HandleManualMove(DGUS_VP_Variable &var, void *val_ptr) {
|
|||
}
|
||||
|
||||
void DGUSScreenHandler::HandleFilamentLoadUnload(DGUS_VP_Variable &var) {
|
||||
DEBUG_ECHOLNPGM("HandleFilamentLoadUnload");
|
||||
if (filament_data.action <= 0) return;
|
||||
|
||||
// If we close to the target temperature, we can start load or unload the filament
|
||||
|
|
|
@ -164,7 +164,6 @@ void DGUSDisplay::ReadVersions() {
|
|||
}
|
||||
|
||||
void DGUSDisplay::SwitchScreen(DGUS_Screen screen) {
|
||||
DEBUG_ECHOLNPGM("SwitchScreen ", (uint8_t)screen);
|
||||
const uint8_t command[] = { 0x5A, 0x01, 0x00, (uint8_t)screen };
|
||||
Write(0x84, command, sizeof(command));
|
||||
}
|
||||
|
@ -172,14 +171,11 @@ void DGUSDisplay::SwitchScreen(DGUS_Screen screen) {
|
|||
void DGUSDisplay::PlaySound(uint8_t start, uint8_t len, uint8_t volume) {
|
||||
if (volume == 0) volume = DGUSDisplay::volume;
|
||||
if (volume == 0) return;
|
||||
DEBUG_ECHOLNPGM("PlaySound ", start, ":", len, "\nVolume ", volume);
|
||||
const uint8_t command[] = { start, len, volume, 0x00 };
|
||||
Write(0xA0, command, sizeof(command));
|
||||
}
|
||||
|
||||
void DGUSDisplay::EnableControl(DGUS_Screen screen, DGUS_ControlType type, DGUS_Control control) {
|
||||
DEBUG_ECHOLNPGM("EnableControl ", (uint8_t)control, "\nScreen ", (uint8_t)screen, "\nType ", (uint8_t)type);
|
||||
|
||||
const uint8_t command[] = { 0x5A, 0xA5, 0x00, (uint8_t)screen, (uint8_t)control, type, 0x00, 0x01 };
|
||||
Write(0xB0, command, sizeof(command));
|
||||
|
||||
|
@ -188,8 +184,6 @@ void DGUSDisplay::EnableControl(DGUS_Screen screen, DGUS_ControlType type, DGUS_
|
|||
}
|
||||
|
||||
void DGUSDisplay::DisableControl(DGUS_Screen screen, DGUS_ControlType type, DGUS_Control control) {
|
||||
DEBUG_ECHOLNPGM("DisableControl ", (uint8_t)control, "\nScreen ", (uint8_t)screen, "\nType ", (uint8_t)type);
|
||||
|
||||
const uint8_t command[] = { 0x5A, 0xA5, 0x00, (uint8_t)screen, (uint8_t)control, type, 0x00, 0x00 };
|
||||
Write(0xB0, command, sizeof(command));
|
||||
|
||||
|
@ -208,14 +202,12 @@ uint8_t DGUSDisplay::GetVolume() {
|
|||
void DGUSDisplay::SetBrightness(uint8_t new_brightness) {
|
||||
brightness = constrain(new_brightness, 0, 100);
|
||||
new_brightness = map_precise(brightness, 0, 100, 5, 100);
|
||||
DEBUG_ECHOLNPGM("SetBrightness ", new_brightness);
|
||||
const uint8_t command[] = { new_brightness, new_brightness };
|
||||
Write(0x82, command, sizeof(command));
|
||||
}
|
||||
|
||||
void DGUSDisplay::SetVolume(uint8_t new_volume) {
|
||||
volume = map_precise(constrain(new_volume, 0, 100), 0, 100, 0, 255);
|
||||
DEBUG_ECHOLNPGM("SetVolume ", volume);
|
||||
const uint8_t command[] = { volume, 0x00 };
|
||||
Write(0xA1, command, sizeof(command));
|
||||
}
|
||||
|
@ -226,7 +218,6 @@ void DGUSDisplay::ProcessRx() {
|
|||
if (!LCD_SERIAL.available() && LCD_SERIAL.buffer_overruns()) {
|
||||
// Overrun, but reset the flag only when the buffer is empty
|
||||
// We want to extract as many as valid datagrams possible...
|
||||
DEBUG_ECHOPGM("OVFL");
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
//LCD_SERIAL.reset_rx_overun();
|
||||
LCD_SERIAL.flush();
|
||||
|
@ -239,20 +230,16 @@ void DGUSDisplay::ProcessRx() {
|
|||
|
||||
case DGUS_IDLE: // Waiting for the first header byte
|
||||
receivedbyte = LCD_SERIAL.read();
|
||||
DEBUG_ECHOPGM("< ", receivedbyte);
|
||||
if (DGUS_HEADER1 == receivedbyte) rx_datagram_state = DGUS_HEADER1_SEEN;
|
||||
break;
|
||||
|
||||
case DGUS_HEADER1_SEEN: // Waiting for the second header byte
|
||||
receivedbyte = LCD_SERIAL.read();
|
||||
DEBUG_ECHOPGM(" ", receivedbyte);
|
||||
rx_datagram_state = (DGUS_HEADER2 == receivedbyte) ? DGUS_HEADER2_SEEN : DGUS_IDLE;
|
||||
break;
|
||||
|
||||
case DGUS_HEADER2_SEEN: // Waiting for the length byte
|
||||
rx_datagram_len = LCD_SERIAL.read();
|
||||
DEBUG_ECHOPGM(" (", rx_datagram_len, ") ");
|
||||
|
||||
// Telegram min len is 3 (command and one word of payload)
|
||||
rx_datagram_state = WITHIN(rx_datagram_len, 3, DGUS_RX_BUFFER_SIZE) ? DGUS_WAIT_TELEGRAM : DGUS_IDLE;
|
||||
break;
|
||||
|
@ -262,22 +249,16 @@ void DGUSDisplay::ProcessRx() {
|
|||
|
||||
initialized = true; // We've talked to it, so we defined it as initialized.
|
||||
uint8_t command = LCD_SERIAL.read();
|
||||
|
||||
DEBUG_ECHOPGM("# ", command);
|
||||
|
||||
uint8_t readlen = rx_datagram_len - 1; // command is part of len.
|
||||
unsigned char tmp[rx_datagram_len - 1];
|
||||
unsigned char *ptmp = tmp;
|
||||
|
||||
while (readlen--) {
|
||||
receivedbyte = LCD_SERIAL.read();
|
||||
DEBUG_ECHOPGM(" ", receivedbyte);
|
||||
*ptmp++ = receivedbyte;
|
||||
}
|
||||
DEBUG_ECHOPGM(" # ");
|
||||
// mostly we'll get this: 5A A5 03 82 4F 4B -- ACK on 0x82, so discard it.
|
||||
if (command == DGUS_WRITEVAR && 'O' == tmp[0] && 'K' == tmp[1]) {
|
||||
DEBUG_ECHOLNPGM(">");
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
break;
|
||||
}
|
||||
|
@ -292,10 +273,7 @@ void DGUSDisplay::ProcessRx() {
|
|||
if (command == DGUS_READVAR) {
|
||||
const uint16_t addr = tmp[0] << 8 | tmp[1];
|
||||
const uint8_t dlen = tmp[2] << 1; // Convert to Bytes. (Display works with words)
|
||||
DEBUG_ECHOPGM("addr=", addr, " dlen=", dlen, "> ");
|
||||
|
||||
if (addr == DGUS_VERSION && dlen == 2) {
|
||||
DEBUG_ECHOLNPGM("VERSIONS");
|
||||
gui_version = tmp[3];
|
||||
os_version = tmp[4];
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
|
@ -304,13 +282,11 @@ void DGUSDisplay::ProcessRx() {
|
|||
|
||||
DGUS_VP vp;
|
||||
if (!DGUS_PopulateVP((DGUS_Addr)addr, &vp)) {
|
||||
DEBUG_ECHOLNPGM("VP not found");
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!vp.rx_handler) {
|
||||
DEBUG_ECHOLNPGM("VP found, no handler.");
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
break;
|
||||
}
|
||||
|
@ -346,7 +322,6 @@ void DGUSDisplay::ProcessRx() {
|
|||
}
|
||||
|
||||
if (dlen != vp.size) {
|
||||
DEBUG_ECHOLNPGM("VP found, size mismatch.");
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
break;
|
||||
}
|
||||
|
@ -358,7 +333,6 @@ void DGUSDisplay::ProcessRx() {
|
|||
break;
|
||||
}
|
||||
|
||||
DEBUG_ECHOLNPGM(">");
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
break;
|
||||
}
|
||||
|
@ -402,7 +376,6 @@ bool DGUS_PopulateVP(const DGUS_Addr addr, DGUS_VP * const buffer) {
|
|||
return true;
|
||||
}
|
||||
} while (++ret);
|
||||
DEBUG_ECHOLNPGM("VP not found: ", (uint16_t)addr);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -473,19 +473,14 @@ void DGUSScreenHandler::MoveToScreen(DGUS_Screen screen, bool abort_wait) {
|
|||
|
||||
if (!CallScreenSetup(screen)) return;
|
||||
|
||||
if (!SendScreenVPData(screen, true)) {
|
||||
DEBUG_ECHOLNPGM("SendScreenVPData failed");
|
||||
return;
|
||||
}
|
||||
if (!SendScreenVPData(screen, true)) return;
|
||||
|
||||
current_screen = screen;
|
||||
dgus_display.SwitchScreen(current_screen);
|
||||
}
|
||||
|
||||
bool DGUSScreenHandler::SendScreenVPData(DGUS_Screen screen, bool complete_update) {
|
||||
if (complete_update) {
|
||||
full_update = false;
|
||||
}
|
||||
if (complete_update) full_update = false;
|
||||
|
||||
const DGUS_Addr *list = FindScreenAddrList(screen);
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#endif
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
void DGUSTxHandler::SetFileControlState(int file, bool state) {
|
||||
void DGUSTxHandler::SetFileControlState(int16_t file, bool state) {
|
||||
DGUS_Control control;
|
||||
|
||||
switch (file) {
|
||||
|
@ -75,17 +75,17 @@
|
|||
// Batch send
|
||||
uint16_t data[DGUS_FILE_COUNT];
|
||||
|
||||
for (int i = 0; i < DGUS_FILE_COUNT; i++) {
|
||||
for (int16_t i = 0; i < DGUS_FILE_COUNT; i++) {
|
||||
if (!dgus_screen_handler.filelist.seek(dgus_screen_handler.filelist_offset + i)) {
|
||||
data[i] = Swap16((uint16_t)DGUS_Data::SDType::NONE);
|
||||
data[i] = Swap16(DGUS_Data::SDType::NONE);
|
||||
|
||||
SetFileControlState(i, false);
|
||||
continue;
|
||||
}
|
||||
|
||||
data[i] = dgus_screen_handler.filelist.isDir() ?
|
||||
Swap16((uint16_t)DGUS_Data::SDType::DIRECTORY)
|
||||
: Swap16((uint16_t)DGUS_Data::SDType::FILE);
|
||||
Swap16(DGUS_Data::SDType::DIRECTORY)
|
||||
: Swap16(DGUS_Data::SDType::FILE);
|
||||
|
||||
SetFileControlState(i, true);
|
||||
}
|
||||
|
@ -287,7 +287,7 @@ void DGUSTxHandler::TempMax(DGUS_VP &vp) {
|
|||
|
||||
void DGUSTxHandler::StepperStatus(DGUS_VP &vp) {
|
||||
const bool motor_on = stepper.axis_enabled.bits & (_BV(NUM_AXES) - 1);
|
||||
dgus_display.Write((uint16_t)vp.addr, Swap16(uint16_t(motor_on ? DGUS_Data::Status::ENABLED : DGUS_Data::Status::DISABLED)));
|
||||
dgus_display.Write((uint16_t)vp.addr, Swap16(motor_on ? DGUS_Data::Status::ENABLED : DGUS_Data::Status::DISABLED));
|
||||
}
|
||||
|
||||
void DGUSTxHandler::StepIcons(DGUS_VP &vp) {
|
||||
|
@ -340,7 +340,7 @@ void DGUSTxHandler::ABLGrid(DGUS_VP &vp) {
|
|||
xy_uint8_t point;
|
||||
int16_t fixed;
|
||||
|
||||
for (int i = 0; i < DGUS_LEVEL_GRID_SIZE; i++) {
|
||||
for (int16_t i = 0; i < DGUS_LEVEL_GRID_SIZE; i++) {
|
||||
point.x = i % (GRID_MAX_POINTS_X);
|
||||
point.y = i / (GRID_MAX_POINTS_X);
|
||||
fixed = dgus_display.ToFixedPoint<float, int16_t, 3>(ExtUI::getMeshPoint(point));
|
||||
|
@ -385,13 +385,13 @@ void DGUSTxHandler::BLTouch(DGUS_VP &vp) {
|
|||
DGUSDisplay::RETURN_KEY_CODE,
|
||||
DGUS_Control::EXTRA2);
|
||||
|
||||
dgus_display.Write((uint16_t)vp.addr, Swap16((uint16_t)DGUS_Data::Status::ENABLED));
|
||||
dgus_display.Write((uint16_t)vp.addr, Swap16(DGUS_Data::Status::ENABLED));
|
||||
#else
|
||||
dgus_display.DisableControl(DGUS_Screen::SETTINGS_MENU2,
|
||||
DGUSDisplay::RETURN_KEY_CODE,
|
||||
DGUS_Control::EXTRA2);
|
||||
|
||||
dgus_display.Write((uint16_t)vp.addr, Swap16((uint16_t)DGUS_Data::Status::DISABLED));
|
||||
dgus_display.Write((uint16_t)vp.addr, Swap16(DGUS_Data::Status::DISABLED));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
#include "DGUSDisplay.h"
|
||||
#include "definition/DGUS_VP.h"
|
||||
|
||||
#define Swap16(val) ((uint16_t)(((uint16_t)(val) >> 8) | ((uint16_t)(val) << 8)))
|
||||
#define Swap16(val) (uint16_t((uint16_t(val) >> 8) | (uint16_t(val) << 8)))
|
||||
|
||||
namespace DGUSTxHandler {
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
void SetFileControlState(int, bool);
|
||||
void SetFileControlState(int16_t, bool);
|
||||
void FileType(DGUS_VP &);
|
||||
void FileName(DGUS_VP &);
|
||||
void ScrollIcons(DGUS_VP &);
|
||||
|
@ -85,18 +85,18 @@ namespace DGUSTxHandler {
|
|||
switch (vp.size) {
|
||||
default: return;
|
||||
case 1: {
|
||||
const uint8_t data = (uint8_t)(*(T*)vp.extra);
|
||||
dgus_display.Write((uint16_t)vp.addr, data);
|
||||
const uint8_t data = uint8_t(*(T*)vp.extra);
|
||||
dgus_display.Write(uint16_t(vp.addr), data);
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
const uint16_t data = (uint16_t)(*(T*)vp.extra);
|
||||
dgus_display.Write((uint16_t)vp.addr, Swap16(data));
|
||||
const uint16_t data = uint16_t(*(T*)vp.extra);
|
||||
dgus_display.Write(uint16_t(vp.addr), Swap16(data));
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
const uint32_t data = (uint32_t)(*(T*)vp.extra);
|
||||
dgus_display.Write((uint16_t)vp.addr, dgus_display.SwapBytes(data));
|
||||
const uint32_t data = uint32_t(*(T*)vp.extra);
|
||||
dgus_display.Write(uint16_t(vp.addr), dgus_display.SwapBytes(data));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -109,17 +109,17 @@ namespace DGUSTxHandler {
|
|||
default: return;
|
||||
case 1: {
|
||||
const uint8_t data = dgus_display.ToFixedPoint<T, uint8_t, decimals>(*(T*)vp.extra);
|
||||
dgus_display.Write((uint16_t)vp.addr, data);
|
||||
dgus_display.Write(uint16_t(vp.addr), data);
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
const uint16_t data = dgus_display.ToFixedPoint<T, uint16_t, decimals>(*(T*)vp.extra);
|
||||
dgus_display.Write((uint16_t)vp.addr, Swap16(data));
|
||||
dgus_display.Write(uint16_t(vp.addr), Swap16(data));
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
const uint32_t data = dgus_display.ToFixedPoint<T, uint32_t, decimals>(*(T*)vp.extra);
|
||||
dgus_display.Write((uint16_t)vp.addr, dgus_display.SwapBytes(data));
|
||||
dgus_display.Write(uint16_t(vp.addr), dgus_display.SwapBytes(data));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,153 +21,153 @@
|
|||
*/
|
||||
#pragma once
|
||||
|
||||
constexpr uint8_t DGUS_LINE_LEN = 32;
|
||||
constexpr uint8_t DGUS_STATUS_LEN = 32;
|
||||
constexpr uint8_t DGUS_FILE_COUNT = 5;
|
||||
constexpr uint8_t DGUS_FILENAME_LEN = 32;
|
||||
constexpr uint8_t DGUS_ELLAPSED_LEN = 15;
|
||||
constexpr uint8_t DGUS_LEVEL_GRID_SIZE = 25;
|
||||
constexpr uint8_t DGUS_MACHINE_LEN = 24;
|
||||
constexpr uint8_t DGUS_BUILDVOLUME_LEN = 24;
|
||||
constexpr uint8_t DGUS_VERSION_LEN = 16;
|
||||
constexpr uint8_t DGUS_PRINTTIME_LEN = 24;
|
||||
constexpr uint8_t DGUS_LONGESTPRINT_LEN = 24;
|
||||
constexpr uint8_t DGUS_FILAMENTUSED_LEN = 24;
|
||||
constexpr uint8_t DGUS_GCODE_LEN = 32;
|
||||
#define DGUS_LINE_LEN 32
|
||||
#define DGUS_STATUS_LEN 32
|
||||
#define DGUS_FILE_COUNT 5
|
||||
#define DGUS_FILENAME_LEN 32
|
||||
#define DGUS_ELAPSED_LEN 15
|
||||
#define DGUS_LEVEL_GRID_SIZE 25
|
||||
#define DGUS_MACHINE_LEN 24
|
||||
#define DGUS_BUILDVOLUME_LEN 24
|
||||
#define DGUS_VERSION_LEN 16
|
||||
#define DGUS_PRINTTIME_LEN 24
|
||||
#define DGUS_LONGESTPRINT_LEN 24
|
||||
#define DGUS_FILAMENTUSED_LEN 24
|
||||
#define DGUS_GCODE_LEN 32
|
||||
|
||||
enum class DGUS_Addr : uint16_t {
|
||||
MESSAGE_Line1 = 0x1100, // 0x1100 - 0x111F
|
||||
MESSAGE_Line2 = 0x1120, // 0x1120 - 0x113F
|
||||
MESSAGE_Line3 = 0x1140, // 0x1140 - 0x115F
|
||||
MESSAGE_Line4 = 0x1160, // 0x1160 - 0x117F
|
||||
MESSAGE_Line1 = 0x1100, // 0x1100 - 0x111F
|
||||
MESSAGE_Line2 = 0x1120, // 0x1120 - 0x113F
|
||||
MESSAGE_Line3 = 0x1140, // 0x1140 - 0x115F
|
||||
MESSAGE_Line4 = 0x1160, // 0x1160 - 0x117F
|
||||
|
||||
// READ-ONLY VARIABLES
|
||||
|
||||
SCREENCHANGE = 0x2000, // Screen change request. Data contains target screen in low byte.
|
||||
SCREENCHANGE_SD = 0x2001, // Only change if SD card present.
|
||||
SCREENCHANGE_Idle = 0x2002, // Only change if not printing.
|
||||
SCREENCHANGE_Printing = 0x2003, // Only change if printing.
|
||||
SD_SelectFile = 0x2004, // Data: file index (0-4)
|
||||
SD_Scroll = 0x2005, // Data: DGUS_Data::Scroll
|
||||
SD_Print = 0x2006,
|
||||
STATUS_Abort = 0x2007, // Popup / Data: DGUS_Data::Popup
|
||||
STATUS_Pause = 0x2008, // Popup / Data: DGUS_Data::Popup
|
||||
STATUS_Resume = 0x2009, // Popup / Data: DGUS_Data::Popup
|
||||
ADJUST_SetFeedrate = 0x200A, // Type: Integer (16 bits signed)
|
||||
ADJUST_SetFlowrate_CUR = 0x200B, // Type: Integer (16 bits signed)
|
||||
SCREENCHANGE = 0x2000, // Screen change request. Data contains target screen in low byte.
|
||||
SCREENCHANGE_SD = 0x2001, // Only change if SD card present.
|
||||
SCREENCHANGE_Idle = 0x2002, // Only change if not printing.
|
||||
SCREENCHANGE_Printing = 0x2003, // Only change if printing.
|
||||
SD_SelectFile = 0x2004, // Data: file index (0-4)
|
||||
SD_Scroll = 0x2005, // Data: DGUS_Data::Scroll
|
||||
SD_Print = 0x2006,
|
||||
STATUS_Abort = 0x2007, // Popup / Data: DGUS_Data::Popup
|
||||
STATUS_Pause = 0x2008, // Popup / Data: DGUS_Data::Popup
|
||||
STATUS_Resume = 0x2009, // Popup / Data: DGUS_Data::Popup
|
||||
ADJUST_SetFeedrate = 0x200A, // Type: Integer (16 bits signed)
|
||||
ADJUST_SetFlowrate_CUR = 0x200B, // Type: Integer (16 bits signed)
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
ADJUST_SetFlowrate_E0 = 0x200C, // Type: Integer (16 bits signed)
|
||||
ADJUST_SetFlowrate_E1 = 0x200D, // Type: Integer (16 bits signed)
|
||||
ADJUST_SetFlowrate_E0 = 0x200C, // Type: Integer (16 bits signed)
|
||||
ADJUST_SetFlowrate_E1 = 0x200D, // Type: Integer (16 bits signed)
|
||||
#endif
|
||||
ADJUST_SetBabystep = 0x200E, // Type: Fixed point, 2 decimals (16 bits signed)
|
||||
ADJUST_Babystep = 0x200F, // Data: DGUS_Data::Adjust
|
||||
TEMP_Preset = 0x2010, // Popup / Data: DGUS_Data::TempPreset
|
||||
TEMP_SetTarget_Bed = 0x2011, // Type: Integer (16 bits signed)
|
||||
TEMP_SetTarget_H0 = 0x2012, // Type: Integer (16 bits signed)
|
||||
ADJUST_SetBabystep = 0x200E, // Type: Fixed point, 2 decimals (16 bits signed)
|
||||
ADJUST_Babystep = 0x200F, // Data: DGUS_Data::Adjust
|
||||
TEMP_Preset = 0x2010, // Popup / Data: DGUS_Data::TempPreset
|
||||
TEMP_SetTarget_Bed = 0x2011, // Type: Integer (16 bits signed)
|
||||
TEMP_SetTarget_H0 = 0x2012, // Type: Integer (16 bits signed)
|
||||
#if HAS_MULTI_HOTEND
|
||||
TEMP_SetTarget_H1 = 0x2013, // Type: Integer (16 bits signed)
|
||||
TEMP_SetTarget_H1 = 0x2013, // Type: Integer (16 bits signed)
|
||||
#endif
|
||||
TEMP_Cool = 0x2014, // Data: DGUS_Data::Heater
|
||||
STEPPER_Control = 0x2015, // Popup / Data: DGUS_Data::Control
|
||||
LEVEL_OFFSET_Set = 0x2016, // Type: Fixed point, 2 decimals (16 bits signed)
|
||||
LEVEL_OFFSET_Step = 0x2017, // Data: DGUS_Data::Adjust
|
||||
LEVEL_OFFSET_SetStep = 0x2018, // Data: DGUS_Data::StepSize
|
||||
LEVEL_MANUAL_Point = 0x2019, // Data: point index (1-5)
|
||||
LEVEL_AUTO_Probe = 0x201A,
|
||||
LEVEL_AUTO_Disable = 0x201B,
|
||||
FILAMENT_Select = 0x201C, // Data: DGUS_Data::Extruder
|
||||
FILAMENT_SetLength = 0x201D, // Type: Integer (16 bits unsigned)
|
||||
FILAMENT_Move = 0x201E, // Data: DGUS_Data::FilamentMove
|
||||
MOVE_Home = 0x201F, // Data: DGUS_Data::Axis
|
||||
MOVE_SetX = 0x2020, // Type: Fixed point, 1 decimal (16 bits signed)
|
||||
MOVE_SetY = 0x2021, // Type: Fixed point, 1 decimal (16 bits signed)
|
||||
MOVE_SetZ = 0x2022, // Type: Fixed point, 1 decimal (16 bits signed)
|
||||
MOVE_Step = 0x2023, // Data: DGUS_Data::MoveDirection
|
||||
MOVE_SetStep = 0x2024, // Data: DGUS_Data::StepSize
|
||||
GCODE_Clear = 0x2025,
|
||||
GCODE_Execute = 0x2026,
|
||||
EEPROM_Reset = 0x2027, // Popup / Data: DGUS_Data::Popup
|
||||
SETTINGS2_Extra = 0x2028, // Data: DGUS_Data::Extra
|
||||
PID_Select = 0x2029, // Data: DGUS_Data::Heater
|
||||
PID_SetTemp = 0x202A, // Type: Integer (16 bits unsigned)
|
||||
PID_Run = 0x202B,
|
||||
POWERLOSS_Abort = 0x202C, // Popup / Data: DGUS_Data::Popup
|
||||
POWERLOSS_Resume = 0x202D, // Popup / Data: DGUS_Data::Popup
|
||||
WAIT_Abort = 0x202E, // Popup / Data: DGUS_Data::Popup
|
||||
WAIT_Continue = 0x202F,
|
||||
TEMP_Cool = 0x2014, // Data: DGUS_Data::Heater
|
||||
STEPPER_Control = 0x2015, // Popup / Data: DGUS_Data::Control
|
||||
LEVEL_OFFSET_Set = 0x2016, // Type: Fixed point, 2 decimals (16 bits signed)
|
||||
LEVEL_OFFSET_Step = 0x2017, // Data: DGUS_Data::Adjust
|
||||
LEVEL_OFFSET_SetStep = 0x2018, // Data: DGUS_Data::StepSize
|
||||
LEVEL_MANUAL_Point = 0x2019, // Data: point index (1-5)
|
||||
LEVEL_AUTO_Probe = 0x201A,
|
||||
LEVEL_AUTO_Disable = 0x201B,
|
||||
FILAMENT_Select = 0x201C, // Data: DGUS_Data::Extruder
|
||||
FILAMENT_SetLength = 0x201D, // Type: Integer (16 bits unsigned)
|
||||
FILAMENT_Move = 0x201E, // Data: DGUS_Data::FilamentMove
|
||||
MOVE_Home = 0x201F, // Data: DGUS_Data::Axis
|
||||
MOVE_SetX = 0x2020, // Type: Fixed point, 1 decimal (16 bits signed)
|
||||
MOVE_SetY = 0x2021, // Type: Fixed point, 1 decimal (16 bits signed)
|
||||
MOVE_SetZ = 0x2022, // Type: Fixed point, 1 decimal (16 bits signed)
|
||||
MOVE_Step = 0x2023, // Data: DGUS_Data::MoveDirection
|
||||
MOVE_SetStep = 0x2024, // Data: DGUS_Data::StepSize
|
||||
GCODE_Clear = 0x2025,
|
||||
GCODE_Execute = 0x2026,
|
||||
EEPROM_Reset = 0x2027, // Popup / Data: DGUS_Data::Popup
|
||||
SETTINGS2_Extra = 0x2028, // Data: DGUS_Data::Extra
|
||||
PID_Select = 0x2029, // Data: DGUS_Data::Heater
|
||||
PID_SetTemp = 0x202A, // Type: Integer (16 bits unsigned)
|
||||
PID_Run = 0x202B,
|
||||
POWERLOSS_Abort = 0x202C, // Popup / Data: DGUS_Data::Popup
|
||||
POWERLOSS_Resume = 0x202D, // Popup / Data: DGUS_Data::Popup
|
||||
WAIT_Abort = 0x202E, // Popup / Data: DGUS_Data::Popup
|
||||
WAIT_Continue = 0x202F,
|
||||
|
||||
// WRITE-ONLY VARIABLES
|
||||
|
||||
MESSAGE_Status = 0x3000, // 0x3000 - 0x301F
|
||||
SD_Type = 0x3020, // 0x3020 - 0x3024 / Data: DGUS_Data::SDType
|
||||
SD_FileName0 = 0x3025, // 0x3025 - 0x3044
|
||||
SD_FileName1 = 0x3045, // 0x3045 - 0x3064
|
||||
SD_FileName2 = 0x3065, // 0x3065 - 0x3084
|
||||
SD_FileName3 = 0x3085, // 0x3085 - 0x30A4
|
||||
SD_FileName4 = 0x30A5, // 0x30A5 - 0x30C4
|
||||
SD_ScrollIcons = 0x30C5, // Bits: DGUS_Data::ScrollIcon
|
||||
SD_SelectedFileName = 0x30C6, // 0x30C6 - 0x30E5
|
||||
STATUS_PositionZ = 0x30E6, // Type: Fixed point, 1 decimal (16 bits signed)
|
||||
STATUS_Ellapsed = 0x30E7, // 0x30E7 - 0x30F5
|
||||
STATUS_Percent = 0x30F6, // Type: Integer (16 bits unsigned)
|
||||
STATUS_Icons = 0x30F7, // Bits: DGUS_Data::StatusIcon
|
||||
ADJUST_Feedrate = 0x30F8, // Type: Integer (16 bits signed)
|
||||
ADJUST_Flowrate_CUR = 0x30F9, // Type: Integer (16 bits signed)
|
||||
MESSAGE_Status = 0x3000, // 0x3000 - 0x301F
|
||||
SD_Type = 0x3020, // 0x3020 - 0x3024 / Data: DGUS_Data::SDType
|
||||
SD_FileName0 = 0x3025, // 0x3025 - 0x3044
|
||||
SD_FileName1 = 0x3045, // 0x3045 - 0x3064
|
||||
SD_FileName2 = 0x3065, // 0x3065 - 0x3084
|
||||
SD_FileName3 = 0x3085, // 0x3085 - 0x30A4
|
||||
SD_FileName4 = 0x30A5, // 0x30A5 - 0x30C4
|
||||
SD_ScrollIcons = 0x30C5, // Bits: DGUS_Data::ScrollIcon
|
||||
SD_SelectedFileName = 0x30C6, // 0x30C6 - 0x30E5
|
||||
STATUS_PositionZ = 0x30E6, // Type: Fixed point, 1 decimal (16 bits signed)
|
||||
STATUS_Ellapsed = 0x30E7, // 0x30E7 - 0x30F5
|
||||
STATUS_Percent = 0x30F6, // Type: Integer (16 bits unsigned)
|
||||
STATUS_Icons = 0x30F7, // Bits: DGUS_Data::StatusIcon
|
||||
ADJUST_Feedrate = 0x30F8, // Type: Integer (16 bits signed)
|
||||
ADJUST_Flowrate_CUR = 0x30F9, // Type: Integer (16 bits signed)
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
ADJUST_Flowrate_E0 = 0x30FA, // Type: Integer (16 bits signed)
|
||||
ADJUST_Flowrate_E1 = 0x30FB, // Type: Integer (16 bits signed)
|
||||
ADJUST_Flowrate_E0 = 0x30FA, // Type: Integer (16 bits signed)
|
||||
ADJUST_Flowrate_E1 = 0x30FB, // Type: Integer (16 bits signed)
|
||||
#endif
|
||||
TEMP_Current_Bed = 0x30FC, // Type: Integer (16 bits signed)
|
||||
TEMP_Target_Bed = 0x30FD, // Type: Integer (16 bits signed)
|
||||
TEMP_Max_Bed = 0x30FE, // Type: Integer (16 bits unsigned)
|
||||
TEMP_Current_H0 = 0x30FF, // Type: Integer (16 bits signed)
|
||||
TEMP_Target_H0 = 0x3100, // Type: Integer (16 bits signed)
|
||||
TEMP_Max_H0 = 0x3101, // Type: Integer (16 bits unsigned)
|
||||
TEMP_Current_Bed = 0x30FC, // Type: Integer (16 bits signed)
|
||||
TEMP_Target_Bed = 0x30FD, // Type: Integer (16 bits signed)
|
||||
TEMP_Max_Bed = 0x30FE, // Type: Integer (16 bits unsigned)
|
||||
TEMP_Current_H0 = 0x30FF, // Type: Integer (16 bits signed)
|
||||
TEMP_Target_H0 = 0x3100, // Type: Integer (16 bits signed)
|
||||
TEMP_Max_H0 = 0x3101, // Type: Integer (16 bits unsigned)
|
||||
#if HAS_MULTI_HOTEND
|
||||
TEMP_Current_H1 = 0x3102, // Type: Integer (16 bits signed)
|
||||
TEMP_Target_H1 = 0x3103, // Type: Integer (16 bits signed)
|
||||
TEMP_Max_H1 = 0x3104, // Type: Integer (16 bits unsigned)
|
||||
TEMP_Current_H1 = 0x3102, // Type: Integer (16 bits signed)
|
||||
TEMP_Target_H1 = 0x3103, // Type: Integer (16 bits signed)
|
||||
TEMP_Max_H1 = 0x3104, // Type: Integer (16 bits unsigned)
|
||||
#endif
|
||||
STEPPER_Status = 0x3105, // Data: DGUS_Data::Status
|
||||
LEVEL_OFFSET_Current = 0x3106, // Type: Fixed point, 2 decimals (16 bits signed)
|
||||
LEVEL_OFFSET_StepIcons = 0x3107, // Bits: DGUS_Data::StepIcon
|
||||
LEVEL_AUTO_DisableIcon = 0x3108, // Data: DGUS_Data::Status
|
||||
LEVEL_AUTO_Grid = 0x3109, // 0x3109 - 0x3121 / Type: Fixed point, 3 decimals (16 bits signed)
|
||||
LEVEL_PROBING_Icons1 = 0x3122, // Type: Integer (16 bits unsigned) / Each bit represents a grid point
|
||||
LEVEL_PROBING_Icons2 = 0x3123, // Type: Integer (16 bits unsigned) / Each bit represents a grid point
|
||||
FILAMENT_ExtruderIcons = 0x3124, // Data: DGUS_Data::ExtruderIcon
|
||||
FILAMENT_Length = 0x3125, // Type: Integer (16 bits unsigned)
|
||||
MOVE_CurrentX = 0x3126, // Type: Fixed point, 1 decimal (16 bits signed)
|
||||
MOVE_CurrentY = 0x3127, // Type: Fixed point, 1 decimal (16 bits signed)
|
||||
MOVE_CurrentZ = 0x3128, // Type: Fixed point, 1 decimal (16 bits signed)
|
||||
MOVE_StepIcons = 0x3129, // Bits: DGUS_Data::StepIcon
|
||||
SETTINGS2_BLTouch = 0x312A, // Data: DGUS_Data::Status
|
||||
PID_HeaterIcons = 0x312B, // Data: DGUS_Data::HeaterIcon
|
||||
PID_Temp = 0x312C, // Type: Integer (16 bits unsigned)
|
||||
PID_Kp = 0x312D, // Type: Fixed point, 2 decimals (32 bits signed)
|
||||
PID_Ki = 0x312F, // Type: Fixed point, 2 decimals (32 bits signed)
|
||||
PID_Kd = 0x3131, // Type: Fixed point, 2 decimals (32 bits signed)
|
||||
INFOS_Machine = 0x3133, // 0x3133 - 0x314A
|
||||
INFOS_BuildVolume = 0x314B, // 0x314B - 0x3162
|
||||
INFOS_Version = 0x3163, // 0x3163 - 0x3172
|
||||
INFOS_TotalPrints = 0x3173, // Type: Integer (16 bits unsigned)
|
||||
INFOS_FinishedPrints = 0x3174, // Type: Integer (16 bits unsigned)
|
||||
INFOS_PrintTime = 0x3175, // 0x3175 - 0x318C
|
||||
INFOS_LongestPrint = 0x318D, // 0x318D - 0x31A4
|
||||
INFOS_FilamentUsed = 0x31A5, // 0x31A5 - 0x31BC
|
||||
WAIT_Icons = 0x31BD, // Bits: DGUS_Data::WaitIcon
|
||||
STEPPER_Status = 0x3105, // Data: DGUS_Data::Status
|
||||
LEVEL_OFFSET_Current = 0x3106, // Type: Fixed point, 2 decimals (16 bits signed)
|
||||
LEVEL_OFFSET_StepIcons = 0x3107, // Bits: DGUS_Data::StepIcon
|
||||
LEVEL_AUTO_DisableIcon = 0x3108, // Data: DGUS_Data::Status
|
||||
LEVEL_AUTO_Grid = 0x3109, // 0x3109 - 0x3121 / Type: Fixed point, 3 decimals (16 bits signed)
|
||||
LEVEL_PROBING_Icons1 = 0x3122, // Type: Integer (16 bits unsigned) / Each bit represents a grid point
|
||||
LEVEL_PROBING_Icons2 = 0x3123, // Type: Integer (16 bits unsigned) / Each bit represents a grid point
|
||||
FILAMENT_ExtruderIcons = 0x3124, // Data: DGUS_Data::ExtruderIcon
|
||||
FILAMENT_Length = 0x3125, // Type: Integer (16 bits unsigned)
|
||||
MOVE_CurrentX = 0x3126, // Type: Fixed point, 1 decimal (16 bits signed)
|
||||
MOVE_CurrentY = 0x3127, // Type: Fixed point, 1 decimal (16 bits signed)
|
||||
MOVE_CurrentZ = 0x3128, // Type: Fixed point, 1 decimal (16 bits signed)
|
||||
MOVE_StepIcons = 0x3129, // Bits: DGUS_Data::StepIcon
|
||||
SETTINGS2_BLTouch = 0x312A, // Data: DGUS_Data::Status
|
||||
PID_HeaterIcons = 0x312B, // Data: DGUS_Data::HeaterIcon
|
||||
PID_Temp = 0x312C, // Type: Integer (16 bits unsigned)
|
||||
PID_Kp = 0x312D, // Type: Fixed point, 2 decimals (32 bits signed)
|
||||
PID_Ki = 0x312F, // Type: Fixed point, 2 decimals (32 bits signed)
|
||||
PID_Kd = 0x3131, // Type: Fixed point, 2 decimals (32 bits signed)
|
||||
INFOS_Machine = 0x3133, // 0x3133 - 0x314A
|
||||
INFOS_BuildVolume = 0x314B, // 0x314B - 0x3162
|
||||
INFOS_Version = 0x3163, // 0x3163 - 0x3172
|
||||
INFOS_TotalPrints = 0x3173, // Type: Integer (16 bits unsigned)
|
||||
INFOS_FinishedPrints = 0x3174, // Type: Integer (16 bits unsigned)
|
||||
INFOS_PrintTime = 0x3175, // 0x3175 - 0x318C
|
||||
INFOS_LongestPrint = 0x318D, // 0x318D - 0x31A4
|
||||
INFOS_FilamentUsed = 0x31A5, // 0x31A5 - 0x31BC
|
||||
WAIT_Icons = 0x31BD, // Bits: DGUS_Data::WaitIcon
|
||||
|
||||
// READ-WRITE VARIABLES
|
||||
|
||||
FAN0_Speed = 0x4000, // Type: Integer (16 bits unsigned) / Data: fan speed as percent (0-100)
|
||||
GCODE_Data = 0x4001, // 0x4001 - 0x4020
|
||||
PID_Cycles = 0x4021, // Type: Integer (16 bits unsigned)
|
||||
VOLUME_Level = 0x4022, // Type: Integer (16 bits unsigned) / Data: volume as percent (0-100)
|
||||
BRIGHTNESS_Level = 0x4023, // Type: Integer (16 bits unsigned) / Data: brightness as percent (0-100)
|
||||
FAN0_Speed = 0x4000, // Type: Integer (16 bits unsigned) / Data: fan speed as percent (0-100)
|
||||
GCODE_Data = 0x4001, // 0x4001 - 0x4020
|
||||
PID_Cycles = 0x4021, // Type: Integer (16 bits unsigned)
|
||||
VOLUME_Level = 0x4022, // Type: Integer (16 bits unsigned) / Data: volume as percent (0-100)
|
||||
BRIGHTNESS_Level = 0x4023, // Type: Integer (16 bits unsigned) / Data: brightness as percent (0-100)
|
||||
|
||||
// SPECIAL CASES
|
||||
|
||||
STATUS_Percent_Complete = 0x5000, // Same as STATUS_Percent, but always 100%
|
||||
INFOS_Debug = 0x5001,
|
||||
STATUS_Percent_Complete = 0x5000, // Same as STATUS_Percent, but always 100%
|
||||
INFOS_Debug = 0x5001,
|
||||
|
||||
};
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
|
||||
#include "DGUS_Addr.h"
|
||||
|
||||
static_assert((DGUS_LEVEL_GRID_SIZE == GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y), "DGUS_LEVEL_GRID_SIZE incompatible with current mesh.");
|
||||
#if DGUS_LEVEL_GRID_SIZE != GRID_MAX_POINTS
|
||||
#error "DGUS_LEVEL_GRID_SIZE is incompatible with current mesh."
|
||||
#endif
|
||||
|
||||
#ifndef DGUS_DEFAULT_VOLUME
|
||||
#define DGUS_DEFAULT_VOLUME 50
|
||||
|
|
|
@ -178,7 +178,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
|
|||
nullptr,
|
||||
&DGUSTxHandler::PositionZ),
|
||||
VP_HELPER(DGUS_Addr::STATUS_Ellapsed,
|
||||
DGUS_ELLAPSED_LEN,
|
||||
DGUS_ELAPSED_LEN,
|
||||
VPFLAG_AUTOUPLOAD,
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
|
|
@ -111,8 +111,6 @@ void FileNavigator::getFiles(uint16_t index) {
|
|||
rtscheck.RTS_SndData(10, FilenameIcon1 + j);
|
||||
}
|
||||
|
||||
DEBUG_ECHOLNPGM("index=", index, " currentindex=", currentindex, "folderdepth=", folderdepth);
|
||||
|
||||
if (currentindex == 0 && folderdepth > 0) { // Add a link to go up a folder
|
||||
files--;
|
||||
rtscheck.RTS_SndData("Up Directory", SDFILE_ADDR);
|
||||
|
@ -149,7 +147,6 @@ void FileNavigator::getFiles(uint16_t index) {
|
|||
}
|
||||
|
||||
void FileNavigator::changeDIR(char *folder) {
|
||||
DEBUG_ECHOLNPGM("currentfolder: ", currentfoldername, " New: ", folder);
|
||||
if (folderdepth >= MAX_FOLDER_DEPTH) return; // limit the folder depth
|
||||
strcat(currentfoldername, folder);
|
||||
strcat(currentfoldername, "/");
|
||||
|
@ -175,7 +172,6 @@ void FileNavigator::upDIR() {
|
|||
pos = strchr(currentfoldername, '/');
|
||||
pos[1] = '\0';
|
||||
}
|
||||
DEBUG_ECHOLNPGM("depth: ", folderdepth, " currentfoldername: ", currentfoldername);
|
||||
}
|
||||
|
||||
char* FileNavigator::getCurrentFolderName() { return currentfoldername; }
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -49,19 +49,21 @@
|
|||
|
||||
#define SizeofDatabuf 46
|
||||
|
||||
/*************Register and Variable addr*****************/
|
||||
//#define FONT_EEPROM 90
|
||||
//#define AutoLeve_EEPROM 100
|
||||
//#define FanOn 255
|
||||
#define FanOff 0
|
||||
|
||||
#define ExchangePageBase 0x5A010000UL // the first page ID. other page = first page ID + relevant num;
|
||||
#define StartSoundSet 0x060480A0UL // 06,start-music; 04, 4 musics; 80, the volume value; 04, return value about music number.
|
||||
|
||||
// Register addresses
|
||||
#define RegAddr_W 0x80
|
||||
#define RegAddr_R 0x81
|
||||
#define VarAddr_W 0x82
|
||||
#define VarAddr_R 0x83
|
||||
#define ExchangePageBase (unsigned long)0x5A010000 // the first page ID. other page = first page ID + relevant num;
|
||||
#define StartSoundSet ((unsigned long)0x060480A0) // 06,start-music; 04, 4 musics; 80, the volume value; 04, return value about music number.
|
||||
//#define FONT_EEPROM 90
|
||||
//#define AutoLeve_EEPROM 100
|
||||
//#define FanOn 255
|
||||
#define FanOff 0
|
||||
|
||||
/*variable addr*/
|
||||
// Variable addresses
|
||||
#define ExchangepageAddr 0x0084
|
||||
#define SoundAddr 0x00A0
|
||||
#define StartIcon 0x1000
|
||||
|
@ -142,7 +144,7 @@
|
|||
#define DisplayZaxis 0x104C
|
||||
|
||||
#define FilamentUnit1 0x1054
|
||||
#define Exchfilement 0x1056
|
||||
#define Exchfilament 0x1056
|
||||
#define FilamentUnit2 0x1058
|
||||
|
||||
#define MacVersion 0x1060
|
||||
|
@ -193,13 +195,13 @@ namespace ExtUI {
|
|||
} rx_datagram_state_t;
|
||||
|
||||
typedef struct DataBuf {
|
||||
unsigned char len;
|
||||
unsigned char head[2];
|
||||
unsigned char command;
|
||||
unsigned long addr;
|
||||
unsigned long bytelen;
|
||||
unsigned short data[32];
|
||||
unsigned char reserv[4];
|
||||
uint8_t len;
|
||||
uint8_t head[2];
|
||||
uint8_t command;
|
||||
uint32_t addr;
|
||||
uint32_t bytelen;
|
||||
uint16_t data[32];
|
||||
uint8_t reserv[4];
|
||||
} DB;
|
||||
|
||||
struct creality_dwin_settings_t {
|
||||
|
@ -220,27 +222,27 @@ namespace ExtUI {
|
|||
class RTSSHOW {
|
||||
public:
|
||||
RTSSHOW();
|
||||
int RTS_RecData();
|
||||
int16_t RTS_RecData();
|
||||
void RTS_SDCardInit(void);
|
||||
void RTS_SDCardUpate(bool, bool);
|
||||
int RTS_CheckFilament(int);
|
||||
int16_t RTS_CheckFilament(int16_t);
|
||||
void RTS_SndData(void);
|
||||
void RTS_SndData(const String &, unsigned long, unsigned char = VarAddr_W);
|
||||
void RTS_SndData(const char[], unsigned long, unsigned char = VarAddr_W);
|
||||
void RTS_SndData(char, unsigned long, unsigned char = VarAddr_W);
|
||||
void RTS_SndData(unsigned char*, unsigned long, unsigned char = VarAddr_W);
|
||||
void RTS_SndData(int, unsigned long, unsigned char = VarAddr_W);
|
||||
void RTS_SndData(float, unsigned long, unsigned char = VarAddr_W);
|
||||
void RTS_SndData(unsigned int,unsigned long, unsigned char = VarAddr_W);
|
||||
void RTS_SndData(long,unsigned long, unsigned char = VarAddr_W);
|
||||
void RTS_SndData(unsigned long,unsigned long, unsigned char = VarAddr_W);
|
||||
void RTS_SndData(const String &, uint32_t, uint8_t=VarAddr_W);
|
||||
void RTS_SndData(const char[], uint32_t, uint8_t=VarAddr_W);
|
||||
void RTS_SndData(char, uint32_t, uint8_t=VarAddr_W);
|
||||
void RTS_SndData(uint8_t*, uint32_t, uint8_t=VarAddr_W);
|
||||
void RTS_SndData(int16_t, uint32_t, uint8_t=VarAddr_W);
|
||||
void RTS_SndData(float, uint32_t, uint8_t=VarAddr_W);
|
||||
void RTS_SndData(uint16_t, uint32_t, uint8_t=VarAddr_W);
|
||||
void RTS_SndData(int32_t, uint32_t, uint8_t=VarAddr_W);
|
||||
void RTS_SndData(uint32_t, uint32_t, uint8_t=VarAddr_W);
|
||||
void RTS_SDcard_Stop();
|
||||
void RTS_HandleData();
|
||||
void RTS_Init();
|
||||
|
||||
DB recdat;
|
||||
DB snddat;
|
||||
unsigned char databuf[SizeofDatabuf];
|
||||
uint8_t databuf[SizeofDatabuf];
|
||||
|
||||
static rx_datagram_state_t rx_datagram_state;
|
||||
static uint8_t rx_datagram_len;
|
||||
|
@ -250,13 +252,13 @@ namespace ExtUI {
|
|||
static RTSSHOW rtscheck;
|
||||
|
||||
#define Addvalue 3
|
||||
#define PrintChoice_Value (0+Addvalue)
|
||||
#define Zoffset_Value (3+Addvalue)
|
||||
#define Setting_Value (8+Addvalue)
|
||||
#define XYZEaxis_Value (12+Addvalue)
|
||||
#define Filament_Value (15+Addvalue)
|
||||
#define Language_Value (18+Addvalue)
|
||||
#define Filename_Value (22+Addvalue)
|
||||
#define PrintChoice_Value (0 + Addvalue)
|
||||
#define Zoffset_Value (3 + Addvalue)
|
||||
#define Setting_Value (8 + Addvalue)
|
||||
#define XYZEaxis_Value (12 + Addvalue)
|
||||
#define Filament_Value (15 + Addvalue)
|
||||
#define Language_Value (18 + Addvalue)
|
||||
#define Filename_Value (22 + Addvalue)
|
||||
|
||||
enum PROC_COM {
|
||||
Printfile = 0,
|
||||
|
@ -279,7 +281,7 @@ namespace ExtUI {
|
|||
Filename = Filename_Value
|
||||
};
|
||||
|
||||
const unsigned long Addrbuf[] = {
|
||||
const uint32_t Addrbuf[] = {
|
||||
0x1002, 0x1004, 0x1006, 0x1008, 0x100A, 0x100C, 0x1026, 0x1030, 0x1032, 0x1034, 0x103A,
|
||||
0x103E, 0x1040, 0x1044, 0x1046, 0x1048, 0x104A, 0x104C, 0x1054, 0x1056, 0x1058,
|
||||
0x105C, 0x105E, 0x105F, 0x1088, 0
|
||||
|
|
|
@ -38,7 +38,7 @@ extern TIPS_TYPE wifi_tips_type;
|
|||
|
||||
typedef struct {
|
||||
unsigned char timer;
|
||||
unsigned int timer_count;
|
||||
uint16_t timer_count;
|
||||
} TIPS_DISP;
|
||||
extern TIPS_DISP tips_disp;
|
||||
|
||||
|
|
|
@ -300,7 +300,7 @@ void lv_fill_rect(lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2, lv
|
|||
|
||||
#define TICK_CYCLE 1
|
||||
|
||||
unsigned int getTickDiff(unsigned int curTick, unsigned int lastTick) {
|
||||
uint16_t getTickDiff(uint16_t curTick, uint16_t lastTick) {
|
||||
return TICK_CYCLE * (lastTick <= curTick ? (curTick - lastTick) : (0xFFFFFFFF - lastTick + curTick));
|
||||
}
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@ void WifiSerial::_rx_complete_irq(serial_t *obj) {
|
|||
|
||||
WRITE(WIFI_IO1_PIN, HIGH);
|
||||
|
||||
rx_buffer_index_t i = (unsigned int)(obj->rx_head + 1) % WIFI_RX_BUF_SIZE;
|
||||
rx_buffer_index_t i = uint16_t(obj->rx_head + 1) % WIFI_RX_BUF_SIZE;
|
||||
|
||||
// if we should be storing the received character into the location
|
||||
// just before the tail (meaning that the head would advance to the
|
||||
|
@ -292,7 +292,7 @@ void WifiSerial::begin(unsigned long baud, byte config) {
|
|||
case 0: Error_Handler(); break;
|
||||
}
|
||||
|
||||
uart_init(&_serial, (uint32_t)baud, databits, parity, stopbits);
|
||||
uart_init(&_serial, uint32_t(baud), databits, parity, stopbits);
|
||||
enableHalfDuplexRx();
|
||||
if (baud == WIFI_BAUDRATE)
|
||||
uart_attach_rx_callback(&_serial, _rx_complete_irq);
|
||||
|
@ -311,7 +311,7 @@ void WifiSerial::end() {
|
|||
}
|
||||
|
||||
int WifiSerial::available() {
|
||||
return ((unsigned int)(WIFI_RX_BUF_SIZE + _serial.rx_head - _serial.rx_tail)) % WIFI_RX_BUF_SIZE;
|
||||
return uint16_t(WIFI_RX_BUF_SIZE + _serial.rx_head - _serial.rx_tail) % WIFI_RX_BUF_SIZE;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -59,7 +59,7 @@ extern uint8_t Explore_Disk(char *path, uint8_t recu_level);
|
|||
|
||||
extern uint8_t commands_in_queue;
|
||||
extern uint8_t sel_id;
|
||||
extern unsigned int getTickDiff(unsigned int curTick, unsigned int lastTick);
|
||||
extern uint16_t getTickDiff(uint16_t curTick, uint16_t lastTick);
|
||||
|
||||
volatile SZ_USART_FIFO WifiRxFifo;
|
||||
|
||||
|
|
|
@ -79,9 +79,9 @@ const uint32_t ESP_FLASH_ADDR = 0x40200000; // address of start of Flash
|
|||
|
||||
UPLOAD_STRUCT esp_upload;
|
||||
|
||||
static const unsigned int retriesPerReset = 3;
|
||||
static const uint16_t retriesPerReset = 3;
|
||||
static const uint32_t connectAttemptInterval = 50;
|
||||
static const unsigned int percentToReportIncrement = 5; // how often we report % complete
|
||||
static const uint16_t percentToReportIncrement = 5; // how often we report % complete
|
||||
static const uint32_t defaultTimeout = 500;
|
||||
static const uint32_t eraseTimeout = 15000;
|
||||
static const uint32_t blockWriteTimeout = 200;
|
||||
|
@ -151,7 +151,7 @@ void flushInput() {
|
|||
uint32_t getData(unsigned byteCnt, const uint8_t *buf, int ofst) {
|
||||
uint32_t val = 0;
|
||||
if (buf && byteCnt) {
|
||||
unsigned int shiftCnt = 0;
|
||||
uint16_t shiftCnt = 0;
|
||||
NOMORE(byteCnt, 4U);
|
||||
do {
|
||||
val |= (uint32_t)buf[ofst++] << shiftCnt;
|
||||
|
@ -348,7 +348,7 @@ EspUploadResult readPacket(uint8_t op, uint32_t *valp, size_t *bodyLen, uint32_t
|
|||
// Send a block of data performing SLIP encoding of the content.
|
||||
void _writePacket(const uint8_t *data, size_t len) {
|
||||
unsigned char outBuf[2048] = {0};
|
||||
unsigned int outIndex = 0;
|
||||
uint16_t outIndex = 0;
|
||||
while (len != 0) {
|
||||
if (*data == 0xC0) {
|
||||
outBuf[outIndex++] = 0xDB;
|
||||
|
@ -597,7 +597,7 @@ void upload_spin() {
|
|||
case uploading:
|
||||
// The ESP needs several milliseconds to recover from one packet before it will accept another
|
||||
if (getWifiTickDiff(esp_upload.lastAttemptTime, getWifiTick()) >= 15) {
|
||||
unsigned int percentComplete;
|
||||
uint16_t percentComplete;
|
||||
const uint32_t blkCnt = (esp_upload.fileSize + EspFlashBlockSize - 1) / EspFlashBlockSize;
|
||||
if (esp_upload.uploadBlockNumber < blkCnt) {
|
||||
esp_upload.uploadResult = flashWriteBlock(0, 0);
|
||||
|
|
|
@ -93,7 +93,7 @@ namespace Language_an {
|
|||
LSTR MSG_MOVE_50MM = _UxGT("Mover 50mm");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Mover 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Velocidat");
|
||||
LSTR MSG_BED_Z = _UxGT("Base Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Base Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Boquilla");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Boquilla ~");
|
||||
LSTR MSG_BED = _UxGT("Base");
|
||||
|
|
|
@ -82,7 +82,7 @@ namespace Language_bg {
|
|||
LSTR MSG_MOVE_50MM = _UxGT("Премести с 50mm");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Премести с 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Скорост");
|
||||
LSTR MSG_BED_Z = _UxGT("Bed Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Bed Z");
|
||||
LSTR MSG_NOZZLE = " " LCD_STR_THERMOMETER _UxGT(" Дюза");
|
||||
LSTR MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" Дюза ~");
|
||||
LSTR MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" Легло");
|
||||
|
|
|
@ -93,7 +93,7 @@ namespace Language_ca {
|
|||
LSTR MSG_MOVE_50MM = _UxGT("Mou 50mm");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Mou 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Velocitat");
|
||||
LSTR MSG_BED_Z = _UxGT("Llit Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Llit Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Nozzle");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Nozzle ~");
|
||||
LSTR MSG_BED = _UxGT("Llit");
|
||||
|
|
|
@ -243,7 +243,7 @@ namespace Language_cz {
|
|||
LSTR MSG_MOVE_50MM = _UxGT("Posunout o 50mm");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Posunout o 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Rychlost");
|
||||
LSTR MSG_BED_Z = _UxGT("Výška podl.");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Výška podl.");
|
||||
LSTR MSG_NOZZLE = _UxGT("Tryska");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Tryska ~");
|
||||
LSTR MSG_BED = _UxGT("Podložka");
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace Language_da {
|
|||
LSTR MSG_MOVE_50MM = _UxGT("Flyt 50mm");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Flyt 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Hastighed");
|
||||
LSTR MSG_BED_Z = _UxGT("Plade Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Plade Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Dyse");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Dyse ~");
|
||||
|
||||
|
|
|
@ -308,7 +308,7 @@ namespace Language_de {
|
|||
LSTR MSG_MOVE_01IN = _UxGT("0.100 in");
|
||||
LSTR MSG_MOVE_1IN = _UxGT("1.000 in");
|
||||
LSTR MSG_SPEED = _UxGT("Geschw.");
|
||||
LSTR MSG_BED_Z = _UxGT("Bett Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Bett Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Düse");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Düse ~");
|
||||
LSTR MSG_NOZZLE_PARKED = _UxGT("Düse geparkt");
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace Language_el {
|
|||
LSTR MSG_MOVE_50MM = _UxGT("Μετακίνηση 50 μμ");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Μετακίνηση 100 μμ");
|
||||
LSTR MSG_SPEED = _UxGT("Ταχύτητα");
|
||||
LSTR MSG_BED_Z = _UxGT("Επ. Εκτύπωσης Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Επ. Εκτύπωσης Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Ακροφύσιο");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Ακροφύσιο ~");
|
||||
LSTR MSG_BED = _UxGT("Επ. Εκτύπωσης");
|
||||
|
|
|
@ -91,7 +91,7 @@ namespace Language_el_gr {
|
|||
LSTR MSG_MOVE_50MM = _UxGT("Μετακίνηση 50 μμ");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Μετακίνηση 100 μμ");
|
||||
LSTR MSG_SPEED = _UxGT("Ταχύτητα");
|
||||
LSTR MSG_BED_Z = _UxGT("Κλίνη Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Κλίνη Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Ακροφύσιο");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Ακροφύσιο ~");
|
||||
LSTR MSG_BED = _UxGT("Κλίνη");
|
||||
|
|
|
@ -329,7 +329,7 @@ namespace Language_en {
|
|||
LSTR MSG_MOVE_1IN = _UxGT("Move 1.0in");
|
||||
LSTR MSG_LIVE_MOVE = _UxGT("Live Move");
|
||||
LSTR MSG_SPEED = _UxGT("Speed");
|
||||
LSTR MSG_BED_Z = _UxGT("Bed Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Bed Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Nozzle");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Nozzle ~");
|
||||
LSTR MSG_NOZZLE_PARKED = _UxGT("Nozzle Parked");
|
||||
|
|
|
@ -237,7 +237,7 @@ namespace Language_es {
|
|||
LSTR MSG_MOVE_50MM = _UxGT("Mover 50mm");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Mover 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Velocidad");
|
||||
LSTR MSG_BED_Z = _UxGT("Cama Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Cama Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Boquilla");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Boquilla ~");
|
||||
LSTR MSG_NOZZLE_PARKED = _UxGT("Boquilla Aparcada");
|
||||
|
|
|
@ -146,7 +146,7 @@ namespace Language_eu {
|
|||
LSTR MSG_MOVE_50MM = _UxGT("Mugitu 50mm");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Mugitu 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Abiadura");
|
||||
LSTR MSG_BED_Z = _UxGT("Z Ohea");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Z Ohea");
|
||||
LSTR MSG_NOZZLE = _UxGT("Pita");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Pita ~");
|
||||
LSTR MSG_BED = _UxGT("Ohea");
|
||||
|
|
|
@ -246,7 +246,7 @@ namespace Language_fr {
|
|||
LSTR MSG_MOVE_05IN = _UxGT("Déplacer 0.5\"");
|
||||
LSTR MSG_MOVE_1IN = _UxGT("Déplacer 1\"");
|
||||
LSTR MSG_SPEED = _UxGT("Vitesse");
|
||||
LSTR MSG_BED_Z = _UxGT("Lit Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Lit Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Buse");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Buse ~");
|
||||
LSTR MSG_BED = _UxGT("Lit");
|
||||
|
|
|
@ -234,7 +234,7 @@ namespace Language_gl {
|
|||
LSTR MSG_MOVE_50MM = _UxGT("Mover 50mm");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Mover 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Velocidade");
|
||||
LSTR MSG_BED_Z = _UxGT("Cama Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Cama Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Bico");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Bico ~");
|
||||
LSTR MSG_NOZZLE_PARKED = _UxGT("Bico Estacionado");
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace Language_hr {
|
|||
LSTR MSG_MOVE_50MM = _UxGT("Miči 50mm");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Miči 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Brzina");
|
||||
LSTR MSG_BED_Z = _UxGT("Bed Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Bed Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Dizna");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Dizna ~");
|
||||
LSTR MSG_BED = _UxGT("Bed");
|
||||
|
|
|
@ -272,7 +272,7 @@ namespace Language_hu {
|
|||
LSTR MSG_MOVE_05IN = _UxGT("Mozgás 12.7mm");
|
||||
LSTR MSG_MOVE_1IN = _UxGT("Mozgáá 25.4mm");
|
||||
LSTR MSG_SPEED = _UxGT("Sebesség");
|
||||
LSTR MSG_BED_Z = _UxGT("Z ágy");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Z ágy");
|
||||
LSTR MSG_NOZZLE = _UxGT("Fej");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Fej ~");
|
||||
LSTR MSG_NOZZLE_PARKED = _UxGT("Fej parkolva");
|
||||
|
|
|
@ -326,7 +326,7 @@ namespace Language_it {
|
|||
LSTR MSG_MOVE_1IN = _UxGT("Muovi di 1\"");
|
||||
LSTR MSG_LIVE_MOVE = _UxGT("Modalità Live");
|
||||
LSTR MSG_SPEED = _UxGT("Velocità");
|
||||
LSTR MSG_BED_Z = _UxGT("Piatto Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Piatto Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Ugello");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Ugello ~");
|
||||
LSTR MSG_NOZZLE_PARKED = _UxGT("Ugello parcheggiato");
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace Language_jp_kana {
|
|||
LSTR MSG_MOVE_50MM = _UxGT(" 50mm イドウ"); // "Move 50mm"
|
||||
LSTR MSG_MOVE_100MM = _UxGT(" 100mm イドウ"); // "Move 100mm"
|
||||
LSTR MSG_SPEED = _UxGT("ソクド"); // "Speed"
|
||||
LSTR MSG_BED_Z = _UxGT("Zオフセット"); // "Bed Z"
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Zオフセット"); // "Bed Z"
|
||||
LSTR MSG_NOZZLE = _UxGT("ノズル"); // "Nozzle"
|
||||
LSTR MSG_BED = _UxGT("ベッド"); // "Bed"
|
||||
LSTR MSG_FAN_SPEED = _UxGT("ファンソクド"); // "Fan speed"
|
||||
|
|
|
@ -93,7 +93,7 @@ namespace Language_nl {
|
|||
LSTR MSG_MOVE_10MM = _UxGT("Verplaats 10mm");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Verplaats 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Snelheid");
|
||||
LSTR MSG_BED_Z = _UxGT("Bed Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Bed Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Nozzle");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Nozzle ~");
|
||||
LSTR MSG_BED = _UxGT("Bed");
|
||||
|
|
|
@ -248,7 +248,7 @@ namespace Language_pl {
|
|||
LSTR MSG_MOVE_001IN = _UxGT("Przesuń co 0.01 cala");
|
||||
LSTR MSG_MOVE_01IN = _UxGT("Przesuń co 0.1 cala");
|
||||
LSTR MSG_SPEED = _UxGT("Predkość");
|
||||
LSTR MSG_BED_Z = _UxGT("Stół Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Stół Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Dysza");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Dysza ~");
|
||||
LSTR MSG_NOZZLE_STANDBY = _UxGT("Dysza w oczekiwaniu");
|
||||
|
|
|
@ -87,7 +87,7 @@ namespace Language_pt {
|
|||
LSTR MSG_MOVE_10MM = _UxGT("Mover 10mm");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Mover 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Velocidade");
|
||||
LSTR MSG_BED_Z = _UxGT("Base Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Base Z");
|
||||
LSTR MSG_NOZZLE = " " LCD_STR_THERMOMETER _UxGT(" Bico");
|
||||
LSTR MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" Bico ~");
|
||||
LSTR MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" Base");
|
||||
|
|
|
@ -219,7 +219,7 @@ namespace Language_pt_br {
|
|||
LSTR MSG_MOVE_10MM = _UxGT("Mover 10mm");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Mover 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Velocidade");
|
||||
LSTR MSG_BED_Z = _UxGT("Base Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Base Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Bocal");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Bocal ~");
|
||||
LSTR MSG_BED = _UxGT("Mesa");
|
||||
|
|
|
@ -232,7 +232,7 @@ namespace Language_ro {
|
|||
LSTR MSG_MOVE_10MM = _UxGT("Move 10mm");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Move 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Speed");
|
||||
LSTR MSG_BED_Z = _UxGT("Bed Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Bed Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Nozzle");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Nozzle ~");
|
||||
LSTR MSG_NOZZLE_PARKED = _UxGT("Nozzle Parked");
|
||||
|
|
|
@ -342,7 +342,7 @@ namespace Language_ru {
|
|||
LSTR MSG_MOVE_10MM = _UxGT("Движение 10мм");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Движение 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Скорость");
|
||||
LSTR MSG_BED_Z = _UxGT("Z стола");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Z стола");
|
||||
LSTR MSG_NOZZLE = _UxGT("Сопло, ") LCD_STR_DEGREE _UxGT("C");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Сопло ~");
|
||||
LSTR MSG_NOZZLE_PARKED = _UxGT("Сопло запарковано");
|
||||
|
|
|
@ -327,7 +327,7 @@ namespace Language_sk {
|
|||
LSTR MSG_MOVE_1IN = _UxGT("Posunúť o 1,0in");
|
||||
LSTR MSG_LIVE_MOVE = _UxGT("Živý pohyb");
|
||||
LSTR MSG_SPEED = _UxGT("Rýchlosť");
|
||||
LSTR MSG_BED_Z = _UxGT("Výška podl.");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Výška podl.");
|
||||
LSTR MSG_NOZZLE = _UxGT("Tryska");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Tryska ~");
|
||||
LSTR MSG_NOZZLE_PARKED = _UxGT("Tryska zaparkovaná");
|
||||
|
|
|
@ -262,7 +262,7 @@ namespace Language_sv {
|
|||
LSTR MSG_MOVE_001IN = _UxGT("Flytta 0.01tum");
|
||||
LSTR MSG_MOVE_01IN = _UxGT("Flytta 0.1tum");
|
||||
LSTR MSG_SPEED = _UxGT("Hastighet");
|
||||
LSTR MSG_BED_Z = _UxGT("Bädd Z");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Bädd Z");
|
||||
LSTR MSG_NOZZLE = _UxGT("Munstycke");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Munstycke ~");
|
||||
LSTR MSG_NOZZLE_PARKED = _UxGT("Munstycke Parkerad");
|
||||
|
|
|
@ -235,7 +235,7 @@ namespace Language_tr {
|
|||
LSTR MSG_MOVE_10MM = _UxGT("10mm");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Hız");
|
||||
LSTR MSG_BED_Z = _UxGT("Z Mesafesi");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Z Mesafesi");
|
||||
LSTR MSG_NOZZLE = _UxGT("Nozul");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Nozul ~");
|
||||
LSTR MSG_BED = _UxGT("Tabla");
|
||||
|
|
|
@ -343,7 +343,7 @@ namespace Language_uk {
|
|||
LSTR MSG_MOVE_10MM = _UxGT("Рух 10мм");
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Рух 100mm");
|
||||
LSTR MSG_SPEED = _UxGT("Швидкість");
|
||||
LSTR MSG_BED_Z = _UxGT("Z Столу");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Z Столу");
|
||||
LSTR MSG_NOZZLE = _UxGT("Сопло, ") LCD_STR_DEGREE _UxGT("C");
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Сопло ~");
|
||||
LSTR MSG_NOZZLE_PARKED = _UxGT("Сопло запарковане");
|
||||
|
|
|
@ -207,7 +207,7 @@ namespace Language_vi {
|
|||
LSTR MSG_MOVE_10MM = _UxGT("Di chuyển 10mm"); // Move 10mm
|
||||
LSTR MSG_MOVE_100MM = _UxGT("Di chuyển 100mm"); // Move 100mm
|
||||
LSTR MSG_SPEED = _UxGT("Tốc độ"); // Speed
|
||||
LSTR MSG_BED_Z = _UxGT("Z Bàn");
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("Z Bàn");
|
||||
LSTR MSG_NOZZLE = _UxGT("Đầu phun"); // Nozzle
|
||||
LSTR MSG_NOZZLE_N = _UxGT("Đầu phun ~");
|
||||
LSTR MSG_BED = _UxGT("Bàn"); // bed
|
||||
|
|
|
@ -232,7 +232,7 @@ namespace Language_zh_CN {
|
|||
LSTR MSG_MOVE_10MM = _UxGT("移动 10 mm"); // "Move 10mm"
|
||||
LSTR MSG_MOVE_100MM = _UxGT("移动 100 mm"); // "Move 100mm"
|
||||
LSTR MSG_SPEED = _UxGT("速率"); // "Speed"
|
||||
LSTR MSG_BED_Z = _UxGT("热床Z"); // "Bed Z"
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("热床Z"); // "Bed Z"
|
||||
LSTR MSG_NOZZLE = _UxGT("喷嘴"); // "Nozzle" 噴嘴
|
||||
LSTR MSG_NOZZLE_N = _UxGT("喷嘴 ~"); // "Nozzle" 噴嘴
|
||||
LSTR MSG_NOZZLE_PARKED = _UxGT("喷嘴已停靠");
|
||||
|
|
|
@ -229,7 +229,7 @@ namespace Language_zh_TW {
|
|||
LSTR MSG_MOVE_50MM = _UxGT("移動 50 mm"); // "Move 50mm"
|
||||
LSTR MSG_MOVE_100MM = _UxGT("移動 100 mm"); // "Move 100mm"
|
||||
LSTR MSG_SPEED = _UxGT("速率"); // "Speed"
|
||||
LSTR MSG_BED_Z = _UxGT("熱床Z"); // "Bed Z"
|
||||
LSTR MSG_MESH_Z_OFFSET = _UxGT("熱床Z"); // "Bed Z"
|
||||
LSTR MSG_NOZZLE = " " LCD_STR_THERMOMETER _UxGT(" 噴嘴"); // "Nozzle" 噴嘴
|
||||
LSTR MSG_NOZZLE_N = " " LCD_STR_THERMOMETER _UxGT(" 噴嘴 ~");
|
||||
LSTR MSG_BED = " " LCD_STR_THERMOMETER _UxGT(" 熱床"); // "Bed"
|
||||
|
|
|
@ -1831,7 +1831,7 @@ void MarlinUI::init() {
|
|||
#endif
|
||||
}
|
||||
|
||||
#if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
|
||||
#if EITHER(BABYSTEP_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
|
||||
void MarlinUI::zoffset_overlay(const_float_t zvalue) {
|
||||
// Determine whether the user is raising or lowering the nozzle.
|
||||
static int8_t dir;
|
||||
|
|
|
@ -506,7 +506,7 @@ public:
|
|||
static bool old_is_printing;
|
||||
#endif
|
||||
|
||||
#if EITHER(BABYSTEP_ZPROBE_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
|
||||
#if EITHER(BABYSTEP_GFX_OVERLAY, MESH_EDIT_GFX_OVERLAY)
|
||||
static void zoffset_overlay(const int8_t dir);
|
||||
static void zoffset_overlay(const_float_t zvalue);
|
||||
#endif
|
||||
|
|
|
@ -321,7 +321,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
|
|||
if (ui.should_draw()) {
|
||||
if (do_probe) {
|
||||
MenuEditItemBase::draw_edit_screen(GET_TEXT_F(MSG_ZPROBE_ZOFFSET), BABYSTEP_TO_STR(probe.offset.z));
|
||||
TERN_(BABYSTEP_ZPROBE_GFX_OVERLAY, ui.zoffset_overlay(probe.offset.z));
|
||||
TERN_(BABYSTEP_GFX_OVERLAY, ui.zoffset_overlay(probe.offset.z));
|
||||
}
|
||||
else {
|
||||
#if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
||||
|
|
|
@ -283,7 +283,7 @@ void menu_bed_leveling() {
|
|||
#else
|
||||
#define LCD_Z_OFFSET_TYPE float42_52 // Values from -99.99 to 99.99
|
||||
#endif
|
||||
EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_BED_Z, &bedlevel.z_offset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
|
||||
EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_MESH_Z_OFFSET, &bedlevel.z_offset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
|
||||
#endif
|
||||
|
||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
|
|
|
@ -120,7 +120,7 @@ void menu_tune() {
|
|||
// Manual bed leveling, Bed Z:
|
||||
//
|
||||
#if BOTH(MESH_BED_LEVELING, LCD_BED_LEVELING)
|
||||
EDIT_ITEM(float43, MSG_BED_Z, &bedlevel.z_offset, -1, 1);
|
||||
EDIT_ITEM(float43, MSG_MESH_Z_OFFSET, &bedlevel.z_offset, -1, 1);
|
||||
#endif
|
||||
|
||||
//
|
||||
|
|
|
@ -11,7 +11,7 @@ set -e
|
|||
#
|
||||
restore_configs
|
||||
opt_set MOTHERBOARD BOARD_FYSETC_F6_13 LCD_SERIAL_PORT 1 DGUS_LCD_UI FYSETC
|
||||
exec_test $1 $2 "FYSETC F6 1.3 with DGUS" "$3"
|
||||
exec_test $1 $2 "FYSETC F6 1.3 with DGUS (FYSETC)" "$3"
|
||||
|
||||
#
|
||||
# Delta Config (generic) + UBL + ALLEN_KEY + EEPROM_SETTINGS + OLED_PANEL_TINYBOY2
|
||||
|
|
|
@ -44,7 +44,7 @@ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER ADAPTIVE_FAN_SLOWING TE
|
|||
FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY PID_EXTRUSION_SCALING SOUND_MENU_ITEM \
|
||||
NOZZLE_AS_PROBE AUTO_BED_LEVELING_BILINEAR PREHEAT_BEFORE_LEVELING G29_RETRY_AND_RECOVER Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \
|
||||
ASSISTED_TRAMMING ASSISTED_TRAMMING_WIZARD REPORT_TRAMMING_MM ASSISTED_TRAMMING_WAIT_POSITION \
|
||||
BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \
|
||||
BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \
|
||||
PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT \
|
||||
Z_SAFE_HOMING ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE \
|
||||
HOST_KEEPALIVE_FEATURE HOST_ACTION_COMMANDS HOST_PROMPT_SUPPORT \
|
||||
|
|
|
@ -24,7 +24,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE BLTOUCH Z_MIN_PROBE_REPEATABILITY_TEST \
|
|||
STATUS_MESSAGE_SCROLLING SET_PROGRESS_MANUALLY SHOW_REMAINING_TIME SET_REMAINING_TIME \
|
||||
LONG_FILENAME_HOST_SUPPORT CUSTOM_FIRMWARE_UPLOAD M20_TIMESTAMP_SUPPORT \
|
||||
SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \
|
||||
MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \
|
||||
MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \
|
||||
LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \
|
||||
SQUARE_WAVE_STEPPING
|
||||
exec_test $1 $2 "Minitronics 2.0 with assorted features" "$3"
|
||||
|
|
|
@ -24,7 +24,7 @@ opt_enable ENDSTOP_INTERRUPTS_FEATURE S_CURVE_ACCELERATION BLTOUCH Z_MIN_PROBE_R
|
|||
STATUS_MESSAGE_SCROLLING SET_PROGRESS_MANUALLY SHOW_REMAINING_TIME SET_REMAINING_TIME \
|
||||
LONG_FILENAME_HOST_SUPPORT CUSTOM_FIRMWARE_UPLOAD M20_TIMESTAMP_SUPPORT \
|
||||
SCROLL_LONG_FILENAMES BABYSTEPPING DOUBLECLICK_FOR_Z_BABYSTEPPING \
|
||||
MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \
|
||||
MOVE_Z_WHEN_IDLE BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \
|
||||
LIN_ADVANCE ADVANCED_PAUSE_FEATURE PARK_HEAD_ON_PAUSE MONITOR_DRIVER_STATUS SENSORLESS_HOMING \
|
||||
SQUARE_WAVE_STEPPING TMC_DEBUG
|
||||
exec_test $1 $2 "Grand Central M4 with assorted features" "$3"
|
||||
|
|
|
@ -24,7 +24,7 @@ opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT SDCARD_SORT_A
|
|||
LCD_INFO_MENU LCD_PRINTER_INFO_IS_BOOTSCREEN LARGE_MOVE_ITEMS TURBO_BACK_MENU_ITEM PREHEAT_SHORTCUT_MENU_ITEM \
|
||||
FILAMENT_WIDTH_SENSOR FILAMENT_LCD_DISPLAY CALIBRATION_GCODE BAUD_RATE_GCODE SOUND_MENU_ITEM \
|
||||
FIX_MOUNTED_PROBE Z_SAFE_HOMING AUTO_BED_LEVELING_BILINEAR Z_MIN_PROBE_REPEATABILITY_TEST DEBUG_LEVELING_FEATURE \
|
||||
BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_ZPROBE_GFX_OVERLAY \
|
||||
BABYSTEPPING BABYSTEP_XY BABYSTEP_ZPROBE_OFFSET BABYSTEP_GFX_OVERLAY \
|
||||
PRINTCOUNTER NOZZLE_PARK_FEATURE NOZZLE_CLEAN_FEATURE SLOW_PWM_HEATERS PIDTEMPBED EEPROM_SETTINGS INCH_MODE_SUPPORT TEMPERATURE_UNITS_SUPPORT M100_FREE_MEMORY_WATCHER \
|
||||
ADVANCED_PAUSE_FEATURE ARC_SUPPORT BEZIER_CURVE_SUPPORT EXPERIMENTAL_I2CBUS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES PARK_HEAD_ON_PAUSE \
|
||||
PHOTO_GCODE PHOTO_POSITION PHOTO_SWITCH_POSITION PHOTO_SWITCH_MS PHOTO_DELAY_MS PHOTO_RETRACT_MM \
|
||||
|
|
Loading…
Reference in a new issue