mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-27 22:08:02 +00:00
Add HAS_TEMP_SENSOR conditional
This commit is contained in:
parent
2d0d5eccd8
commit
2bf1bbf399
@ -686,6 +686,7 @@
|
|||||||
#define HAS_TEMP_4 (PIN_EXISTS(TEMP_4) && TEMP_SENSOR_4 != 0 && TEMP_SENSOR_4 > -2)
|
#define HAS_TEMP_4 (PIN_EXISTS(TEMP_4) && TEMP_SENSOR_4 != 0 && TEMP_SENSOR_4 > -2)
|
||||||
#define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675))
|
#define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675))
|
||||||
#define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2)
|
#define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2)
|
||||||
|
#define HAS_TEMP_SENSOR (HAS_TEMP_HOTEND || HAS_TEMP_BED)
|
||||||
|
|
||||||
// Heaters
|
// Heaters
|
||||||
#define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))
|
#define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))
|
||||||
@ -748,6 +749,10 @@
|
|||||||
#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
|
#define HAS_DIGIPOTSS (PIN_EXISTS(DIGIPOTSS))
|
||||||
#define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E))
|
#define HAS_MOTOR_CURRENT_PWM (PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_Z) || PIN_EXISTS(MOTOR_CURRENT_PWM_E))
|
||||||
|
|
||||||
|
#if !HAS_TEMP_SENSOR
|
||||||
|
#undef AUTO_REPORT_TEMPERATURES
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This setting is also used by M109 when trying to calculate
|
* This setting is also used by M109 when trying to calculate
|
||||||
* a ballpark safe margin to prevent wait-forever situation.
|
* a ballpark safe margin to prevent wait-forever situation.
|
||||||
|
@ -7706,7 +7706,7 @@ inline void gcode_M104() {
|
|||||||
inline void gcode_M105() {
|
inline void gcode_M105() {
|
||||||
if (get_target_extruder_from_command(105)) return;
|
if (get_target_extruder_from_command(105)) return;
|
||||||
|
|
||||||
#if HAS_TEMP_HOTEND || HAS_TEMP_BED
|
#if HAS_TEMP_SENSOR
|
||||||
SERIAL_PROTOCOLPGM(MSG_OK);
|
SERIAL_PROTOCOLPGM(MSG_OK);
|
||||||
thermalManager.print_heaterstates();
|
thermalManager.print_heaterstates();
|
||||||
#else // !HAS_TEMP_HOTEND && !HAS_TEMP_BED
|
#else // !HAS_TEMP_HOTEND && !HAS_TEMP_BED
|
||||||
@ -7717,7 +7717,7 @@ inline void gcode_M105() {
|
|||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
|
#if ENABLED(AUTO_REPORT_TEMPERATURES)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* M155: Set temperature auto-report interval. M155 S<seconds>
|
* M155: Set temperature auto-report interval. M155 S<seconds>
|
||||||
@ -11682,7 +11682,7 @@ void process_parsed_command() {
|
|||||||
|
|
||||||
case 105: gcode_M105(); KEEPALIVE_STATE(NOT_BUSY); return; // M105: Report Temperatures (and say "ok")
|
case 105: gcode_M105(); KEEPALIVE_STATE(NOT_BUSY); return; // M105: Report Temperatures (and say "ok")
|
||||||
|
|
||||||
#if ENABLED(AUTO_REPORT_TEMPERATURES) && (HAS_TEMP_HOTEND || HAS_TEMP_BED)
|
#if ENABLED(AUTO_REPORT_TEMPERATURES)
|
||||||
case 155: gcode_M155(); break; // M155: Set Temperature Auto-report Interval
|
case 155: gcode_M155(); break; // M155: Set Temperature Auto-report Interval
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS],
|
|||||||
|
|
||||||
// Report heater states every 2 seconds
|
// Report heater states every 2 seconds
|
||||||
if (ELAPSED(ms, next_temp_ms)) {
|
if (ELAPSED(ms, next_temp_ms)) {
|
||||||
#if HAS_TEMP_HOTEND || HAS_TEMP_BED
|
#if HAS_TEMP_SENSOR
|
||||||
print_heaterstates();
|
print_heaterstates();
|
||||||
SERIAL_EOL();
|
SERIAL_EOL();
|
||||||
#endif
|
#endif
|
||||||
@ -2235,7 +2235,7 @@ void Temperature::isr() {
|
|||||||
SBI(TIMSK0, OCIE0B); //re-enable Temperature ISR
|
SBI(TIMSK0, OCIE0B); //re-enable Temperature ISR
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAS_TEMP_HOTEND || HAS_TEMP_BED
|
#if HAS_TEMP_SENSOR
|
||||||
|
|
||||||
void print_heater_state(const float &c, const float &t,
|
void print_heater_state(const float &c, const float &t,
|
||||||
#if ENABLED(SHOW_TEMP_ADC_VALUES)
|
#if ENABLED(SHOW_TEMP_ADC_VALUES)
|
||||||
@ -2326,4 +2326,4 @@ void Temperature::isr() {
|
|||||||
|
|
||||||
#endif // AUTO_REPORT_TEMPERATURES
|
#endif // AUTO_REPORT_TEMPERATURES
|
||||||
|
|
||||||
#endif // HAS_TEMP_HOTEND || HAS_TEMP_BED
|
#endif // HAS_TEMP_SENSOR
|
||||||
|
@ -571,7 +571,7 @@ class Temperature {
|
|||||||
|
|
||||||
#endif // HEATER_IDLE_HANDLER
|
#endif // HEATER_IDLE_HANDLER
|
||||||
|
|
||||||
#if HAS_TEMP_HOTEND || HAS_TEMP_BED
|
#if HAS_TEMP_SENSOR
|
||||||
static void print_heaterstates();
|
static void print_heaterstates();
|
||||||
#if ENABLED(AUTO_REPORT_TEMPERATURES)
|
#if ENABLED(AUTO_REPORT_TEMPERATURES)
|
||||||
static uint8_t auto_report_temp_interval;
|
static uint8_t auto_report_temp_interval;
|
||||||
|
Loading…
Reference in New Issue
Block a user