Move temp_all_zero() to heaters_all_zero().
We need the power supply for the heaters, after all, not for the temperature sensors. Some heaters (e.g. fans) don't even have a temp sensor.
This commit is contained in:
parent
28a366fc48
commit
042d9ddfc2
3
clock.c
3
clock.c
|
|
@ -8,7 +8,6 @@
|
||||||
#include "sersendf.h"
|
#include "sersendf.h"
|
||||||
#include "dda_queue.h"
|
#include "dda_queue.h"
|
||||||
#include "watchdog.h"
|
#include "watchdog.h"
|
||||||
#include "temp.h"
|
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "heater.h"
|
#include "heater.h"
|
||||||
|
|
@ -24,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
static void clock_250ms(void) {
|
static void clock_250ms(void) {
|
||||||
#ifndef NO_AUTO_IDLE
|
#ifndef NO_AUTO_IDLE
|
||||||
if (temp_all_zero()) {
|
if (heaters_all_zero()) {
|
||||||
if (psu_timeout > (30 * 4)) {
|
if (psu_timeout > (30 * 4)) {
|
||||||
power_off();
|
power_off();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
heater.c
12
heater.c
|
|
@ -443,6 +443,18 @@ void heater_set(heater_t index, uint8_t value) {
|
||||||
power_on();
|
power_on();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief check wether all heaters are off
|
||||||
|
*/
|
||||||
|
uint8_t heaters_all_zero() {
|
||||||
|
uint8_t i;
|
||||||
|
|
||||||
|
for (i = 0; i < NUM_HEATERS; i++) {
|
||||||
|
if (heaters_runtime[i].heater_output)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 255;
|
||||||
|
}
|
||||||
|
|
||||||
/** \brief turn off all heaters
|
/** \brief turn off all heaters
|
||||||
|
|
||||||
for emergency stop
|
for emergency stop
|
||||||
|
|
|
||||||
1
heater.h
1
heater.h
|
|
@ -21,6 +21,7 @@ void heater_save_settings(void);
|
||||||
void heater_set(heater_t index, uint8_t value);
|
void heater_set(heater_t index, uint8_t value);
|
||||||
void heater_tick(heater_t h, temp_type_t type, uint16_t current_temp, uint16_t target_temp);
|
void heater_tick(heater_t h, temp_type_t type, uint16_t current_temp, uint16_t target_temp);
|
||||||
|
|
||||||
|
uint8_t heaters_all_zero(void);
|
||||||
uint8_t heaters_all_off(void);
|
uint8_t heaters_all_off(void);
|
||||||
|
|
||||||
void pid_set_p(heater_t index, int32_t p);
|
void pid_set_p(heater_t index, int32_t p);
|
||||||
|
|
|
||||||
11
temp.c
11
temp.c
|
|
@ -341,17 +341,6 @@ uint16_t temp_get(temp_sensor_t index) {
|
||||||
return temp_sensors_runtime[index].last_read_temp;
|
return temp_sensors_runtime[index].last_read_temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t temp_all_zero() {
|
|
||||||
uint8_t i;
|
|
||||||
for (i = 0; i < NUM_TEMP_SENSORS; i++) {
|
|
||||||
if (temp_sensors[i].heater < NUM_HEATERS) {
|
|
||||||
if (temp_sensors_runtime[i].target_temp)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 255;
|
|
||||||
}
|
|
||||||
|
|
||||||
// extruder doesn't have sersendf_P
|
// extruder doesn't have sersendf_P
|
||||||
#ifndef EXTRUDER
|
#ifndef EXTRUDER
|
||||||
static void single_temp_print(temp_sensor_t index) {
|
static void single_temp_print(temp_sensor_t index) {
|
||||||
|
|
|
||||||
2
temp.h
2
temp.h
|
|
@ -41,8 +41,6 @@ uint8_t temp_achieved(void);
|
||||||
void temp_set(temp_sensor_t index, uint16_t temperature);
|
void temp_set(temp_sensor_t index, uint16_t temperature);
|
||||||
uint16_t temp_get(temp_sensor_t index);
|
uint16_t temp_get(temp_sensor_t index);
|
||||||
|
|
||||||
uint8_t temp_all_zero(void);
|
|
||||||
|
|
||||||
void temp_print(temp_sensor_t index);
|
void temp_print(temp_sensor_t index);
|
||||||
|
|
||||||
#endif /* _TEMP_H */
|
#endif /* _TEMP_H */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue