Browse Source

Merge pull request #1472 from thinkyhead/issue_1471_fix

Fan speed and 4th extruder on graphical LCD
Scott Lahteine 9 years ago
parent
commit
c093ea36e6
1 changed files with 12 additions and 13 deletions
  1. 12
    13
      Marlin/dogm_lcd_implementation.h

+ 12
- 13
Marlin/dogm_lcd_implementation.h View File

199
 
199
 
200
     u8g.setPrintPos(80,47);
200
     u8g.setPrintPos(80,47);
201
     if (starttime != 0) {
201
     if (starttime != 0) {
202
-      uint16_t time = millis()/60000 - starttime/60000;
202
+      uint16_t time = (millis() - starttime) / 60000;
203
       u8g.print(itostr2(time/60));
203
       u8g.print(itostr2(time/60));
204
       u8g.print(':');
204
       u8g.print(':');
205
       u8g.print(itostr2(time%60));
205
       u8g.print(itostr2(time%60));
210
   #endif
210
   #endif
211
  
211
  
212
   // Extruders
212
   // Extruders
213
-  _draw_heater_status(6, 0);
214
-  #if EXTRUDERS > 1
215
-    _draw_heater_status(31, 1);
216
-    #if EXTRUDERS > 2
217
-      _draw_heater_status(55, 2);
218
-    #endif
219
-  #endif
213
+  for (int i=0; i<EXTRUDERS; i++) _draw_heater_status(6 + i * 25, i);
220
 
214
 
221
   // Heatbed
215
   // Heatbed
222
-  _draw_heater_status(81, -1);
216
+  if (EXTRUDERS < 4) _draw_heater_status(81, -1);
223
  
217
  
224
   // Fan
218
   // Fan
225
   u8g.setFont(FONT_STATUSMENU);
219
   u8g.setFont(FONT_STATUSMENU);
226
   u8g.setPrintPos(104,27);
220
   u8g.setPrintPos(104,27);
227
   #if defined(FAN_PIN) && FAN_PIN > -1
221
   #if defined(FAN_PIN) && FAN_PIN > -1
228
-    u8g.print(itostr3(int((fanSpeed*100)/256 + 1)));
229
-    u8g.print("%");
230
-  #else
231
-    u8g.print("---");
222
+    int per = ((fanSpeed + 1) * 100) / 256;
223
+    if (per) {
224
+      u8g.print(itostr3(per));
225
+      u8g.print("%");
226
+    }
227
+    else
232
   #endif
228
   #endif
229
+    {
230
+      u8g.print("---");
231
+    }
233
 
232
 
234
   // X, Y, Z-Coordinates
233
   // X, Y, Z-Coordinates
235
   u8g.setFont(FONT_STATUSMENU);
234
   u8g.setFont(FONT_STATUSMENU);

Loading…
Cancel
Save