Selaa lähdekoodia

Fix TOUCH_UI_FTDI_EVE bugs (#16540)

ellensp 4 vuotta sitten
vanhempi
commit
5bd66241df

+ 2
- 2
Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/basic/commands.cpp Näytä tiedosto

@@ -80,7 +80,7 @@ uint16_t CLCD::FontMetrics::get_text_width(progmem_str str, size_t n) const {
80 80
 /************************** HOST COMMAND FUNCTION *********************************/
81 81
 
82 82
 void CLCD::host_cmd (unsigned char host_command, unsigned char byte2) {  // Sends 24-Bit Host Command to LCD
83
-  if (host_command != ACTIVE) {
83
+  if (host_command != FTDI::ACTIVE) {
84 84
     host_command |= 0x40;
85 85
   }
86 86
   spi_ftdi_select();
@@ -1062,7 +1062,7 @@ void CLCD::init() {
1062 1062
     host_cmd(CLKINT, 0);
1063 1063
   }
1064 1064
 
1065
-  host_cmd(ACTIVE, 0);                        // Activate the System Clock
1065
+  host_cmd(FTDI::ACTIVE, 0);                        // Activate the System Clock
1066 1066
 
1067 1067
   /* read the device-id until it returns 0x7c or times out, should take less than 150ms */
1068 1068
   uint8_t counter;

+ 22
- 0
Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/marlin_events.cpp Näytä tiedosto

@@ -130,6 +130,28 @@ namespace ExtUI {
130 130
     void onMeshUpdate(const int8_t, const int8_t, const float) {
131 131
     }
132 132
   #endif
133
+
134
+  #if HAS_PID_HEATING
135
+    void OnPidTuning(const result_t rst) {
136
+      // Called for temperature PID tuning result
137
+      SERIAL_ECHOLNPAIR("OnPidTuning:", rst);
138
+      switch (rst) {
139
+        case PID_BAD_EXTRUDER_NUM:
140
+          StatusScreen::setStatusMessage(MSG_PID_BAD_EXTRUDER_NUM);
141
+          break;
142
+        case PID_TEMP_TOO_HIGH:
143
+          StatusScreen::setStatusMessage(MSG_PID_TEMP_TOO_HIGH);
144
+          break;
145
+        case PID_TUNING_TIMEOUT:
146
+          StatusScreen::setStatusMessage(MSG_PID_TIMEOUT);
147
+          break;
148
+        case PID_DONE:
149
+          StatusScreen::setStatusMessage(MSG_PID_AUTOTUNE_FINISHED);
150
+          break;
151
+      }
152
+      GOTO_SCREEN(StatusScreen);
153
+    }
154
+  #endif // HAS_PID_HEATING
133 155
 }
134 156
 
135 157
 #endif // TOUCH_UI_FTDI_EVE

+ 22
- 23
Marlin/src/lcd/extensible_ui/lib/ftdi_eve_touch_ui/screens/nudge_nozzle_screen.cpp Näytä tiedosto

@@ -45,19 +45,19 @@ void NudgeNozzleScreen::onRedraw(draw_mode_t what) {
45 45
   widgets_t w(what);
46 46
   w.precision(2, BaseNumericAdjustmentScreen::DEFAULT_MIDRANGE).units(GET_TEXT_F(MSG_UNITS_MM));
47 47
 
48
-  w.heading(                   GET_TEXT_F(MSG_NUDGE_NOZZLE));
48
+  w.heading(GET_TEXT_F(MSG_NUDGE_NOZZLE));
49 49
   #if ENABLED(BABYSTEP_XY)
50
-  w.color(x_axis).adjuster(2,  GET_TEXT_F(MSG_AXIS_X), screen_data.NudgeNozzleScreen.rel.x / getAxisSteps_per_mm(X));
51
-  w.color(y_axis).adjuster(4,  GET_TEXT_F(MSG_AXIS_Y), screen_data.NudgeNozzleScreen.rel.y / getAxisSteps_per_mm(Y));
50
+  w.color(x_axis).adjuster(2, GET_TEXT_F(MSG_AXIS_X), screen_data.NudgeNozzleScreen.rel.x / getAxisSteps_per_mm(X));
51
+  w.color(y_axis).adjuster(4, GET_TEXT_F(MSG_AXIS_Y), screen_data.NudgeNozzleScreen.rel.y / getAxisSteps_per_mm(Y));
52 52
   #endif
53
-  w.color(z_axis).adjuster(6,  GET_TEXT_F(MSG_AXIS_Z), screen_data.NudgeNozzleScreen.rel.z / getAxisSteps_per_mm(Z));
53
+  w.color(z_axis).adjuster(6, GET_TEXT_F(MSG_AXIS_Z), screen_data.NudgeNozzleScreen.rel.z / getAxisSteps_per_mm(Z));
54 54
   w.increments();
55 55
   #if EXTRUDERS > 1
56
-    w.toggle  (8,  GET_TEXT_F(MSG_ADJUST_BOTH_NOZZLES), screen_data.NudgeNozzleScreen.link_nozzles);
56
+    w.toggle(8, GET_TEXT_F(MSG_ADJUST_BOTH_NOZZLES), screen_data.NudgeNozzleScreen.link_nozzles);
57 57
   #endif
58 58
 
59 59
   #if EXTRUDERS > 1 || HAS_BED_PROBE
60
-    w.toggle  (9,  GET_TEXT_F(MSG_SHOW_OFFSETS), screen_data.NudgeNozzleScreen.show_offsets);
60
+    w.toggle(9, GET_TEXT_F(MSG_SHOW_OFFSETS), screen_data.NudgeNozzleScreen.show_offsets);
61 61
 
62 62
     if (screen_data.NudgeNozzleScreen.show_offsets) {
63 63
       char str[19];
@@ -69,38 +69,37 @@ void NudgeNozzleScreen::onRedraw(draw_mode_t what) {
69 69
         dtostrf(getZOffset_mm(), 4, 2, str);
70 70
         strcat(str, " ");
71 71
         strcat_P(str, GET_TEXT(MSG_UNITS_MM));
72
-        w.text_field  (0,  GET_TEXT_F(MSG_ZPROBE_ZOFFSET), str);
72
+        w.text_field(0, GET_TEXT_F(MSG_ZPROBE_ZOFFSET), str);
73 73
       #endif
74 74
 
75
-      #if EXTRUDERS > 1
75
+      #if HOTENDS > 1
76 76
         format_position(str, getNozzleOffset_mm(X, E1), getNozzleOffset_mm(Y, E1), getNozzleOffset_mm(Z, E1));
77
-        w.text_field  (0, GET_TEXT_F(MSG_OFFSETS_MENU), str);
77
+        w.text_field(0, GET_TEXT_F(MSG_OFFSETS_MENU), str);
78 78
       #endif
79 79
     }
80 80
   #endif
81 81
 }
82 82
 
83 83
 bool NudgeNozzleScreen::onTouchHeld(uint8_t tag) {
84
-  const float inc  = getIncrement();
84
+  const float inc = getIncrement();
85 85
   #if EXTRUDERS > 1
86
-    const bool  link = screen_data.NudgeNozzleScreen.link_nozzles;
86
+    const bool link = screen_data.NudgeNozzleScreen.link_nozzles;
87 87
   #else
88 88
     constexpr bool link = true;
89 89
   #endif
90 90
   int16_t steps;
91 91
   switch (tag) {
92
-    case  2: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps(-steps, X, link); screen_data.NudgeNozzleScreen.rel.x -= steps; break;
93
-    case  3: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps( steps, X, link); screen_data.NudgeNozzleScreen.rel.x += steps; break;
94
-    case  4: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps(-steps, Y, link); screen_data.NudgeNozzleScreen.rel.y -= steps; break;
95
-    case  5: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps( steps, Y, link); screen_data.NudgeNozzleScreen.rel.y += steps; break;
96
-    case  6: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps(-steps, Z, link); screen_data.NudgeNozzleScreen.rel.z -= steps; break;
97
-    case  7: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps( steps, Z, link); screen_data.NudgeNozzleScreen.rel.z += steps; break;
92
+    case 2: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps(-steps, X, link); screen_data.NudgeNozzleScreen.rel.x -= steps; break;
93
+    case 3: steps = mmToWholeSteps(inc, X); smartAdjustAxis_steps( steps, X, link); screen_data.NudgeNozzleScreen.rel.x += steps; break;
94
+    case 4: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps(-steps, Y, link); screen_data.NudgeNozzleScreen.rel.y -= steps; break;
95
+    case 5: steps = mmToWholeSteps(inc, Y); smartAdjustAxis_steps( steps, Y, link); screen_data.NudgeNozzleScreen.rel.y += steps; break;
96
+    case 6: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps(-steps, Z, link); screen_data.NudgeNozzleScreen.rel.z -= steps; break;
97
+    case 7: steps = mmToWholeSteps(inc, Z); smartAdjustAxis_steps( steps, Z, link); screen_data.NudgeNozzleScreen.rel.z += steps; break;
98 98
     #if EXTRUDERS > 1
99
-      case  8: screen_data.NudgeNozzleScreen.link_nozzles = !link; break;
99
+      case 8: screen_data.NudgeNozzleScreen.link_nozzles = !link; break;
100 100
     #endif
101
-    case  9: screen_data.NudgeNozzleScreen.show_offsets = !screen_data.NudgeNozzleScreen.show_offsets; break;
102
-    default:
103
-      return false;
101
+    case 9: screen_data.NudgeNozzleScreen.show_offsets = !screen_data.NudgeNozzleScreen.show_offsets; break;
102
+    default: return false;
104 103
   }
105 104
   #if EXTRUDERS > 1 || HAS_BED_PROBE
106 105
     SaveSettingsDialogBox::settingsChanged();
@@ -112,9 +111,9 @@ bool NudgeNozzleScreen::onTouchEnd(uint8_t tag) {
112 111
   if (tag == 1) {
113 112
     SaveSettingsDialogBox::promptToSaveSettings();
114 113
     return true;
115
-  } else {
116
-    return BaseNumericAdjustmentScreen::onTouchEnd(tag);
117 114
   }
115
+  else
116
+    return BaseNumericAdjustmentScreen::onTouchEnd(tag);
118 117
 }
119 118
 
120 119
 void NudgeNozzleScreen::onIdle() {

Loading…
Peruuta
Tallenna