Browse Source

Merge pull request #1906 from thinkyhead/some_fixes

Naming and code comments
Scott Lahteine 10 years ago
parent
commit
6b51305c4b

+ 3
- 3
Marlin/Marlin.h View File

247
 
247
 
248
 extern float homing_feedrate[];
248
 extern float homing_feedrate[];
249
 extern bool axis_relative_modes[];
249
 extern bool axis_relative_modes[];
250
-extern int feedmultiply;
250
+extern int feedrate_multiplier;
251
 extern bool volumetric_enabled;
251
 extern bool volumetric_enabled;
252
 extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
252
 extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
253
 extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
253
 extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
309
   extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate;
309
   extern float retract_recover_length, retract_recover_length_swap, retract_recover_feedrate;
310
 #endif
310
 #endif
311
 
311
 
312
-extern millis_t starttime;
313
-extern millis_t stoptime;
312
+extern millis_t print_job_start_ms;
313
+extern millis_t print_job_stop_ms;
314
 
314
 
315
 // Handling multiple extruders pins
315
 // Handling multiple extruders pins
316
 extern uint8_t active_extruder;
316
 extern uint8_t active_extruder;

+ 344
- 281
Marlin/Marlin_main.cpp
File diff suppressed because it is too large
View File


+ 1
- 1
Marlin/configurator/config/language.h View File

110
 
110
 
111
 // Serial Console Messages (do not translate those!)
111
 // Serial Console Messages (do not translate those!)
112
 
112
 
113
-#define MSG_Enqueing                        "enqueing \""
113
+#define MSG_Enqueueing                      "enqueueing \""
114
 #define MSG_POWERUP                         "PowerUp"
114
 #define MSG_POWERUP                         "PowerUp"
115
 #define MSG_EXTERNAL_RESET                  " External Reset"
115
 #define MSG_EXTERNAL_RESET                  " External Reset"
116
 #define MSG_BROWNOUT_RESET                  " Brown out Reset"
116
 #define MSG_BROWNOUT_RESET                  " Brown out Reset"

+ 3
- 3
Marlin/dogm_lcd_implementation.h View File

269
     }
269
     }
270
 
270
 
271
     u8g.setPrintPos(80,48);
271
     u8g.setPrintPos(80,48);
272
-    if (starttime != 0) {
273
-      uint16_t time = (millis() - starttime) / 60000;
272
+    if (print_job_start_ms != 0) {
273
+      uint16_t time = (millis() - print_job_start_ms) / 60000;
274
       lcd_print(itostr2(time/60));
274
       lcd_print(itostr2(time/60));
275
       lcd_print(':');
275
       lcd_print(':');
276
       lcd_print(itostr2(time%60));
276
       lcd_print(itostr2(time%60));
337
   lcd_print(LCD_STR_FEEDRATE[0]);
337
   lcd_print(LCD_STR_FEEDRATE[0]);
338
   lcd_setFont(FONT_STATUSMENU);
338
   lcd_setFont(FONT_STATUSMENU);
339
   u8g.setPrintPos(12,49);
339
   u8g.setPrintPos(12,49);
340
-  lcd_print(itostr3(feedmultiply));
340
+  lcd_print(itostr3(feedrate_multiplier));
341
   lcd_print('%');
341
   lcd_print('%');
342
 
342
 
343
   // Status line
343
   // Status line

+ 1
- 1
Marlin/language.h View File

110
 
110
 
111
 // Serial Console Messages (do not translate those!)
111
 // Serial Console Messages (do not translate those!)
112
 
112
 
113
-#define MSG_Enqueing                        "enqueing \""
113
+#define MSG_Enqueueing                      "enqueueing \""
114
 #define MSG_POWERUP                         "PowerUp"
114
 #define MSG_POWERUP                         "PowerUp"
115
 #define MSG_EXTERNAL_RESET                  " External Reset"
115
 #define MSG_EXTERNAL_RESET                  " External Reset"
116
 #define MSG_BROWNOUT_RESET                  " Brown out Reset"
116
 #define MSG_BROWNOUT_RESET                  " Brown out Reset"

+ 72
- 66
Marlin/temperature.cpp View File

219
   
219
   
220
   SERIAL_ECHOLN(MSG_PID_AUTOTUNE_START);
220
   SERIAL_ECHOLN(MSG_PID_AUTOTUNE_START);
221
 
221
 
222
-  disable_heater(); // switch off all heaters.
222
+  disable_all_heaters(); // switch off all heaters.
223
 
223
 
224
   if (extruder < 0)
224
   if (extruder < 0)
225
     soft_pwm_bed = bias = d = MAX_BED_POWER / 2;
225
     soft_pwm_bed = bias = d = MAX_BED_POWER / 2;
458
 }
458
 }
459
 
459
 
460
 void max_temp_error(uint8_t e) {
460
 void max_temp_error(uint8_t e) {
461
-  disable_heater();
461
+  disable_all_heaters();
462
   _temp_error(e, PSTR(MSG_MAXTEMP_EXTRUDER_OFF), PSTR(MSG_ERR_MAXTEMP));
462
   _temp_error(e, PSTR(MSG_MAXTEMP_EXTRUDER_OFF), PSTR(MSG_ERR_MAXTEMP));
463
 }
463
 }
464
 void min_temp_error(uint8_t e) {
464
 void min_temp_error(uint8_t e) {
465
-  disable_heater();
465
+  disable_all_heaters();
466
   _temp_error(e, PSTR(MSG_MINTEMP_EXTRUDER_OFF), PSTR(MSG_ERR_MINTEMP));
466
   _temp_error(e, PSTR(MSG_MINTEMP_EXTRUDER_OFF), PSTR(MSG_ERR_MINTEMP));
467
 }
467
 }
468
 void bed_max_temp_error(void) {
468
 void bed_max_temp_error(void) {
579
   }
579
   }
580
 #endif
580
 #endif
581
 
581
 
582
+/**
583
+ * Manage heating activities for extruder hot-ends and a heated bed
584
+ *  - Acquire updated temperature readings
585
+ *  - Invoke thermal runaway protection
586
+ *  - Manage extruder auto-fan
587
+ *  - Apply filament width to the extrusion rate (may move)
588
+ *  - Update the heated bed PID output value
589
+ */
582
 void manage_heater() {
590
 void manage_heater() {
583
 
591
 
584
   if (!temp_meas_ready) return;
592
   if (!temp_meas_ready) return;
623
 
631
 
624
     #ifdef TEMP_SENSOR_1_AS_REDUNDANT
632
     #ifdef TEMP_SENSOR_1_AS_REDUNDANT
625
       if (fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) {
633
       if (fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) {
626
-        disable_heater();
634
+        disable_all_heaters();
627
         _temp_error(0, PSTR(MSG_EXTRUDER_SWITCHED_OFF), PSTR(MSG_ERR_REDUNDANT_TEMP));
635
         _temp_error(0, PSTR(MSG_EXTRUDER_SWITCHED_OFF), PSTR(MSG_ERR_REDUNDANT_TEMP));
628
       }
636
       }
629
     #endif // TEMP_SENSOR_1_AS_REDUNDANT
637
     #endif // TEMP_SENSOR_1_AS_REDUNDANT
636
       next_auto_fan_check_ms = ms + 2500;
644
       next_auto_fan_check_ms = ms + 2500;
637
     }
645
     }
638
   #endif       
646
   #endif       
639
-  
647
+
648
+  // Control the extruder rate based on the width sensor
649
+  #ifdef FILAMENT_SENSOR
650
+    if (filament_sensor) {
651
+      meas_shift_index = delay_index1 - meas_delay_cm;
652
+      if (meas_shift_index < 0) meas_shift_index += MAX_MEASUREMENT_DELAY + 1;  //loop around buffer if needed
653
+      
654
+      // Get the delayed info and add 100 to reconstitute to a percent of
655
+      // the nominal filament diameter then square it to get an area
656
+      meas_shift_index = constrain(meas_shift_index, 0, MAX_MEASUREMENT_DELAY);
657
+      float vm = pow((measurement_delay[meas_shift_index] + 100.0) / 100.0, 2);
658
+      if (vm < 0.01) vm = 0.01;
659
+      volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vm;
660
+    }
661
+  #endif //FILAMENT_SENSOR
662
+
640
   #ifndef PIDTEMPBED
663
   #ifndef PIDTEMPBED
641
     if (ms < next_bed_check_ms) return;
664
     if (ms < next_bed_check_ms) return;
642
     next_bed_check_ms = ms + BED_CHECK_INTERVAL;
665
     next_bed_check_ms = ms + BED_CHECK_INTERVAL;
653
 
676
 
654
       soft_pwm_bed = current_temperature_bed > BED_MINTEMP && current_temperature_bed < BED_MAXTEMP ? (int)pid_output >> 1 : 0;
677
       soft_pwm_bed = current_temperature_bed > BED_MINTEMP && current_temperature_bed < BED_MAXTEMP ? (int)pid_output >> 1 : 0;
655
 
678
 
656
-    #elif !defined(BED_LIMIT_SWITCHING)
657
-      // Check if temperature is within the correct range
679
+    #elif defined(BED_LIMIT_SWITCHING)
680
+      // Check if temperature is within the correct band
658
       if (current_temperature_bed > BED_MINTEMP && current_temperature_bed < BED_MAXTEMP) {
681
       if (current_temperature_bed > BED_MINTEMP && current_temperature_bed < BED_MAXTEMP) {
659
-        soft_pwm_bed = current_temperature_bed < target_temperature_bed ? MAX_BED_POWER >> 1 : 0;
682
+        if (current_temperature_bed >= target_temperature_bed + BED_HYSTERESIS)
683
+          soft_pwm_bed = 0;
684
+        else if (current_temperature_bed <= target_temperature_bed - BED_HYSTERESIS)
685
+          soft_pwm_bed = MAX_BED_POWER >> 1;
660
       }
686
       }
661
       else {
687
       else {
662
         soft_pwm_bed = 0;
688
         soft_pwm_bed = 0;
663
         WRITE_HEATER_BED(LOW);
689
         WRITE_HEATER_BED(LOW);
664
       }
690
       }
665
-    #else //#ifdef BED_LIMIT_SWITCHING
666
-      // Check if temperature is within the correct band
691
+    #else // BED_LIMIT_SWITCHING
692
+      // Check if temperature is within the correct range
667
       if (current_temperature_bed > BED_MINTEMP && current_temperature_bed < BED_MAXTEMP) {
693
       if (current_temperature_bed > BED_MINTEMP && current_temperature_bed < BED_MAXTEMP) {
668
-        if (current_temperature_bed >= target_temperature_bed + BED_HYSTERESIS)
669
-          soft_pwm_bed = 0;
670
-        else if (current_temperature_bed <= target_temperature_bed - BED_HYSTERESIS)
671
-          soft_pwm_bed = MAX_BED_POWER >> 1;
694
+        soft_pwm_bed = current_temperature_bed < target_temperature_bed ? MAX_BED_POWER >> 1 : 0;
672
       }
695
       }
673
       else {
696
       else {
674
         soft_pwm_bed = 0;
697
         soft_pwm_bed = 0;
676
       }
699
       }
677
     #endif
700
     #endif
678
   #endif //TEMP_SENSOR_BED != 0
701
   #endif //TEMP_SENSOR_BED != 0
679
-  
680
-  // Control the extruder rate based on the width sensor
681
-  #ifdef FILAMENT_SENSOR
682
-    if (filament_sensor) {
683
-      meas_shift_index = delay_index1 - meas_delay_cm;
684
-      if (meas_shift_index < 0) meas_shift_index += MAX_MEASUREMENT_DELAY + 1;  //loop around buffer if needed
685
-      
686
-      // Get the delayed info and add 100 to reconstitute to a percent of
687
-      // the nominal filament diameter then square it to get an area
688
-      meas_shift_index = constrain(meas_shift_index, 0, MAX_MEASUREMENT_DELAY);
689
-      float vm = pow((measurement_delay[meas_shift_index] + 100.0) / 100.0, 2);
690
-      if (vm < 0.01) vm = 0.01;
691
-      volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM] = vm;
692
-    }
693
-  #endif //FILAMENT_SENSOR
694
 }
702
 }
695
 
703
 
696
 #define PGM_RD_W(x)   (short)pgm_read_word(&x)
704
 #define PGM_RD_W(x)   (short)pgm_read_word(&x)
697
 // Derived from RepRap FiveD extruder::getTemperature()
705
 // Derived from RepRap FiveD extruder::getTemperature()
698
 // For hot end temperature measurement.
706
 // For hot end temperature measurement.
699
 static float analog2temp(int raw, uint8_t e) {
707
 static float analog2temp(int raw, uint8_t e) {
700
-#ifdef TEMP_SENSOR_1_AS_REDUNDANT
701
-  if (e > EXTRUDERS)
702
-#else
703
-  if (e >= EXTRUDERS)
704
-#endif
705
-  {
708
+  #ifdef TEMP_SENSOR_1_AS_REDUNDANT
709
+    if (e > EXTRUDERS)
710
+  #else
711
+    if (e >= EXTRUDERS)
712
+  #endif
713
+    {
706
       SERIAL_ERROR_START;
714
       SERIAL_ERROR_START;
707
       SERIAL_ERROR((int)e);
715
       SERIAL_ERROR((int)e);
708
       SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER_NUM);
716
       SERIAL_ERRORLNPGM(MSG_INVALID_EXTRUDER_NUM);
709
       kill();
717
       kill();
710
       return 0.0;
718
       return 0.0;
711
-  } 
719
+    } 
720
+
712
   #ifdef HEATER_0_USES_MAX6675
721
   #ifdef HEATER_0_USES_MAX6675
713
-    if (e == 0)
714
-    {
715
-      return 0.25 * raw;
716
-    }
722
+    if (e == 0) return 0.25 * raw;
717
   #endif
723
   #endif
718
 
724
 
719
-  if(heater_ttbl_map[e] != NULL)
720
-  {
725
+  if (heater_ttbl_map[e] != NULL) {
721
     float celsius = 0;
726
     float celsius = 0;
722
     uint8_t i;
727
     uint8_t i;
723
     short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]);
728
     short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]);
724
 
729
 
725
-    for (i=1; i<heater_ttbllen_map[e]; i++)
726
-    {
727
-      if (PGM_RD_W((*tt)[i][0]) > raw)
728
-      {
730
+    for (i = 1; i < heater_ttbllen_map[e]; i++) {
731
+      if (PGM_RD_W((*tt)[i][0]) > raw) {
729
         celsius = PGM_RD_W((*tt)[i-1][1]) + 
732
         celsius = PGM_RD_W((*tt)[i-1][1]) + 
730
           (raw - PGM_RD_W((*tt)[i-1][0])) * 
733
           (raw - PGM_RD_W((*tt)[i-1][0])) * 
731
           (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) /
734
           (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) /
749
     float celsius = 0;
752
     float celsius = 0;
750
     byte i;
753
     byte i;
751
 
754
 
752
-    for (i=1; i<BEDTEMPTABLE_LEN; i++)
753
-    {
754
-      if (PGM_RD_W(BEDTEMPTABLE[i][0]) > raw)
755
-      {
755
+    for (i = 1; i < BEDTEMPTABLE_LEN; i++) {
756
+      if (PGM_RD_W(BEDTEMPTABLE[i][0]) > raw) {
756
         celsius  = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 
757
         celsius  = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 
757
           (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 
758
           (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 
758
           (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) /
759
           (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) /
816
 #endif
817
 #endif
817
 
818
 
818
 
819
 
819
-
820
-
821
-
822
-void tp_init()
823
-{
820
+/**
821
+ * Initialize the temperature manager
822
+ * The manager is implemented by periodic calls to manage_heater()
823
+ */
824
+void tp_init() {
824
   #if MB(RUMBA) && ((TEMP_SENSOR_0==-1)||(TEMP_SENSOR_1==-1)||(TEMP_SENSOR_2==-1)||(TEMP_SENSOR_BED==-1))
825
   #if MB(RUMBA) && ((TEMP_SENSOR_0==-1)||(TEMP_SENSOR_1==-1)||(TEMP_SENSOR_2==-1)||(TEMP_SENSOR_BED==-1))
825
     //disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector
826
     //disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector
826
     MCUCR=BIT(JTD);
827
     MCUCR=BIT(JTD);
1059
         SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP);
1060
         SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP);
1060
         if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id);
1061
         if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id);
1061
         LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY);
1062
         LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY);
1062
-        disable_heater();
1063
+        disable_all_heaters();
1063
         disable_all_steppers();
1064
         disable_all_steppers();
1064
         for (;;) {
1065
         for (;;) {
1065
           manage_heater();
1066
           manage_heater();
1070
 
1071
 
1071
 #endif // HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
1072
 #endif // HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
1072
 
1073
 
1073
-void disable_heater() {
1074
+void disable_all_heaters() {
1074
   for (int i=0; i<EXTRUDERS; i++) setTargetHotend(0, i);
1075
   for (int i=0; i<EXTRUDERS; i++) setTargetHotend(0, i);
1075
   setTargetBed(0);
1076
   setTargetBed(0);
1076
 
1077
 
1208
   temp_meas_ready = true;
1209
   temp_meas_ready = true;
1209
 }
1210
 }
1210
 
1211
 
1211
-//
1212
-// Timer 0 is shared with millies
1213
-//
1212
+/**
1213
+ * Timer 0 is shared with millies
1214
+ *  - Manage PWM to all the heaters and fan
1215
+ *  - Update the raw temperature values
1216
+ *  - Check new temperature values for MIN/MAX errors
1217
+ *  - Step the babysteps value for each axis towards 0
1218
+ */
1214
 ISR(TIMER0_COMPB_vect) {
1219
 ISR(TIMER0_COMPB_vect) {
1215
-  //these variables are only accesible from the ISR, but static, so they don't lose their value
1220
+
1216
   static unsigned char temp_count = 0;
1221
   static unsigned char temp_count = 0;
1217
   static TempState temp_state = StartupDelay;
1222
   static TempState temp_state = StartupDelay;
1218
   static unsigned char pwm_count = BIT(SOFT_PWM_SCALE);
1223
   static unsigned char pwm_count = BIT(SOFT_PWM_SCALE);
1414
     #define START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin)
1419
     #define START_ADC(pin) ADCSRB = 0; SET_ADMUX_ADCSRA(pin)
1415
   #endif
1420
   #endif
1416
 
1421
 
1422
+  // Prepare or measure a sensor, each one every 12th frame
1417
   switch(temp_state) {
1423
   switch(temp_state) {
1418
     case PrepareTemp_0:
1424
     case PrepareTemp_0:
1419
       #if HAS_TEMP_0
1425
       #if HAS_TEMP_0
1582
   } // temp_count >= OVERSAMPLENR
1588
   } // temp_count >= OVERSAMPLENR
1583
 
1589
 
1584
   #ifdef BABYSTEPPING
1590
   #ifdef BABYSTEPPING
1585
-    for (uint8_t axis=X_AXIS; axis<=Z_AXIS; axis++) {
1586
-      int curTodo=babystepsTodo[axis]; //get rid of volatile for performance
1591
+    for (uint8_t axis = X_AXIS; axis <= Z_AXIS; axis++) {
1592
+      int curTodo = babystepsTodo[axis]; //get rid of volatile for performance
1587
      
1593
      
1588
       if (curTodo > 0) {
1594
       if (curTodo > 0) {
1589
         babystep(axis,/*fwd*/true);
1595
         babystep(axis,/*fwd*/true);
1590
-        babystepsTodo[axis]--; //less to do next time
1596
+        babystepsTodo[axis]--; //fewer to do next time
1591
       }
1597
       }
1592
-      else if(curTodo < 0) {
1598
+      else if (curTodo < 0) {
1593
         babystep(axis,/*fwd*/false);
1599
         babystep(axis,/*fwd*/false);
1594
-        babystepsTodo[axis]++; //less to do next time
1600
+        babystepsTodo[axis]++; //fewer to do next time
1595
       }
1601
       }
1596
     }
1602
     }
1597
   #endif //BABYSTEPPING
1603
   #endif //BABYSTEPPING

+ 1
- 1
Marlin/temperature.h View File

129
 #endif
129
 #endif
130
 
130
 
131
 int getHeaterPower(int heater);
131
 int getHeaterPower(int heater);
132
-void disable_heater();
132
+void disable_all_heaters();
133
 void setWatch();
133
 void setWatch();
134
 void updatePID();
134
 void updatePID();
135
 
135
 

+ 13
- 13
Marlin/ultralcd.cpp View File

152
    *     lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause)
152
    *     lcd_implementation_drawmenu_function(sel, row, PSTR(MSG_PAUSE_PRINT), lcd_sdcard_pause)
153
    *     menu_action_function(lcd_sdcard_pause)
153
    *     menu_action_function(lcd_sdcard_pause)
154
    *
154
    *
155
-   *   MENU_ITEM_EDIT(int3, MSG_SPEED, &feedmultiply, 10, 999)
156
-   *   MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedmultiply, 10, 999)
157
-   *     lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedmultiply, 10, 999)
158
-   *     menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedmultiply, 10, 999)
155
+   *   MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999)
156
+   *   MENU_ITEM(setting_edit_int3, MSG_SPEED, PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
157
+   *     lcd_implementation_drawmenu_setting_edit_int3(sel, row, PSTR(MSG_SPEED), PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
158
+   *     menu_action_setting_edit_int3(PSTR(MSG_SPEED), &feedrate_multiplier, 10, 999)
159
    *
159
    *
160
    */
160
    */
161
   #define MENU_ITEM(type, label, args...) do { \
161
   #define MENU_ITEM(type, label, args...) do { \
328
 
328
 
329
     #ifdef ULTIPANEL_FEEDMULTIPLY
329
     #ifdef ULTIPANEL_FEEDMULTIPLY
330
       // Dead zone at 100% feedrate
330
       // Dead zone at 100% feedrate
331
-      if ((feedmultiply < 100 && (feedmultiply + int(encoderPosition)) > 100) ||
332
-              (feedmultiply > 100 && (feedmultiply + int(encoderPosition)) < 100)) {
331
+      if ((feedrate_multiplier < 100 && (feedrate_multiplier + int(encoderPosition)) > 100) ||
332
+              (feedrate_multiplier > 100 && (feedrate_multiplier + int(encoderPosition)) < 100)) {
333
         encoderPosition = 0;
333
         encoderPosition = 0;
334
-        feedmultiply = 100;
334
+        feedrate_multiplier = 100;
335
       }
335
       }
336
-      if (feedmultiply == 100) {
336
+      if (feedrate_multiplier == 100) {
337
         if (int(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) {
337
         if (int(encoderPosition) > ENCODER_FEEDRATE_DEADZONE) {
338
-          feedmultiply += int(encoderPosition) - ENCODER_FEEDRATE_DEADZONE;
338
+          feedrate_multiplier += int(encoderPosition) - ENCODER_FEEDRATE_DEADZONE;
339
           encoderPosition = 0;
339
           encoderPosition = 0;
340
         }
340
         }
341
         else if (int(encoderPosition) < -ENCODER_FEEDRATE_DEADZONE) {
341
         else if (int(encoderPosition) < -ENCODER_FEEDRATE_DEADZONE) {
342
-          feedmultiply += int(encoderPosition) + ENCODER_FEEDRATE_DEADZONE;
342
+          feedrate_multiplier += int(encoderPosition) + ENCODER_FEEDRATE_DEADZONE;
343
           encoderPosition = 0;
343
           encoderPosition = 0;
344
         }
344
         }
345
       }
345
       }
346
       else {
346
       else {
347
-        feedmultiply += int(encoderPosition);
347
+        feedrate_multiplier += int(encoderPosition);
348
         encoderPosition = 0;
348
         encoderPosition = 0;
349
       }
349
       }
350
     #endif // ULTIPANEL_FEEDMULTIPLY
350
     #endif // ULTIPANEL_FEEDMULTIPLY
351
 
351
 
352
-    feedmultiply = constrain(feedmultiply, 10, 999);
352
+    feedrate_multiplier = constrain(feedrate_multiplier, 10, 999);
353
 
353
 
354
   #endif //ULTIPANEL
354
   #endif //ULTIPANEL
355
 }
355
 }
456
 static void lcd_tune_menu() {
456
 static void lcd_tune_menu() {
457
   START_MENU();
457
   START_MENU();
458
   MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
458
   MENU_ITEM(back, MSG_MAIN, lcd_main_menu);
459
-  MENU_ITEM_EDIT(int3, MSG_SPEED, &feedmultiply, 10, 999);
459
+  MENU_ITEM_EDIT(int3, MSG_SPEED, &feedrate_multiplier, 10, 999);
460
   #if TEMP_SENSOR_0 != 0
460
   #if TEMP_SENSOR_0 != 0
461
     MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
461
     MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
462
   #endif
462
   #endif

+ 3
- 3
Marlin/ultralcd_implementation_hitachi_HD44780.h View File

550
 
550
 
551
     lcd.setCursor(0, 2);
551
     lcd.setCursor(0, 2);
552
     lcd.print(LCD_STR_FEEDRATE[0]);
552
     lcd.print(LCD_STR_FEEDRATE[0]);
553
-    lcd.print(itostr3(feedmultiply));
553
+    lcd.print(itostr3(feedrate_multiplier));
554
     lcd.print('%');
554
     lcd.print('%');
555
 
555
 
556
     #if LCD_WIDTH > 19 && defined(SDSUPPORT)
556
     #if LCD_WIDTH > 19 && defined(SDSUPPORT)
567
 
567
 
568
     lcd.setCursor(LCD_WIDTH - 6, 2);
568
     lcd.setCursor(LCD_WIDTH - 6, 2);
569
     lcd.print(LCD_STR_CLOCK[0]);
569
     lcd.print(LCD_STR_CLOCK[0]);
570
-    if (starttime != 0) {
571
-      uint16_t time = millis()/60000 - starttime/60000;
570
+    if (print_job_start_ms != 0) {
571
+      uint16_t time = millis()/60000 - print_job_start_ms/60000;
572
       lcd.print(itostr2(time/60));
572
       lcd.print(itostr2(time/60));
573
       lcd.print(':');
573
       lcd.print(':');
574
       lcd.print(itostr2(time%60));
574
       lcd.print(itostr2(time%60));

Loading…
Cancel
Save