Просмотр исходного кода

Apply SEC_TO_MS and other fixes

Scott Lahteine 4 лет назад
Родитель
Сommit
b8186b5081

+ 1
- 0
Marlin/src/MarlinCore.cpp Просмотреть файл

783
  */
783
  */
784
 void stop() {
784
 void stop() {
785
   thermalManager.disable_all_heaters(); // 'unpause' taken care of in here
785
   thermalManager.disable_all_heaters(); // 'unpause' taken care of in here
786
+
786
   print_job_timer.stop();
787
   print_job_timer.stop();
787
 
788
 
788
   #if ENABLED(PROBING_FANS_OFF)
789
   #if ENABLED(PROBING_FANS_OFF)

+ 1
- 0
Marlin/src/core/macros.h Просмотреть файл

162
 #define _DO_12(W,C,A,V...) (_##W##_1(A) C _DO_11(W,C,V))
162
 #define _DO_12(W,C,A,V...) (_##W##_1(A) C _DO_11(W,C,V))
163
 #define _DO_13(W,C,A,V...) (_##W##_1(A) C _DO_12(W,C,V))
163
 #define _DO_13(W,C,A,V...) (_##W##_1(A) C _DO_12(W,C,V))
164
 #define _DO_14(W,C,A,V...) (_##W##_1(A) C _DO_13(W,C,V))
164
 #define _DO_14(W,C,A,V...) (_##W##_1(A) C _DO_13(W,C,V))
165
+#define _DO_15(W,C,A,V...) (_##W##_1(A) C _DO_14(W,C,V))
165
 #define __DO_N(W,C,N,V...) _DO_##N(W,C,V)
166
 #define __DO_N(W,C,N,V...) _DO_##N(W,C,V)
166
 #define _DO_N(W,C,N,V...)  __DO_N(W,C,N,V)
167
 #define _DO_N(W,C,N,V...)  __DO_N(W,C,N,V)
167
 #define DO(W,C,V...)       (_DO_N(W,C,NUM_ARGS(V),V))
168
 #define DO(W,C,V...)       (_DO_N(W,C,NUM_ARGS(V),V))

+ 2
- 1
Marlin/src/gcode/control/M80_M81.cpp Просмотреть файл

89
  */
89
  */
90
 void GcodeSuite::M81() {
90
 void GcodeSuite::M81() {
91
   thermalManager.disable_all_heaters();
91
   thermalManager.disable_all_heaters();
92
-  print_job_timer.stop();
93
   planner.finish_and_disable();
92
   planner.finish_and_disable();
94
 
93
 
94
+  print_job_timer.stop();
95
+
95
   #if HAS_FAN
96
   #if HAS_FAN
96
     thermalManager.zero_fan_speeds();
97
     thermalManager.zero_fan_speeds();
97
     #if ENABLED(PROBING_FANS_OFF)
98
     #if ENABLED(PROBING_FANS_OFF)

+ 1
- 1
Marlin/src/gcode/feature/L6470/M916-918.cpp Просмотреть файл

119
     M91x_counter_max = 256;  // KVAL_HOLD is 8 bits
119
     M91x_counter_max = 256;  // KVAL_HOLD is 8 bits
120
 
120
 
121
   uint8_t M91x_delay_s = parser.byteval('D');   // get delay in seconds
121
   uint8_t M91x_delay_s = parser.byteval('D');   // get delay in seconds
122
-  millis_t M91x_delay_ms = M91x_delay_s * 60 * 1000;
122
+  millis_t M91x_delay_ms = SEC_TO_MS(M91x_delay_s * 60);
123
   millis_t M91x_delay_end;
123
   millis_t M91x_delay_end;
124
 
124
 
125
   DEBUG_ECHOLNPGM(".\n.");
125
   DEBUG_ECHOLNPGM(".\n.");

+ 1
- 1
Marlin/src/gcode/parser.h Просмотреть файл

282
 
282
 
283
   // Code value for use as time
283
   // Code value for use as time
284
   static inline millis_t value_millis() { return value_ulong(); }
284
   static inline millis_t value_millis() { return value_ulong(); }
285
-  static inline millis_t value_millis_from_seconds() { return (millis_t)(value_float() * 1000); }
285
+  static inline millis_t value_millis_from_seconds() { return (millis_t)SEC_TO_MS(value_float()); }
286
 
286
 
287
   // Reduce to fewer bits
287
   // Reduce to fewer bits
288
   static inline int16_t value_int() { return (int16_t)value_long(); }
288
   static inline int16_t value_int() { return (int16_t)value_long(); }

+ 4
- 3
Marlin/src/module/printcounter.cpp Просмотреть файл

224
 
224
 
225
   millis_t now = millis();
225
   millis_t now = millis();
226
 
226
 
227
-  static uint32_t update_next; // = 0
227
+  static millis_t update_next; // = 0
228
   if (ELAPSED(now, update_next)) {
228
   if (ELAPSED(now, update_next)) {
229
+    update_next = now + updateInterval;
230
+
229
     TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("tick")));
231
     TERN_(DEBUG_PRINTCOUNTER, debug(PSTR("tick")));
232
+
230
     millis_t delta = deltaDuration();
233
     millis_t delta = deltaDuration();
231
     data.printTime += delta;
234
     data.printTime += delta;
232
 
235
 
239
     #if SERVICE_INTERVAL_3 > 0
242
     #if SERVICE_INTERVAL_3 > 0
240
       data.nextService3 -= _MIN(delta, data.nextService3);
243
       data.nextService3 -= _MIN(delta, data.nextService3);
241
     #endif
244
     #endif
242
-
243
-    update_next = now + updateInterval * 1000;
244
   }
245
   }
245
 
246
 
246
   static uint32_t eeprom_next; // = 0
247
   static uint32_t eeprom_next; // = 0

+ 1
- 4
Marlin/src/module/printcounter.h Просмотреть файл

71
      * @brief Interval in seconds between counter updates
71
      * @brief Interval in seconds between counter updates
72
      * @details This const value defines what will be the time between each
72
      * @details This const value defines what will be the time between each
73
      * accumulator update. This is different from the EEPROM save interval.
73
      * accumulator update. This is different from the EEPROM save interval.
74
-     *
75
-     * @note The max value for this option is 60(s), otherwise integer
76
-     * overflow will happen.
77
      */
74
      */
78
-    static constexpr uint16_t updateInterval = 10;
75
+    static constexpr millis_t updateInterval = SEC_TO_MS(10);
79
 
76
 
80
     /**
77
     /**
81
      * @brief Interval in seconds between EEPROM saves
78
      * @brief Interval in seconds between EEPROM saves

+ 0
- 1
Marlin/src/module/temperature.cpp Просмотреть файл

2186
 
2186
 
2187
 #endif
2187
 #endif
2188
 
2188
 
2189
-
2190
 #if ENABLED(PROBING_HEATERS_OFF)
2189
 #if ENABLED(PROBING_HEATERS_OFF)
2191
 
2190
 
2192
   void Temperature::pause(const bool p) {
2191
   void Temperature::pause(const bool p) {

+ 2
- 2
Marlin/src/module/tool_change.cpp Просмотреть файл

828
       // Cool down with fan
828
       // Cool down with fan
829
       #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0
829
       #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0
830
         thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed;
830
         thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed;
831
-        gcode.dwell(toolchange_settings.fan_time * 1000);
831
+        gcode.dwell(SEC_TO_MS(toolchange_settings.fan_time));
832
         thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0;
832
         thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0;
833
       #endif
833
       #endif
834
 
834
 
1102
             // Cool down with fan
1102
             // Cool down with fan
1103
             #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0
1103
             #if HAS_FAN && TOOLCHANGE_FS_FAN >= 0
1104
               thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed;
1104
               thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = toolchange_settings.fan_speed;
1105
-              gcode.dwell(toolchange_settings.fan_time * 1000);
1105
+              gcode.dwell(SEC_TO_MS(toolchange_settings.fan_time));
1106
               thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0;
1106
               thermalManager.fan_speed[TOOLCHANGE_FS_FAN] = 0;
1107
             #endif
1107
             #endif
1108
           }
1108
           }

+ 1
- 1
Marlin/src/pins/lpc1768/pins_MKS_SBASE.h Просмотреть файл

27
 
27
 
28
 #if defined(MKS_HAS_LPC1769) && NOT_TARGET(MCU_LPC1769)
28
 #if defined(MKS_HAS_LPC1769) && NOT_TARGET(MCU_LPC1769)
29
   #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
29
   #error "Oops! Make sure you have the LPC1769 environment selected in your IDE."
30
-#elif NOT_TARGET(MKS_HAS_LPC1769, MCU_LPC1768)
30
+#elif !defined(MKS_HAS_LPC1769) && NOT_TARGET(MCU_LPC1768)
31
   #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
31
   #error "Oops! Make sure you have the LPC1768 environment selected in your IDE."
32
 #endif
32
 #endif
33
 
33
 

Загрузка…
Отмена
Сохранить