Merge upstream changes from Marlin 2.1.1
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -57,7 +57,7 @@ void DGUSDisplay::Loop() {
|
||||
void DGUSDisplay::Init() {
|
||||
LCD_SERIAL.begin(LCD_BAUDRATE);
|
||||
|
||||
Read(DGUS_VERSION, 1);
|
||||
ReadVersions();
|
||||
}
|
||||
|
||||
void DGUSDisplay::Read(uint16_t addr, uint8_t size) {
|
||||
@@ -158,6 +158,11 @@ void DGUSDisplay::WriteStringPGM(uint16_t addr, const void* data_ptr, uint8_t si
|
||||
}
|
||||
}
|
||||
|
||||
void DGUSDisplay::ReadVersions() {
|
||||
if (gui_version != 0 && os_version != 0) return;
|
||||
Read(DGUS_VERSION, 1);
|
||||
}
|
||||
|
||||
void DGUSDisplay::SwitchScreen(DGUS_Screen screen) {
|
||||
DEBUG_ECHOLNPGM("SwitchScreen ", (uint8_t)screen);
|
||||
const uint8_t command[] = { 0x5A, 0x01, 0x00, (uint8_t)screen };
|
||||
@@ -313,7 +318,7 @@ void DGUSDisplay::ProcessRx() {
|
||||
gcode.reset_stepper_timeout();
|
||||
|
||||
if (!vp.size) {
|
||||
DEBUG_ECHOLN();
|
||||
DEBUG_EOL();
|
||||
vp.rx_handler(vp, nullptr);
|
||||
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
@@ -325,18 +330,15 @@ void DGUSDisplay::ProcessRx() {
|
||||
memset(buffer, 0, vp.size);
|
||||
|
||||
for (uint8_t i = 0; i < dlen; i++) {
|
||||
if (i >= vp.size) {
|
||||
break;
|
||||
}
|
||||
if (i >= vp.size) break;
|
||||
|
||||
if (i + 1 < dlen && tmp[i + 3] == 0xFF && tmp[i + 4] == 0xFF) {
|
||||
if (i + 1 < dlen && tmp[i + 3] == 0xFF && tmp[i + 4] == 0xFF)
|
||||
break;
|
||||
}
|
||||
|
||||
buffer[i] = tmp[i + 3];
|
||||
}
|
||||
|
||||
DEBUG_ECHOLN();
|
||||
DEBUG_EOL();
|
||||
vp.rx_handler(vp, buffer);
|
||||
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
@@ -349,7 +351,7 @@ void DGUSDisplay::ProcessRx() {
|
||||
break;
|
||||
}
|
||||
|
||||
DEBUG_ECHOLN();
|
||||
DEBUG_EOL();
|
||||
vp.rx_handler(vp, &tmp[3]);
|
||||
|
||||
rx_datagram_state = DGUS_IDLE;
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
@@ -69,6 +69,9 @@ public:
|
||||
// Until now I did not need to actively read from the display. That's why there is no ReadVariable
|
||||
// (I extensively use the auto upload of the display)
|
||||
|
||||
// Read GUI and OS version from screen
|
||||
static void ReadVersions();
|
||||
|
||||
// Force display into another screen.
|
||||
static void SwitchScreen(DGUS_Screen screen);
|
||||
// Play sounds using the display speaker.
|
||||
@@ -96,9 +99,9 @@ public:
|
||||
static size_t GetFreeTxBuffer();
|
||||
static void FlushTx();
|
||||
|
||||
// Checks two things: Can we confirm the presence of the display and has we initiliazed it.
|
||||
// Checks two things: Can we confirm the presence of the display and has we initialized it.
|
||||
// (both boils down that the display answered to our chatting)
|
||||
static inline bool IsInitialized() {
|
||||
static bool IsInitialized() {
|
||||
return initialized;
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -47,31 +47,29 @@ void DGUSRxHandler::ScreenChange(DGUS_VP &vp, void *data_ptr) {
|
||||
|
||||
if (vp.addr == DGUS_Addr::SCREENCHANGE_SD) {
|
||||
#if ENABLED(SDSUPPORT)
|
||||
#if !PIN_EXISTS(SD_DETECT)
|
||||
card.mount();
|
||||
#endif
|
||||
IF_DISABLED(HAS_SD_DETECT, card.mount());
|
||||
|
||||
if (!ExtUI::isMediaInserted()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(GET_TEXT(MSG_NO_MEDIA));
|
||||
dgus_screen_handler.SetStatusMessage(GET_TEXT_F(MSG_NO_MEDIA));
|
||||
return;
|
||||
}
|
||||
|
||||
card.cdroot();
|
||||
#else
|
||||
dgus_screen_handler.SetStatusMessagePGM(GET_TEXT(MSG_NO_MEDIA));
|
||||
dgus_screen_handler.SetStatusMessage(GET_TEXT_F(MSG_NO_MEDIA));
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (vp.addr == DGUS_Addr::SCREENCHANGE_Idle
|
||||
&& (ExtUI::isPrinting() || ExtUI::isPrintingPaused())) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(PSTR("Impossible while printing"));
|
||||
dgus_screen_handler.SetStatusMessage(F("Impossible while printing"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (vp.addr == DGUS_Addr::SCREENCHANGE_Printing
|
||||
&& (!ExtUI::isPrinting() && !ExtUI::isPrintingPaused())) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(PSTR("Impossible while idle"));
|
||||
dgus_screen_handler.SetStatusMessage(F("Impossible while idle"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -139,7 +137,7 @@ void DGUSRxHandler::ScreenChange(DGUS_VP &vp, void *data_ptr) {
|
||||
UNUSED(data_ptr);
|
||||
|
||||
if (dgus_screen_handler.filelist_selected < 0) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(PSTR("No file selected"));
|
||||
dgus_screen_handler.SetStatusMessage(F("No file selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -149,7 +147,7 @@ void DGUSRxHandler::ScreenChange(DGUS_VP &vp, void *data_ptr) {
|
||||
}
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,7 +205,7 @@ void DGUSRxHandler::PrintResume(DGUS_VP &vp, void *data_ptr) {
|
||||
}
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -327,7 +325,7 @@ void DGUSRxHandler::TempTarget(DGUS_VP &vp, void *data_ptr) {
|
||||
case DGUS_Addr::TEMP_SetTarget_H0:
|
||||
ExtUI::setTargetTemp_celsius(temp, ExtUI::H0);
|
||||
break;
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Addr::TEMP_SetTarget_H1:
|
||||
ExtUI::setTargetTemp_celsius(temp, ExtUI::H1);
|
||||
break;
|
||||
@@ -347,7 +345,7 @@ void DGUSRxHandler::TempCool(DGUS_VP &vp, void *data_ptr) {
|
||||
case DGUS_Data::Heater::ALL:
|
||||
ExtUI::setTargetTemp_celsius(0, ExtUI::BED);
|
||||
ExtUI::setTargetTemp_celsius(0, ExtUI::H0);
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
ExtUI::setTargetTemp_celsius(0, ExtUI::H1);
|
||||
#endif
|
||||
break;
|
||||
@@ -357,14 +355,14 @@ void DGUSRxHandler::TempCool(DGUS_VP &vp, void *data_ptr) {
|
||||
case DGUS_Data::Heater::H0:
|
||||
ExtUI::setTargetTemp_celsius(0, ExtUI::H0);
|
||||
break;
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Data::Heater::H1:
|
||||
ExtUI::setTargetTemp_celsius(0, ExtUI::H1);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
dgus_screen_handler.SetStatusMessagePGM(PSTR("Cooling..."));
|
||||
dgus_screen_handler.SetStatusMessage(F("Cooling..."));
|
||||
|
||||
dgus_screen_handler.TriggerFullUpdate();
|
||||
}
|
||||
@@ -390,12 +388,12 @@ void DGUSRxHandler::ZOffset(DGUS_VP &vp, void *data_ptr) {
|
||||
UNUSED(vp);
|
||||
|
||||
if (!ExtUI::isAxisPositionKnown(ExtUI::Z)) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_HOMING_REQUIRED);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_HOMING_REQUIRED));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -414,12 +412,12 @@ void DGUSRxHandler::ZOffsetStep(DGUS_VP &vp, void *data_ptr) {
|
||||
UNUSED(vp);
|
||||
|
||||
if (!ExtUI::isAxisPositionKnown(ExtUI::Z)) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_HOMING_REQUIRED);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_HOMING_REQUIRED));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -456,17 +454,17 @@ void DGUSRxHandler::MoveToPoint(DGUS_VP &vp, void *data_ptr) {
|
||||
UNUSED(vp);
|
||||
|
||||
if (!ExtUI::isPositionKnown()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_HOMING_REQUIRED);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_HOMING_REQUIRED));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
const uint8_t point = ((uint8_t*)data_ptr)[1];
|
||||
constexpr float lfrb[4] = LEVEL_CORNERS_INSET_LFRB;
|
||||
constexpr float lfrb[4] = BED_TRAMMING_INSET_LFRB;
|
||||
float x, y;
|
||||
|
||||
switch (point) {
|
||||
@@ -493,12 +491,12 @@ void DGUSRxHandler::MoveToPoint(DGUS_VP &vp, void *data_ptr) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (ExtUI::getAxisPosition_mm(ExtUI::Z) < Z_MIN_POS + LEVEL_CORNERS_Z_HOP) {
|
||||
ExtUI::setAxisPosition_mm(Z_MIN_POS + LEVEL_CORNERS_Z_HOP, ExtUI::Z);
|
||||
if (ExtUI::getAxisPosition_mm(ExtUI::Z) < Z_MIN_POS + BED_TRAMMING_Z_HOP) {
|
||||
ExtUI::setAxisPosition_mm(Z_MIN_POS + BED_TRAMMING_Z_HOP, ExtUI::Z);
|
||||
}
|
||||
ExtUI::setAxisPosition_mm(x, ExtUI::X);
|
||||
ExtUI::setAxisPosition_mm(y, ExtUI::Y);
|
||||
ExtUI::setAxisPosition_mm(Z_MIN_POS + LEVEL_CORNERS_HEIGHT, ExtUI::Z);
|
||||
ExtUI::setAxisPosition_mm(Z_MIN_POS + BED_TRAMMING_HEIGHT, ExtUI::Z);
|
||||
}
|
||||
|
||||
void DGUSRxHandler::Probe(DGUS_VP &vp, void *data_ptr) {
|
||||
@@ -506,26 +504,26 @@ void DGUSRxHandler::Probe(DGUS_VP &vp, void *data_ptr) {
|
||||
UNUSED(data_ptr);
|
||||
|
||||
#if ENABLED(MESH_BED_LEVELING)
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_ABL_REQUIRED);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_ABL_REQUIRED));
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (!ExtUI::isPositionKnown()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_HOMING_REQUIRED);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_HOMING_REQUIRED));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
dgus_screen_handler.TriggerScreenChange(DGUS_Screen::LEVELING_PROBING);
|
||||
|
||||
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
||||
queue.enqueue_now_P(PSTR("G29P1\nG29P3\nG29P5C"));
|
||||
queue.enqueue_now(F("G29P1\nG29P3\nG29P5C"));
|
||||
#else
|
||||
queue.enqueue_now_P(PSTR("G29"));
|
||||
queue.enqueue_now(F("G29"));
|
||||
#endif
|
||||
queue.enqueue_now_P(DGUS_CMD_EEPROM_SAVE);
|
||||
}
|
||||
@@ -535,7 +533,7 @@ void DGUSRxHandler::DisableABL(DGUS_VP &vp, void *data_ptr) {
|
||||
UNUSED(data_ptr);
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -576,7 +574,7 @@ void DGUSRxHandler::FilamentMove(DGUS_VP &vp, void *data_ptr) {
|
||||
UNUSED(vp);
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -600,7 +598,7 @@ void DGUSRxHandler::FilamentMove(DGUS_VP &vp, void *data_ptr) {
|
||||
}
|
||||
|
||||
if (ExtUI::getActualTemp_celsius(extruder) < (float)EXTRUDE_MINTEMP) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(PSTR("Temperature too low"));
|
||||
dgus_screen_handler.SetStatusMessage(F("Temperature too low"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -620,7 +618,7 @@ void DGUSRxHandler::Home(DGUS_VP &vp, void *data_ptr) {
|
||||
UNUSED(vp);
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -634,13 +632,13 @@ void DGUSRxHandler::Home(DGUS_VP &vp, void *data_ptr) {
|
||||
|
||||
switch (axis) {
|
||||
case DGUS_Data::Axis::X_Y_Z:
|
||||
queue.enqueue_now_P(PSTR("G28XYZ"));
|
||||
queue.enqueue_now(F("G28XYZ"));
|
||||
break;
|
||||
case DGUS_Data::Axis::X_Y:
|
||||
queue.enqueue_now_P(PSTR("G28XY"));
|
||||
queue.enqueue_now(F("G28XY"));
|
||||
break;
|
||||
case DGUS_Data::Axis::Z:
|
||||
queue.enqueue_now_P(PSTR("G28Z"));
|
||||
queue.enqueue_now(F("G28Z"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -664,7 +662,7 @@ void DGUSRxHandler::Move(DGUS_VP &vp, void *data_ptr) {
|
||||
}
|
||||
|
||||
if (!ExtUI::isAxisPositionKnown(axis)) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_HOMING_REQUIRED);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_HOMING_REQUIRED));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -720,7 +718,7 @@ void DGUSRxHandler::MoveStep(DGUS_VP &vp, void *data_ptr) {
|
||||
}
|
||||
|
||||
if (!ExtUI::isAxisPositionKnown(axis)) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_HOMING_REQUIRED);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_HOMING_REQUIRED));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -757,7 +755,7 @@ void DGUSRxHandler::GcodeExecute(DGUS_VP &vp, void *data_ptr) {
|
||||
}
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -780,11 +778,11 @@ void DGUSRxHandler::ResetEEPROM(DGUS_VP &vp, void *data_ptr) {
|
||||
}
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
queue.enqueue_now_P(PSTR("M502"));
|
||||
queue.enqueue_now(F("M502"));
|
||||
queue.enqueue_now_P(DGUS_CMD_EEPROM_SAVE);
|
||||
}
|
||||
|
||||
@@ -798,11 +796,11 @@ void DGUSRxHandler::SettingsExtra(DGUS_VP &vp, void *data_ptr) {
|
||||
case DGUS_Data::Extra::BUTTON1:
|
||||
#if ENABLED(BLTOUCH)
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
queue.enqueue_now_P(PSTR(DGUS_RESET_BLTOUCH));
|
||||
queue.enqueue_now(F(DGUS_RESET_BLTOUCH));
|
||||
#else
|
||||
dgus_screen_handler.TriggerScreenChange(DGUS_Screen::INFOS);
|
||||
#endif
|
||||
@@ -827,7 +825,7 @@ void DGUSRxHandler::PIDSelect(DGUS_VP &vp, void *data_ptr) {
|
||||
dgus_screen_handler.pid_heater = heater;
|
||||
break;
|
||||
case DGUS_Data::Heater::H0:
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Data::Heater::H1:
|
||||
#endif
|
||||
dgus_screen_handler.pid_temp = DGUS_PLA_TEMP_HOTEND;
|
||||
@@ -844,7 +842,7 @@ void DGUSRxHandler::PIDSetTemp(DGUS_VP &vp, void *data_ptr) {
|
||||
UNUSED(vp);
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -858,7 +856,7 @@ void DGUSRxHandler::PIDSetTemp(DGUS_VP &vp, void *data_ptr) {
|
||||
case DGUS_Data::Heater::H0:
|
||||
temp = constrain(temp, HEATER_0_MINTEMP, (HEATER_0_MAXTEMP - HOTEND_OVERSHOOT));
|
||||
break;
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Data::Heater::H1:
|
||||
temp = constrain(temp, HEATER_1_MINTEMP, (HEATER_1_MAXTEMP - HOTEND_OVERSHOOT));
|
||||
break;
|
||||
@@ -875,7 +873,7 @@ void DGUSRxHandler::PIDRun(DGUS_VP &vp, void *data_ptr) {
|
||||
UNUSED(data_ptr);
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -889,7 +887,7 @@ void DGUSRxHandler::PIDRun(DGUS_VP &vp, void *data_ptr) {
|
||||
heater = H_BED;
|
||||
break;
|
||||
#else
|
||||
dgus_screen_handler.SetStatusMessagePGM(PSTR("Bed PID disabled"));
|
||||
dgus_screen_handler.SetStatusMessage(F("Bed PID disabled"));
|
||||
return;
|
||||
#endif
|
||||
case DGUS_Data::Heater::H0:
|
||||
@@ -897,16 +895,16 @@ void DGUSRxHandler::PIDRun(DGUS_VP &vp, void *data_ptr) {
|
||||
heater = H_E0;
|
||||
break;
|
||||
#else
|
||||
dgus_screen_handler.SetStatusMessagePGM(PSTR("PID disabled"));
|
||||
dgus_screen_handler.SetStatusMessage(F("PID disabled"));
|
||||
return;
|
||||
#endif
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Data::Heater::H1:
|
||||
#if ENABLED(PIDTEMP)
|
||||
heater = H_E1;
|
||||
break;
|
||||
#else
|
||||
dgus_screen_handler.SetStatusMessagePGM(PSTR("PID disabled"));
|
||||
dgus_screen_handler.SetStatusMessage(F("PID disabled"));
|
||||
return;
|
||||
#endif
|
||||
#endif
|
||||
@@ -936,13 +934,13 @@ void DGUSRxHandler::PIDRun(DGUS_VP &vp, void *data_ptr) {
|
||||
}
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
dgus_screen_handler.TriggerScreenChange(DGUS_Screen::HOME);
|
||||
|
||||
queue.enqueue_now_P(PSTR("M1000C"));
|
||||
queue.enqueue_now(F("M1000C"));
|
||||
}
|
||||
|
||||
void DGUSRxHandler::PowerLossResume(DGUS_VP &vp, void *data_ptr) {
|
||||
@@ -955,18 +953,18 @@ void DGUSRxHandler::PIDRun(DGUS_VP &vp, void *data_ptr) {
|
||||
}
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!recovery.valid()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(PSTR("Invalid recovery data"));
|
||||
dgus_screen_handler.SetStatusMessage(F("Invalid recovery data"));
|
||||
return;
|
||||
}
|
||||
|
||||
dgus_screen_handler.TriggerScreenChange(DGUS_Screen::PRINT_STATUS);
|
||||
|
||||
queue.enqueue_now_P(PSTR("M1000"));
|
||||
queue.enqueue_now(F("M1000"));
|
||||
}
|
||||
#endif // POWER_LOSS_RECOVERY
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -100,61 +100,57 @@ void DGUSScreenHandler::Loop() {
|
||||
if (new_screen != DGUS_Screen::BOOT) {
|
||||
const DGUS_Screen screen = new_screen;
|
||||
new_screen = DGUS_Screen::BOOT;
|
||||
|
||||
if (current_screen == screen) {
|
||||
if (current_screen == screen)
|
||||
TriggerFullUpdate();
|
||||
}
|
||||
else {
|
||||
else
|
||||
MoveToScreen(screen);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!booted && ELAPSED(ms, 3000)) {
|
||||
booted = true;
|
||||
|
||||
if (current_screen == DGUS_Screen::BOOT) {
|
||||
dgus_display.ReadVersions();
|
||||
|
||||
if (current_screen == DGUS_Screen::BOOT)
|
||||
MoveToScreen(DGUS_Screen::HOME);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (ELAPSED(ms, next_event_ms) || full_update) {
|
||||
next_event_ms = ms + DGUS_UPDATE_INTERVAL_MS;
|
||||
|
||||
if (!SendScreenVPData(current_screen, full_update)) {
|
||||
if (!SendScreenVPData(current_screen, full_update))
|
||||
DEBUG_ECHOLNPGM("SendScreenVPData failed");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (current_screen == DGUS_Screen::WAIT
|
||||
&& ((wait_continue && !wait_for_user)
|
||||
|| (!wait_continue && IsPrinterIdle()))) {
|
||||
|| (!wait_continue && IsPrinterIdle()))
|
||||
) {
|
||||
MoveToScreen(wait_return_screen, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (current_screen == DGUS_Screen::LEVELING_PROBING
|
||||
&& IsPrinterIdle()) {
|
||||
if (current_screen == DGUS_Screen::LEVELING_PROBING && IsPrinterIdle()) {
|
||||
dgus_display.PlaySound(3);
|
||||
|
||||
SetStatusMessagePGM(ExtUI::getMeshValid() ?
|
||||
PSTR("Probing successful")
|
||||
: PSTR("Probing failed"));
|
||||
SetStatusMessage(ExtUI::getMeshValid() ? F("Probing successful") : F("Probing failed"));
|
||||
|
||||
MoveToScreen(DGUS_Screen::LEVELING_AUTOMATIC);
|
||||
return;
|
||||
}
|
||||
|
||||
if (status_expire > 0 && ELAPSED(ms, status_expire)) {
|
||||
SetStatusMessagePGM(NUL_STR, 0);
|
||||
SetStatusMessage(FPSTR(NUL_STR), 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (eeprom_save > 0 && ELAPSED(ms, eeprom_save) && IsPrinterIdle()) {
|
||||
eeprom_save = 0;
|
||||
|
||||
queue.enqueue_now_P(DGUS_CMD_EEPROM_SAVE);
|
||||
return;
|
||||
}
|
||||
@@ -162,9 +158,9 @@ void DGUSScreenHandler::Loop() {
|
||||
dgus_display.Loop();
|
||||
}
|
||||
|
||||
void DGUSScreenHandler::PrinterKilled(PGM_P error, PGM_P component) {
|
||||
SetMessageLinePGM(error, 1);
|
||||
SetMessageLinePGM(component, 2);
|
||||
void DGUSScreenHandler::PrinterKilled(FSTR_P const error, FSTR_P const component) {
|
||||
SetMessageLinePGM(FTOP(error), 1);
|
||||
SetMessageLinePGM(FTOP(component), 2);
|
||||
SetMessageLinePGM(NUL_STR, 3);
|
||||
SetMessageLinePGM(GET_TEXT(MSG_PLEASE_RESET), 4);
|
||||
|
||||
@@ -190,11 +186,10 @@ void DGUSScreenHandler::SettingsReset() {
|
||||
|
||||
if (!settings_ready) {
|
||||
settings_ready = true;
|
||||
|
||||
Ready();
|
||||
}
|
||||
|
||||
SetStatusMessagePGM(PSTR("EEPROM reset"));
|
||||
SetStatusMessage(F("EEPROM reset"));
|
||||
}
|
||||
|
||||
void DGUSScreenHandler::StoreSettings(char *buff) {
|
||||
@@ -205,7 +200,7 @@ void DGUSScreenHandler::StoreSettings(char *buff) {
|
||||
data.initialized = true;
|
||||
data.volume = dgus_display.GetVolume();
|
||||
data.brightness = dgus_display.GetBrightness();
|
||||
data.abl = (ExtUI::getLevelingActive() && ExtUI::getMeshValid());
|
||||
data.abl_okay = (ExtUI::getLevelingActive() && ExtUI::getMeshValid());
|
||||
|
||||
memcpy(buff, &data, sizeof(data));
|
||||
}
|
||||
@@ -221,25 +216,22 @@ void DGUSScreenHandler::LoadSettings(const char *buff) {
|
||||
dgus_display.SetBrightness(data.initialized ? data.brightness : DGUS_DEFAULT_BRIGHTNESS);
|
||||
|
||||
if (data.initialized) {
|
||||
leveling_active = (data.abl && ExtUI::getMeshValid());
|
||||
|
||||
leveling_active = (data.abl_okay && ExtUI::getMeshValid());
|
||||
ExtUI::setLevelingActive(leveling_active);
|
||||
}
|
||||
}
|
||||
|
||||
void DGUSScreenHandler::ConfigurationStoreWritten(bool success) {
|
||||
if (!success) {
|
||||
SetStatusMessagePGM(PSTR("EEPROM write failed"));
|
||||
}
|
||||
if (!success)
|
||||
SetStatusMessage(F("EEPROM write failed"));
|
||||
}
|
||||
|
||||
void DGUSScreenHandler::ConfigurationStoreRead(bool success) {
|
||||
if (!success) {
|
||||
SetStatusMessagePGM(PSTR("EEPROM read failed"));
|
||||
SetStatusMessage(F("EEPROM read failed"));
|
||||
}
|
||||
else if (!settings_ready) {
|
||||
settings_ready = true;
|
||||
|
||||
Ready();
|
||||
}
|
||||
}
|
||||
@@ -248,33 +240,25 @@ void DGUSScreenHandler::PlayTone(const uint16_t frequency, const uint16_t durati
|
||||
UNUSED(duration);
|
||||
|
||||
if (frequency >= 1 && frequency <= 255) {
|
||||
if (duration >= 1 && duration <= 255) {
|
||||
if (duration >= 1 && duration <= 255)
|
||||
dgus_display.PlaySound((uint8_t)frequency, (uint8_t)duration);
|
||||
}
|
||||
else {
|
||||
else
|
||||
dgus_display.PlaySound((uint8_t)frequency);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DGUSScreenHandler::MeshUpdate(const int8_t xpos, const int8_t ypos) {
|
||||
if (current_screen != DGUS_Screen::LEVELING_PROBING) {
|
||||
if (current_screen == DGUS_Screen::LEVELING_AUTOMATIC) {
|
||||
if (current_screen == DGUS_Screen::LEVELING_AUTOMATIC)
|
||||
TriggerFullUpdate();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t point = ypos * GRID_MAX_POINTS_X + xpos;
|
||||
probing_icons[point < 16 ? 0 : 1] |= (1U << (point % 16));
|
||||
|
||||
if (xpos >= GRID_MAX_POINTS_X - 1
|
||||
&& ypos >= GRID_MAX_POINTS_Y - 1
|
||||
&& !ExtUI::getMeshValid()) {
|
||||
probing_icons[0] = 0;
|
||||
probing_icons[1] = 0;
|
||||
}
|
||||
if (xpos >= GRID_MAX_POINTS_X - 1 && ypos >= GRID_MAX_POINTS_Y - 1 && !ExtUI::getMeshValid())
|
||||
probing_icons[0] = probing_icons[1] = 0;
|
||||
|
||||
TriggerFullUpdate();
|
||||
}
|
||||
@@ -285,15 +269,12 @@ void DGUSScreenHandler::PrintTimerStarted() {
|
||||
|
||||
void DGUSScreenHandler::PrintTimerPaused() {
|
||||
dgus_display.PlaySound(3);
|
||||
|
||||
TriggerFullUpdate();
|
||||
}
|
||||
|
||||
void DGUSScreenHandler::PrintTimerStopped() {
|
||||
if (current_screen != DGUS_Screen::PRINT_STATUS
|
||||
&& current_screen != DGUS_Screen::PRINT_ADJUST) {
|
||||
if (current_screen != DGUS_Screen::PRINT_STATUS && current_screen != DGUS_Screen::PRINT_ADJUST)
|
||||
return;
|
||||
}
|
||||
|
||||
dgus_display.PlaySound(3);
|
||||
|
||||
@@ -312,23 +293,19 @@ void DGUSScreenHandler::FilamentRunout(const ExtUI::extruder_t extruder) {
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
void DGUSScreenHandler::SDCardInserted() {
|
||||
if (current_screen == DGUS_Screen::HOME) {
|
||||
if (current_screen == DGUS_Screen::HOME)
|
||||
TriggerScreenChange(DGUS_Screen::PRINT);
|
||||
}
|
||||
}
|
||||
|
||||
void DGUSScreenHandler::SDCardRemoved() {
|
||||
if (current_screen == DGUS_Screen::PRINT) {
|
||||
if (current_screen == DGUS_Screen::PRINT)
|
||||
TriggerScreenChange(DGUS_Screen::HOME);
|
||||
}
|
||||
}
|
||||
|
||||
void DGUSScreenHandler::SDCardError() {
|
||||
SetStatusMessagePGM(GET_TEXT(MSG_MEDIA_READ_ERROR));
|
||||
|
||||
if (current_screen == DGUS_Screen::PRINT) {
|
||||
SetStatusMessage(GET_TEXT_F(MSG_MEDIA_READ_ERROR));
|
||||
if (current_screen == DGUS_Screen::PRINT)
|
||||
TriggerScreenChange(DGUS_Screen::HOME);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT
|
||||
@@ -346,19 +323,19 @@ void DGUSScreenHandler::FilamentRunout(const ExtUI::extruder_t extruder) {
|
||||
void DGUSScreenHandler::PidTuning(const ExtUI::result_t rst) {
|
||||
switch (rst) {
|
||||
case ExtUI::PID_STARTED:
|
||||
SetStatusMessagePGM(GET_TEXT(MSG_PID_AUTOTUNE));
|
||||
SetStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE));
|
||||
break;
|
||||
case ExtUI::PID_BAD_EXTRUDER_NUM:
|
||||
SetStatusMessagePGM(GET_TEXT(MSG_PID_BAD_EXTRUDER_NUM));
|
||||
SetStatusMessage(GET_TEXT_F(MSG_PID_BAD_EXTRUDER_NUM));
|
||||
break;
|
||||
case ExtUI::PID_TEMP_TOO_HIGH:
|
||||
SetStatusMessagePGM(GET_TEXT(MSG_PID_TEMP_TOO_HIGH));
|
||||
SetStatusMessage(GET_TEXT_F(MSG_PID_TEMP_TOO_HIGH));
|
||||
break;
|
||||
case ExtUI::PID_TUNING_TIMEOUT:
|
||||
SetStatusMessagePGM(GET_TEXT(MSG_PID_TIMEOUT));
|
||||
SetStatusMessage(GET_TEXT_F(MSG_PID_TIMEOUT));
|
||||
break;
|
||||
case ExtUI::PID_DONE:
|
||||
SetStatusMessagePGM(GET_TEXT(MSG_PID_AUTOTUNE_DONE));
|
||||
SetStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE_DONE));
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
@@ -411,8 +388,8 @@ void DGUSScreenHandler::SetStatusMessage(const char* msg, const millis_t duratio
|
||||
status_expire = (duration > 0 ? ExtUI::safe_millis() + duration : 0);
|
||||
}
|
||||
|
||||
void DGUSScreenHandler::SetStatusMessagePGM(PGM_P msg, const millis_t duration) {
|
||||
dgus_display.WriteStringPGM((uint16_t)DGUS_Addr::MESSAGE_Status, msg, DGUS_STATUS_LEN, false, true);
|
||||
void DGUSScreenHandler::SetStatusMessage(FSTR_P const fmsg, const millis_t duration) {
|
||||
dgus_display.WriteStringPGM((uint16_t)DGUS_Addr::MESSAGE_Status, FTOP(fmsg), DGUS_STATUS_LEN, false, true);
|
||||
|
||||
status_expire = (duration > 0 ? ExtUI::safe_millis() + duration : 0);
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
static void Ready();
|
||||
static void Loop();
|
||||
|
||||
static void PrinterKilled(PGM_P error, PGM_P component);
|
||||
static void PrinterKilled(FSTR_P const error, FSTR_P const component);
|
||||
static void UserConfirmRequired(const char * const msg);
|
||||
static void SettingsReset();
|
||||
static void StoreSettings(char *buff);
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
static void SetMessageLinePGM(PGM_P msg, uint8_t line);
|
||||
|
||||
static void SetStatusMessage(const char* msg, const millis_t duration = DGUS_STATUS_EXPIRATION_MS);
|
||||
static void SetStatusMessagePGM(PGM_P msg, const millis_t duration = DGUS_STATUS_EXPIRATION_MS);
|
||||
static void SetStatusMessage(FSTR_P const msg, const millis_t duration = DGUS_STATUS_EXPIRATION_MS);
|
||||
|
||||
static void ShowWaitScreen(DGUS_Screen return_screen, bool has_continue = false);
|
||||
|
||||
@@ -134,7 +134,7 @@ private:
|
||||
bool initialized;
|
||||
uint8_t volume;
|
||||
uint8_t brightness;
|
||||
bool abl;
|
||||
bool abl_okay;
|
||||
} eeprom_data_t;
|
||||
};
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -68,13 +68,13 @@ bool DGUSSetupHandler::LevelingMenu() {
|
||||
ExtUI::setLevelingActive(dgus_screen_handler.leveling_active);
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ExtUI::isPositionKnown()) {
|
||||
if (ExtUI::getAxisPosition_mm(ExtUI::Z) < 10.0f) {
|
||||
queue.enqueue_now_P(PSTR("G0Z10"));
|
||||
queue.enqueue_now(F("G0Z10"));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -99,7 +99,7 @@ bool DGUSSetupHandler::LevelingManual() {
|
||||
}
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -118,20 +118,20 @@ bool DGUSSetupHandler::LevelingOffset() {
|
||||
dgus_screen_handler.offset_steps = DGUS_Data::StepSize::MMP1;
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ExtUI::isPositionKnown()) {
|
||||
if (ExtUI::getAxisPosition_mm(ExtUI::Z) < 4.0f) {
|
||||
queue.enqueue_now_P(PSTR("G0Z4"));
|
||||
queue.enqueue_now(F("G0Z4"));
|
||||
}
|
||||
|
||||
char buffer[20];
|
||||
snprintf_P(buffer, sizeof(buffer), PSTR("G0X%dY%d"), DGUS_LEVEL_CENTER_X, DGUS_LEVEL_CENTER_Y);
|
||||
|
||||
queue.enqueue_one_now(buffer);
|
||||
queue.enqueue_now_P(PSTR("G0Z0"));
|
||||
queue.enqueue_now(F("G0Z0"));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ bool DGUSSetupHandler::Move() {
|
||||
dgus_screen_handler.move_steps = DGUS_Data::StepSize::MM10;
|
||||
|
||||
if (!dgus_screen_handler.IsPrinterIdle()) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_BUSY);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_BUSY));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ bool DGUSSetupHandler::Gcode() {
|
||||
ZERO(dgus_screen_handler.gcode);
|
||||
|
||||
if (dgus_display.gui_version < 0x30 || dgus_display.os_version < 0x21) {
|
||||
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_FW_OUTDATED);
|
||||
dgus_screen_handler.SetStatusMessage(FPSTR(DGUS_MSG_FW_OUTDATED));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -275,7 +275,7 @@ void DGUSTxHandler::TempMax(DGUS_VP &vp) {
|
||||
case DGUS_Addr::TEMP_Max_H0:
|
||||
temp = HEATER_0_MAXTEMP - HOTEND_OVERSHOOT;
|
||||
break;
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Addr::TEMP_Max_H1:
|
||||
temp = HEATER_1_MAXTEMP - HOTEND_OVERSHOOT;
|
||||
break;
|
||||
@@ -286,7 +286,7 @@ void DGUSTxHandler::TempMax(DGUS_VP &vp) {
|
||||
}
|
||||
|
||||
void DGUSTxHandler::StepperStatus(DGUS_VP &vp) {
|
||||
const bool motor_on = stepper.axis_enabled.bits & (_BV(LINEAR_AXES) - 1);
|
||||
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)));
|
||||
}
|
||||
|
||||
@@ -341,8 +341,8 @@ void DGUSTxHandler::ABLGrid(DGUS_VP &vp) {
|
||||
int16_t fixed;
|
||||
|
||||
for (int i = 0; i < DGUS_LEVEL_GRID_SIZE; i++) {
|
||||
point.x = i % GRID_MAX_POINTS_X;
|
||||
point.y = i / GRID_MAX_POINTS_X;
|
||||
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));
|
||||
data[i] = Swap16(fixed);
|
||||
}
|
||||
@@ -428,7 +428,7 @@ void DGUSTxHandler::PIDKp(DGUS_VP &vp) {
|
||||
case DGUS_Data::Heater::H0:
|
||||
value = ExtUI::getPIDValues_Kp(ExtUI::E0);
|
||||
break;
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Data::Heater::H1:
|
||||
value = ExtUI::getPIDValues_Kp(ExtUI::E1);
|
||||
break;
|
||||
@@ -454,7 +454,7 @@ void DGUSTxHandler::PIDKi(DGUS_VP &vp) {
|
||||
case DGUS_Data::Heater::H0:
|
||||
value = ExtUI::getPIDValues_Ki(ExtUI::E0);
|
||||
break;
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Data::Heater::H1:
|
||||
value = ExtUI::getPIDValues_Ki(ExtUI::E1);
|
||||
break;
|
||||
@@ -480,7 +480,7 @@ void DGUSTxHandler::PIDKd(DGUS_VP &vp) {
|
||||
case DGUS_Data::Heater::H0:
|
||||
value = ExtUI::getPIDValues_Kd(ExtUI::E0);
|
||||
break;
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
case DGUS_Data::Heater::H1:
|
||||
value = ExtUI::getPIDValues_Kd(ExtUI::E1);
|
||||
break;
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
@@ -64,7 +64,7 @@ enum class DGUS_Addr : uint16_t {
|
||||
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 HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
TEMP_SetTarget_H1 = 0x2013, // Type: Integer (16 bits signed)
|
||||
#endif
|
||||
TEMP_Cool = 0x2014, // Data: DGUS_Data::Heater
|
||||
@@ -123,7 +123,7 @@ enum class DGUS_Addr : uint16_t {
|
||||
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 HOTENDS > 1
|
||||
#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)
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
@@ -71,15 +71,15 @@ static_assert((DGUS_LEVEL_GRID_SIZE == GRID_MAX_POINTS_X * GRID_MAX_POINTS_Y), "
|
||||
#define DGUS_DEFAULT_FILAMENT_LEN 10
|
||||
#endif
|
||||
|
||||
#ifndef LEVEL_CORNERS_Z_HOP
|
||||
#define LEVEL_CORNERS_Z_HOP 4.0
|
||||
#ifndef BED_TRAMMING_Z_HOP
|
||||
#define BED_TRAMMING_Z_HOP 4.0
|
||||
#endif
|
||||
|
||||
#ifndef LEVEL_CORNERS_HEIGHT
|
||||
#define LEVEL_CORNERS_HEIGHT 0.0
|
||||
#ifndef BED_TRAMMING_HEIGHT
|
||||
#define BED_TRAMMING_HEIGHT 0.0
|
||||
#endif
|
||||
|
||||
static_assert(LEVEL_CORNERS_Z_HOP >= 0, "LEVEL_CORNERS_Z_HOP must be >= 0. Please update your configuration.");
|
||||
static_assert(BED_TRAMMING_Z_HOP >= 0, "BED_TRAMMING_Z_HOP must be >= 0. Please update your configuration.");
|
||||
|
||||
#ifndef DGUS_LEVEL_CENTER_X
|
||||
#define DGUS_LEVEL_CENTER_X ((X_BED_SIZE) / 2)
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -102,7 +102,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
|
||||
VP_HELPER_RX(DGUS_Addr::TEMP_Preset, &DGUSRxHandler::TempPreset),
|
||||
VP_HELPER_RX(DGUS_Addr::TEMP_SetTarget_Bed, &DGUSRxHandler::TempTarget),
|
||||
VP_HELPER_RX(DGUS_Addr::TEMP_SetTarget_H0, &DGUSRxHandler::TempTarget),
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_HELPER_RX(DGUS_Addr::TEMP_SetTarget_H1, &DGUSRxHandler::TempTarget),
|
||||
#endif
|
||||
VP_HELPER_RX(DGUS_Addr::TEMP_Cool, &DGUSRxHandler::TempCool),
|
||||
@@ -217,7 +217,7 @@ const struct DGUS_VP vp_list[] PROGMEM = {
|
||||
&thermalManager.temp_hotend[ExtUI::heater_t::H0].target,
|
||||
&DGUSTxHandler::ExtraToInteger<int16_t>),
|
||||
VP_HELPER_TX(DGUS_Addr::TEMP_Max_H0, &DGUSTxHandler::TempMax),
|
||||
#if HOTENDS > 1
|
||||
#if HAS_MULTI_HOTEND
|
||||
VP_HELPER_TX_AUTO(DGUS_Addr::TEMP_Current_H1,
|
||||
&thermalManager.temp_hotend[ExtUI::heater_t::H1].celsius,
|
||||
&DGUSTxHandler::ExtraToInteger<float>),
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
@@ -16,7 +16,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace ExtUI {
|
||||
}
|
||||
}
|
||||
|
||||
void onPrinterKilled(PGM_P error, PGM_P component) {
|
||||
void onPrinterKilled(FSTR_P const error, FSTR_P const component) {
|
||||
dgus_screen_handler.PrinterKilled(error, component);
|
||||
}
|
||||
|
||||
@@ -83,8 +83,8 @@ namespace ExtUI {
|
||||
}
|
||||
|
||||
void onHomingStart() {}
|
||||
void onHomingComplete() {}
|
||||
void onPrintFinished() {}
|
||||
void onHomingDone() {}
|
||||
void onPrintDone() {}
|
||||
|
||||
void onFactoryReset() {
|
||||
dgus_screen_handler.SettingsReset();
|
||||
@@ -100,16 +100,17 @@ namespace ExtUI {
|
||||
|
||||
void onPostprocessSettings() {}
|
||||
|
||||
void onConfigurationStoreWritten(bool success) {
|
||||
void onSettingsStored(bool success) {
|
||||
dgus_screen_handler.ConfigurationStoreWritten(success);
|
||||
}
|
||||
|
||||
void onConfigurationStoreRead(bool success) {
|
||||
void onSettingsLoaded(bool success) {
|
||||
dgus_screen_handler.ConfigurationStoreRead(success);
|
||||
}
|
||||
|
||||
#if HAS_MESH
|
||||
void onMeshLevelingStart() {}
|
||||
void onLevelingStart() {}
|
||||
void onLevelingDone() {}
|
||||
|
||||
void onMeshUpdate(const int8_t xpos, const int8_t ypos, const_float_t zval) {
|
||||
dgus_screen_handler.MeshUpdate(xpos, ypos);
|
||||
|
Reference in New Issue
Block a user