Add HAS_FAN and others

This commit is contained in:
Scott Lahteine
2020-04-27 04:41:18 -05:00
parent 3d45a4bd23
commit 8b3c7dda75
35 changed files with 85 additions and 90 deletions

View File

@ -511,8 +511,8 @@ void GcodeSuite::G26() {
#if HAS_HEATED_BED
if (parser.seenval('B')) {
g26_bed_temp = parser.value_celsius();
if (g26_bed_temp && !WITHIN(g26_bed_temp, 40, (BED_MAXTEMP - 10))) {
SERIAL_ECHOLNPAIR("?Specified bed temperature not plausible (40-", int(BED_MAXTEMP - 10), "C).");
if (g26_bed_temp && !WITHIN(g26_bed_temp, 40, BED_MAX_TARGET)) {
SERIAL_ECHOLNPAIR("?Specified bed temperature not plausible (40-", int(BED_MAX_TARGET), "C).");
return;
}
}

View File

@ -201,7 +201,7 @@ void GcodeSuite::G76() {
report_temps(next_temp_report);
const float measured_z = g76_probe(TSI_BED, target_bed, noz_pos_xyz);
if (isnan(measured_z) || target_bed > BED_MAXTEMP - 10) break;
if (isnan(measured_z) || target_bed > BED_MAX_TARGET) break;
}
SERIAL_ECHOLNPAIR("Retrieved measurements: ", temp_comp.get_index());

View File

@ -115,7 +115,7 @@ void GcodeSuite::M217() {
if (parser.seenval('P')) { const int16_t v = parser.value_linear_units(); toolchange_settings.prime_speed = constrain(v, 10, 5400); }
if (parser.seenval('R')) { const int16_t v = parser.value_linear_units(); toolchange_settings.retract_speed = constrain(v, 10, 5400); }
if (parser.seenval('U')) { const int16_t v = parser.value_linear_units(); toolchange_settings.unretract_speed = constrain(v, 10, 5400); }
#if TOOLCHANGE_FS_FAN >= 0 && FAN_COUNT > 0
#if TOOLCHANGE_FS_FAN >= 0 && HAS_FAN
if (parser.seenval('F')) { const int16_t v = parser.value_linear_units(); toolchange_settings.fan_speed = constrain(v, 0, 255); }
if (parser.seenval('G')) { const int16_t v = parser.value_linear_units(); toolchange_settings.fan_time = constrain(v, 1, 30); }
#endif

View File

@ -24,7 +24,7 @@
#include "../../MarlinCore.h" // for pin_is_protected
#include "../../inc/MarlinConfig.h"
#if FAN_COUNT > 0
#if HAS_FAN
#include "../../module/temperature.h"
#endif
@ -64,7 +64,7 @@ void GcodeSuite::M42() {
if (!parser.seenval('S')) return;
const byte pin_status = parser.value_byte();
#if FAN_COUNT > 0
#if HAS_FAN
switch (pin) {
#if HAS_FAN0
case FAN0_PIN: thermalManager.fan_speed[0] = pin_status; return;

View File

@ -92,7 +92,7 @@ void GcodeSuite::M81() {
print_job_timer.stop();
planner.finish_and_disable();
#if FAN_COUNT > 0
#if HAS_FAN
thermalManager.zero_fan_speeds();
#if ENABLED(PROBING_FANS_OFF)
thermalManager.fans_paused = false;

View File

@ -467,7 +467,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 105: M105(); return; // M105: Report Temperatures (and say "ok")
#if FAN_COUNT > 0
#if HAS_FAN
case 106: M106(); break; // M106: Fan On
case 107: M107(); break; // M107: Fan Off
#endif

View File

@ -554,7 +554,7 @@ private:
static void M105();
#if FAN_COUNT > 0
#if HAS_FAN
static void M106();
static void M107();
#endif

View File

@ -52,7 +52,7 @@ void GcodeSuite::M145() {
#if TEMP_SENSOR_BED != 0
if (parser.seenval('B')) {
v = parser.value_int();
ui.preheat_bed_temp[material] = constrain(v, BED_MINTEMP, BED_MAXTEMP - 10);
ui.preheat_bed_temp[material] = constrain(v, BED_MINTEMP, BED_MAX_TARGET);
}
#endif
}

View File

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h"
#if FAN_COUNT > 0
#if HAS_FAN
#include "../gcode.h"
#include "../../module/motion.h"
@ -74,4 +74,4 @@ void GcodeSuite::M107() {
thermalManager.set_fan_speed(p, 0);
}
#endif // FAN_COUNT > 0
#endif // HAS_FAN