|
@@ -399,7 +399,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
399
|
399
|
const uint16_t watch_temp_period = GTV(WATCH_BED_TEMP_PERIOD, WATCH_TEMP_PERIOD);
|
400
|
400
|
const uint8_t watch_temp_increase = GTV(WATCH_BED_TEMP_INCREASE, WATCH_TEMP_INCREASE);
|
401
|
401
|
const float watch_temp_target = target - float(watch_temp_increase + GTV(TEMP_BED_HYSTERESIS, TEMP_HYSTERESIS) + 1);
|
402
|
|
- millis_t temp_change_ms = next_temp_ms + watch_temp_period * 1000UL;
|
|
402
|
+ millis_t temp_change_ms = next_temp_ms + SEC_TO_MS(watch_temp_period);
|
403
|
403
|
float next_watch_temp = 0.0;
|
404
|
404
|
bool heated = false;
|
405
|
405
|
#endif
|
|
@@ -546,7 +546,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
546
|
546
|
if (!heated) { // If not yet reached target...
|
547
|
547
|
if (current_temp > next_watch_temp) { // Over the watch temp?
|
548
|
548
|
next_watch_temp = current_temp + watch_temp_increase; // - set the next temp to watch for
|
549
|
|
- temp_change_ms = ms + watch_temp_period * 1000UL; // - move the expiration timer up
|
|
549
|
+ temp_change_ms = ms + SEC_TO_MS(watch_temp_period); // - move the expiration timer up
|
550
|
550
|
if (current_temp > watch_temp_target) heated = true; // - Flag if target temperature reached
|
551
|
551
|
}
|
552
|
552
|
else if (ELAPSED(ms, temp_change_ms)) // Watch timer expired
|
|
@@ -2051,7 +2051,7 @@ void Temperature::init() {
|
2051
|
2051
|
#endif
|
2052
|
2052
|
|
2053
|
2053
|
if (current >= tr_target_temperature[heater_index] - hysteresis_degc) {
|
2054
|
|
- sm.timer = millis() + period_seconds * 1000UL;
|
|
2054
|
+ sm.timer = millis() + SEC_TO_MS(period_seconds);
|
2055
|
2055
|
break;
|
2056
|
2056
|
}
|
2057
|
2057
|
else if (PENDING(millis(), sm.timer)) break;
|
|
@@ -3124,7 +3124,7 @@ void Temperature::tick() {
|
3124
|
3124
|
millis_t residency_start_ms = 0;
|
3125
|
3125
|
bool first_loop = true;
|
3126
|
3126
|
// Loop until the temperature has stabilized
|
3127
|
|
- #define TEMP_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_RESIDENCY_TIME) * 1000UL))
|
|
3127
|
+ #define TEMP_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + SEC_TO_MS(TEMP_RESIDENCY_TIME)))
|
3128
|
3128
|
#else
|
3129
|
3129
|
// Loop until the temperature is very close target
|
3130
|
3130
|
#define TEMP_CONDITIONS (wants_to_cool ? isCoolingHotend(target_extruder) : isHeatingHotend(target_extruder))
|
|
@@ -3160,7 +3160,7 @@ void Temperature::tick() {
|
3160
|
3160
|
#if TEMP_RESIDENCY_TIME > 0
|
3161
|
3161
|
SERIAL_ECHOPGM(" W:");
|
3162
|
3162
|
if (residency_start_ms)
|
3163
|
|
- SERIAL_ECHO(long((((TEMP_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL));
|
|
3163
|
+ SERIAL_ECHO(long((SEC_TO_MS(TEMP_RESIDENCY_TIME) - (now - residency_start_ms)) / 1000UL));
|
3164
|
3164
|
else
|
3165
|
3165
|
SERIAL_CHAR('?');
|
3166
|
3166
|
#endif
|
|
@@ -3185,7 +3185,7 @@ void Temperature::tick() {
|
3185
|
3185
|
// Start the TEMP_RESIDENCY_TIME timer when we reach target temp for the first time.
|
3186
|
3186
|
if (temp_diff < TEMP_WINDOW) {
|
3187
|
3187
|
residency_start_ms = now;
|
3188
|
|
- if (first_loop) residency_start_ms += (TEMP_RESIDENCY_TIME) * 1000UL;
|
|
3188
|
+ if (first_loop) residency_start_ms += SEC_TO_MS(TEMP_RESIDENCY_TIME);
|
3189
|
3189
|
}
|
3190
|
3190
|
}
|
3191
|
3191
|
else if (temp_diff > TEMP_HYSTERESIS) {
|
|
@@ -3247,7 +3247,7 @@ void Temperature::tick() {
|
3247
|
3247
|
millis_t residency_start_ms = 0;
|
3248
|
3248
|
bool first_loop = true;
|
3249
|
3249
|
// Loop until the temperature has stabilized
|
3250
|
|
- #define TEMP_BED_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_BED_RESIDENCY_TIME) * 1000UL))
|
|
3250
|
+ #define TEMP_BED_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + SEC_TO_MS(TEMP_BED_RESIDENCY_TIME)))
|
3251
|
3251
|
#else
|
3252
|
3252
|
// Loop until the temperature is very close target
|
3253
|
3253
|
#define TEMP_BED_CONDITIONS (wants_to_cool ? isCoolingBed() : isHeatingBed())
|
|
@@ -3284,7 +3284,7 @@ void Temperature::tick() {
|
3284
|
3284
|
#if TEMP_BED_RESIDENCY_TIME > 0
|
3285
|
3285
|
SERIAL_ECHOPGM(" W:");
|
3286
|
3286
|
if (residency_start_ms)
|
3287
|
|
- SERIAL_ECHO(long((((TEMP_BED_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL));
|
|
3287
|
+ SERIAL_ECHO(long((SEC_TO_MS(TEMP_BED_RESIDENCY_TIME) - (now - residency_start_ms)) / 1000UL));
|
3288
|
3288
|
else
|
3289
|
3289
|
SERIAL_CHAR('?');
|
3290
|
3290
|
#endif
|
|
@@ -3309,7 +3309,7 @@ void Temperature::tick() {
|
3309
|
3309
|
// Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time.
|
3310
|
3310
|
if (temp_diff < TEMP_BED_WINDOW) {
|
3311
|
3311
|
residency_start_ms = now;
|
3312
|
|
- if (first_loop) residency_start_ms += (TEMP_BED_RESIDENCY_TIME) * 1000UL;
|
|
3312
|
+ if (first_loop) residency_start_ms += SEC_TO_MS(TEMP_BED_RESIDENCY_TIME);
|
3313
|
3313
|
}
|
3314
|
3314
|
}
|
3315
|
3315
|
else if (temp_diff > TEMP_BED_HYSTERESIS) {
|
|
@@ -3373,7 +3373,7 @@ void Temperature::tick() {
|
3373
|
3373
|
millis_t residency_start_ms = 0;
|
3374
|
3374
|
bool first_loop = true;
|
3375
|
3375
|
// Loop until the temperature has stabilized
|
3376
|
|
- #define TEMP_CHAMBER_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_CHAMBER_RESIDENCY_TIME) * 1000UL))
|
|
3376
|
+ #define TEMP_CHAMBER_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + SEC_TO_MS(TEMP_CHAMBER_RESIDENCY_TIME)))
|
3377
|
3377
|
#else
|
3378
|
3378
|
// Loop until the temperature is very close target
|
3379
|
3379
|
#define TEMP_CHAMBER_CONDITIONS (wants_to_cool ? isCoolingChamber() : isHeatingChamber())
|
|
@@ -3405,7 +3405,7 @@ void Temperature::tick() {
|
3405
|
3405
|
#if TEMP_CHAMBER_RESIDENCY_TIME > 0
|
3406
|
3406
|
SERIAL_ECHOPGM(" W:");
|
3407
|
3407
|
if (residency_start_ms)
|
3408
|
|
- SERIAL_ECHO(long((((TEMP_CHAMBER_RESIDENCY_TIME) * 1000UL) - (now - residency_start_ms)) / 1000UL));
|
|
3408
|
+ SERIAL_ECHO(long((SEC_TO_MS(TEMP_CHAMBER_RESIDENCY_TIME) - (now - residency_start_ms)) / 1000UL));
|
3409
|
3409
|
else
|
3410
|
3410
|
SERIAL_CHAR('?');
|
3411
|
3411
|
#endif
|
|
@@ -3425,7 +3425,7 @@ void Temperature::tick() {
|
3425
|
3425
|
// Start the TEMP_CHAMBER_RESIDENCY_TIME timer when we reach target temp for the first time.
|
3426
|
3426
|
if (temp_diff < TEMP_CHAMBER_WINDOW) {
|
3427
|
3427
|
residency_start_ms = now;
|
3428
|
|
- if (first_loop) residency_start_ms += (TEMP_CHAMBER_RESIDENCY_TIME) * 1000UL;
|
|
3428
|
+ if (first_loop) residency_start_ms += SEC_TO_MS(TEMP_CHAMBER_RESIDENCY_TIME);
|
3429
|
3429
|
}
|
3430
|
3430
|
}
|
3431
|
3431
|
else if (temp_diff > TEMP_CHAMBER_HYSTERESIS) {
|