|
@@ -440,7 +440,7 @@ float soft_endstop_min[XYZ] = { X_MIN_POS, Y_MIN_POS, Z_MIN_POS },
|
440
|
440
|
soft_endstop_max[XYZ] = { X_MAX_POS, Y_MAX_POS, Z_MAX_POS };
|
441
|
441
|
|
442
|
442
|
#if FAN_COUNT > 0
|
443
|
|
- int fanSpeeds[FAN_COUNT] = { 0 };
|
|
443
|
+ int16_t fanSpeeds[FAN_COUNT] = { 0 };
|
444
|
444
|
#endif
|
445
|
445
|
|
446
|
446
|
// The active extruder (tool). Set with T<extruder> command.
|
|
@@ -1297,20 +1297,19 @@ inline bool code_value_bool() { return !code_has_value() || code_value_byte() >
|
1297
|
1297
|
#if ENABLED(TEMPERATURE_UNITS_SUPPORT)
|
1298
|
1298
|
inline void set_input_temp_units(TempUnit units) { input_temp_units = units; }
|
1299
|
1299
|
|
1300
|
|
- float code_value_temp_abs() {
|
|
1300
|
+ int16_t code_value_temp_abs() {
|
1301
|
1301
|
switch (input_temp_units) {
|
1302
|
|
- case TEMPUNIT_C:
|
1303
|
|
- return code_value_float();
|
1304
|
1302
|
case TEMPUNIT_F:
|
1305
|
1303
|
return (code_value_float() - 32) * 0.5555555556;
|
1306
|
1304
|
case TEMPUNIT_K:
|
1307
|
1305
|
return code_value_float() - 273.15;
|
|
1306
|
+ case TEMPUNIT_C:
|
1308
|
1307
|
default:
|
1309
|
|
- return code_value_float();
|
|
1308
|
+ return code_value_int();
|
1310
|
1309
|
}
|
1311
|
1310
|
}
|
1312
|
1311
|
|
1313
|
|
- float code_value_temp_diff() {
|
|
1312
|
+ int16_t code_value_temp_diff() {
|
1314
|
1313
|
switch (input_temp_units) {
|
1315
|
1314
|
case TEMPUNIT_C:
|
1316
|
1315
|
case TEMPUNIT_K:
|
|
@@ -1322,8 +1321,8 @@ inline bool code_value_bool() { return !code_has_value() || code_value_byte() >
|
1322
|
1321
|
}
|
1323
|
1322
|
}
|
1324
|
1323
|
#else
|
1325
|
|
- float code_value_temp_abs() { return code_value_float(); }
|
1326
|
|
- float code_value_temp_diff() { return code_value_float(); }
|
|
1324
|
+ int16_t code_value_temp_abs() { return code_value_int(); }
|
|
1325
|
+ int16_t code_value_temp_diff() { return code_value_int(); }
|
1327
|
1326
|
#endif
|
1328
|
1327
|
|
1329
|
1328
|
FORCE_INLINE millis_t code_value_millis() { return code_value_ulong(); }
|
|
@@ -1384,7 +1383,7 @@ bool get_target_extruder_from_command(int code) {
|
1384
|
1383
|
static float raised_parked_position[XYZE]; // used in mode 1
|
1385
|
1384
|
static millis_t delayed_move_time = 0; // used in mode 1
|
1386
|
1385
|
static float duplicate_extruder_x_offset = DEFAULT_DUPLICATION_X_OFFSET; // used in mode 2
|
1387
|
|
- static float duplicate_extruder_temp_offset = 0; // used in mode 2
|
|
1386
|
+ static int16_t duplicate_extruder_temp_offset = 0; // used in mode 2
|
1388
|
1387
|
|
1389
|
1388
|
#endif // DUAL_X_CARRIAGE
|
1390
|
1389
|
|
|
@@ -2073,10 +2072,10 @@ static void clean_up_after_endstop_or_probe_move() {
|
2073
|
2072
|
void set_heaters_for_bltouch(const bool deploy) {
|
2074
|
2073
|
static bool heaters_were_disabled = false;
|
2075
|
2074
|
static millis_t next_emi_protection = 0;
|
2076
|
|
- static float temps_at_entry[HOTENDS];
|
|
2075
|
+ static int16_t temps_at_entry[HOTENDS];
|
2077
|
2076
|
|
2078
|
2077
|
#if HAS_TEMP_BED
|
2079
|
|
- static float bed_temp_at_entry;
|
|
2078
|
+ static int16_t bed_temp_at_entry;
|
2080
|
2079
|
#endif
|
2081
|
2080
|
|
2082
|
2081
|
// If called out of order or far apart something is seriously wrong
|
|
@@ -6471,10 +6470,11 @@ inline void gcode_M104() {
|
6471
|
6470
|
#endif
|
6472
|
6471
|
|
6473
|
6472
|
if (code_seen('S')) {
|
6474
|
|
- thermalManager.setTargetHotend(code_value_temp_abs(), target_extruder);
|
|
6473
|
+ const int16_t temp = code_value_temp_abs();
|
|
6474
|
+ thermalManager.setTargetHotend(temp, target_extruder);
|
6475
|
6475
|
#if ENABLED(DUAL_X_CARRIAGE)
|
6476
|
6476
|
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
|
6477
|
|
- thermalManager.setTargetHotend(code_value_temp_abs() == 0.0 ? 0.0 : code_value_temp_abs() + duplicate_extruder_temp_offset, 1);
|
|
6477
|
+ thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1);
|
6478
|
6478
|
#endif
|
6479
|
6479
|
|
6480
|
6480
|
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
|
|
@@ -6484,7 +6484,7 @@ inline void gcode_M104() {
|
6484
|
6484
|
* standby mode, for instance in a dual extruder setup, without affecting
|
6485
|
6485
|
* the running print timer.
|
6486
|
6486
|
*/
|
6487
|
|
- if (code_value_temp_abs() <= (EXTRUDE_MINTEMP)/2) {
|
|
6487
|
+ if (code_value_temp_abs() <= (EXTRUDE_MINTEMP) / 2) {
|
6488
|
6488
|
print_job_timer.stop();
|
6489
|
6489
|
LCD_MESSAGEPGM(WELCOME_MSG);
|
6490
|
6490
|
}
|
|
@@ -6507,7 +6507,7 @@ inline void gcode_M104() {
|
6507
|
6507
|
SERIAL_PROTOCOLPGM(" /");
|
6508
|
6508
|
SERIAL_PROTOCOL_F(thermalManager.degTargetHotend(target_extruder), 1);
|
6509
|
6509
|
#if ENABLED(SHOW_TEMP_ADC_VALUES)
|
6510
|
|
- SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_raw[target_extruder] / OVERSAMPLENR);
|
|
6510
|
+ SERIAL_PROTOCOLPAIR(" (", thermalManager.rawHotendTemp(target_extruder) / OVERSAMPLENR);
|
6511
|
6511
|
SERIAL_PROTOCOLCHAR(')');
|
6512
|
6512
|
#endif
|
6513
|
6513
|
#endif
|
|
@@ -6517,7 +6517,7 @@ inline void gcode_M104() {
|
6517
|
6517
|
SERIAL_PROTOCOLPGM(" /");
|
6518
|
6518
|
SERIAL_PROTOCOL_F(thermalManager.degTargetBed(), 1);
|
6519
|
6519
|
#if ENABLED(SHOW_TEMP_ADC_VALUES)
|
6520
|
|
- SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_bed_raw / OVERSAMPLENR);
|
|
6520
|
+ SERIAL_PROTOCOLPAIR(" (", thermalManager.rawBedTemp() / OVERSAMPLENR);
|
6521
|
6521
|
SERIAL_PROTOCOLCHAR(')');
|
6522
|
6522
|
#endif
|
6523
|
6523
|
#endif
|
|
@@ -6529,7 +6529,7 @@ inline void gcode_M104() {
|
6529
|
6529
|
SERIAL_PROTOCOLPGM(" /");
|
6530
|
6530
|
SERIAL_PROTOCOL_F(thermalManager.degTargetHotend(e), 1);
|
6531
|
6531
|
#if ENABLED(SHOW_TEMP_ADC_VALUES)
|
6532
|
|
- SERIAL_PROTOCOLPAIR(" (", thermalManager.current_temperature_raw[e] / OVERSAMPLENR);
|
|
6532
|
+ SERIAL_PROTOCOLPAIR(" (", thermalManager.rawHotendTemp(e) / OVERSAMPLENR);
|
6533
|
6533
|
SERIAL_PROTOCOLCHAR(')');
|
6534
|
6534
|
#endif
|
6535
|
6535
|
}
|
|
@@ -6665,10 +6665,11 @@ inline void gcode_M109() {
|
6665
|
6665
|
|
6666
|
6666
|
const bool no_wait_for_cooling = code_seen('S');
|
6667
|
6667
|
if (no_wait_for_cooling || code_seen('R')) {
|
6668
|
|
- thermalManager.setTargetHotend(code_value_temp_abs(), target_extruder);
|
|
6668
|
+ const int16_t temp = code_value_temp_abs();
|
|
6669
|
+ thermalManager.setTargetHotend(temp, target_extruder);
|
6669
|
6670
|
#if ENABLED(DUAL_X_CARRIAGE)
|
6670
|
6671
|
if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
|
6671
|
|
- thermalManager.setTargetHotend(code_value_temp_abs() == 0.0 ? 0.0 : code_value_temp_abs() + duplicate_extruder_temp_offset, 1);
|
|
6672
|
+ thermalManager.setTargetHotend(temp ? temp + duplicate_extruder_temp_offset : 0, 1);
|
6672
|
6673
|
#endif
|
6673
|
6674
|
|
6674
|
6675
|
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
|
|
@@ -7196,7 +7197,7 @@ inline void gcode_M92() {
|
7196
|
7197
|
LOOP_XYZE(i) {
|
7197
|
7198
|
if (code_seen(axis_codes[i])) {
|
7198
|
7199
|
if (i == E_AXIS) {
|
7199
|
|
- const float value = code_value_per_axis_unit(E_AXIS + TARGET_EXTRUDER);
|
|
7200
|
+ const float value = code_value_per_axis_unit((AxisEnum)(E_AXIS + TARGET_EXTRUDER));
|
7200
|
7201
|
if (value < 20.0) {
|
7201
|
7202
|
float factor = planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] / value; // increase e constants if M92 E14 is given for netfab.
|
7202
|
7203
|
planner.max_jerk[E_AXIS] *= factor;
|
|
@@ -7206,7 +7207,7 @@ inline void gcode_M92() {
|
7206
|
7207
|
planner.axis_steps_per_mm[E_AXIS + TARGET_EXTRUDER] = value;
|
7207
|
7208
|
}
|
7208
|
7209
|
else {
|
7209
|
|
- planner.axis_steps_per_mm[i] = code_value_per_axis_unit(i);
|
|
7210
|
+ planner.axis_steps_per_mm[i] = code_value_per_axis_unit((AxisEnum)i);
|
7210
|
7211
|
}
|
7211
|
7212
|
}
|
7212
|
7213
|
}
|
|
@@ -8100,11 +8101,11 @@ inline void gcode_M226() {
|
8100
|
8101
|
*/
|
8101
|
8102
|
inline void gcode_M303() {
|
8102
|
8103
|
#if HAS_PID_HEATING
|
8103
|
|
- int e = code_seen('E') ? code_value_int() : 0;
|
8104
|
|
- int c = code_seen('C') ? code_value_int() : 5;
|
8105
|
|
- bool u = code_seen('U') && code_value_bool();
|
|
8104
|
+ const int e = code_seen('E') ? code_value_int() : 0,
|
|
8105
|
+ c = code_seen('C') ? code_value_int() : 5;
|
|
8106
|
+ const bool u = code_seen('U') && code_value_bool();
|
8106
|
8107
|
|
8107
|
|
- float temp = code_seen('S') ? code_value_temp_abs() : (e < 0 ? 70.0 : 150.0);
|
|
8108
|
+ int16_t temp = code_seen('S') ? code_value_temp_abs() : (e < 0 ? 70 : 150);
|
8108
|
8109
|
|
8109
|
8110
|
if (WITHIN(e, 0, HOTENDS - 1))
|
8110
|
8111
|
target_extruder = e;
|
|
@@ -8741,7 +8742,6 @@ inline void gcode_M503() {
|
8741
|
8742
|
|
8742
|
8743
|
const millis_t nozzle_timeout = millis() + (millis_t)(FILAMENT_CHANGE_NOZZLE_TIMEOUT) * 1000UL;
|
8743
|
8744
|
bool nozzle_timed_out = false;
|
8744
|
|
- float temps[4];
|
8745
|
8745
|
|
8746
|
8746
|
// Wait for filament insert by user and press button
|
8747
|
8747
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT);
|
|
@@ -8752,6 +8752,7 @@ inline void gcode_M503() {
|
8752
|
8752
|
|
8753
|
8753
|
idle();
|
8754
|
8754
|
|
|
8755
|
+ int16_t temps[HOTENDS];
|
8755
|
8756
|
HOTEND_LOOP() temps[e] = thermalManager.target_temperature[e]; // Save nozzle temps
|
8756
|
8757
|
|
8757
|
8758
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|