add NO_AUTO_IDLE option to prevent powercuts after inactivity, add temp_all_zero so power isn't cut if heater remains off for a while but has a non-zero set temperature
This commit is contained in:
parent
e05e12c9e0
commit
a68ae12679
24
clock.c
24
clock.c
|
|
@ -23,17 +23,21 @@
|
||||||
called from clock_10ms(), do not call directly
|
called from clock_10ms(), do not call directly
|
||||||
*/
|
*/
|
||||||
void clock_250ms() {
|
void clock_250ms() {
|
||||||
if (steptimeout > (30 * 4)) {
|
#ifndef NO_AUTO_IDLE
|
||||||
power_off();
|
if (temp_all_zero()) {
|
||||||
}
|
if (steptimeout > (30 * 4)) {
|
||||||
else if (heaters_all_off()) {
|
power_off();
|
||||||
uint8_t save_reg = SREG;
|
}
|
||||||
cli();
|
else {
|
||||||
CLI_SEI_BUG_MEMORY_BARRIER();
|
uint8_t save_reg = SREG;
|
||||||
steptimeout++;
|
cli();
|
||||||
MEMORY_BARRIER();
|
CLI_SEI_BUG_MEMORY_BARRIER();
|
||||||
SREG = save_reg;
|
steptimeout++;
|
||||||
|
MEMORY_BARRIER();
|
||||||
|
SREG = save_reg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ifclock(clock_flag_1s) {
|
ifclock(clock_flag_1s) {
|
||||||
if (DEBUG_POSITION && (debug_flags & DEBUG_POSITION)) {
|
if (DEBUG_POSITION && (debug_flags & DEBUG_POSITION)) {
|
||||||
|
|
|
||||||
11
temp.c
11
temp.c
|
|
@ -326,6 +326,17 @@ 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
|
||||||
/// send temperatures to host
|
/// send temperatures to host
|
||||||
|
|
|
||||||
2
temp.h
2
temp.h
|
|
@ -41,6 +41,8 @@ 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