Add HAS_TEMP_SENSOR conditional

This commit is contained in:
Scott Lahteine 2018-03-07 00:50:02 -06:00
parent 2d0d5eccd8
commit 2bf1bbf399
4 changed files with 12 additions and 7 deletions

View File

@ -686,6 +686,7 @@
#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_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2)
#define HAS_TEMP_SENSOR (HAS_TEMP_HOTEND || HAS_TEMP_BED)
// Heaters
#define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))
@ -748,6 +749,10 @@
#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))
#if !HAS_TEMP_SENSOR
#undef AUTO_REPORT_TEMPERATURES
#endif
/**
* This setting is also used by M109 when trying to calculate
* a ballpark safe margin to prevent wait-forever situation.

View File

@ -7706,7 +7706,7 @@ inline void gcode_M104() {
inline void gcode_M105() {
if (get_target_extruder_from_command(105)) return;
#if HAS_TEMP_HOTEND || HAS_TEMP_BED
#if HAS_TEMP_SENSOR
SERIAL_PROTOCOLPGM(MSG_OK);
thermalManager.print_heaterstates();
#else // !HAS_TEMP_HOTEND && !HAS_TEMP_BED
@ -7717,7 +7717,7 @@ inline void gcode_M105() {
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>
@ -11682,7 +11682,7 @@ void process_parsed_command() {
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
#endif

View File

@ -416,7 +416,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS],
// Report heater states every 2 seconds
if (ELAPSED(ms, next_temp_ms)) {
#if HAS_TEMP_HOTEND || HAS_TEMP_BED
#if HAS_TEMP_SENSOR
print_heaterstates();
SERIAL_EOL();
#endif
@ -2235,7 +2235,7 @@ void 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,
#if ENABLED(SHOW_TEMP_ADC_VALUES)
@ -2326,4 +2326,4 @@ void Temperature::isr() {
#endif // AUTO_REPORT_TEMPERATURES
#endif // HAS_TEMP_HOTEND || HAS_TEMP_BED
#endif // HAS_TEMP_SENSOR

View File

@ -571,7 +571,7 @@ class Temperature {
#endif // HEATER_IDLE_HANDLER
#if HAS_TEMP_HOTEND || HAS_TEMP_BED
#if HAS_TEMP_SENSOR
static void print_heaterstates();
#if ENABLED(AUTO_REPORT_TEMPERATURES)
static uint8_t auto_report_temp_interval;