heaters-checking update

This commit is contained in:
MRprusa3d 2020-03-03 14:57:45 +01:00
parent 0eaa4edfee
commit f09323a78f
3 changed files with 14 additions and 1 deletions

View File

@ -9463,7 +9463,7 @@ bool bInhibitFlag;
{
#if IR_SENSOR_ANALOG
bool bTemp=current_voltage_raw_IR>14000; // nahradit prumerem @ vicero hodnot
bTemp=bTemp&&(target_temperature[0]==0); // & bed (& dalsi extrudery)
bTemp=bTemp&&(!CHECK_ALL_HEATERS);
bTemp=bTemp&&(menu_menu==lcd_status_screen);
bTemp=bTemp&&((oFsensorPCB==ClFsensorPCB::_Old)||(oFsensorPCB==ClFsensorPCB::_Undef));
bTemp=bTemp&&fsensor_enabled;

View File

@ -210,6 +210,14 @@ static void temp_runaway_check(int _heater_id, float _target_temperature, float
static void temp_runaway_stop(bool isPreheat, bool isBed);
#endif
// return "false", if all extruder-heaters are 'off' (ie. "true", if any heater is 'on')
bool checkAllHotends(void)
{
bool result=false;
for(int i=0;i<EXTRUDERS;i++) result=(result||(target_temperature[i]!=0));
return(result);
}
void PID_autotune(float temp, int extruder, int ncycles)
{
pid_number_of_cycles = ncycles;

View File

@ -47,6 +47,8 @@
void tp_init(); //initialize the heating
void manage_heater(); //it is critical that this is called periodically.
extern bool checkAllHotends(void);
// low level conversion routines
// do not use these routines and variables outside of temperature.cpp
extern int target_temperature[EXTRUDERS];
@ -220,6 +222,9 @@ FORCE_INLINE bool isCoolingBed() {
#error Invalid number of extruders
#endif
// return "false", if all heaters are 'off' (ie. "true", if any heater is 'on')
#define CHECK_ALL_HEATERS (checkAllHotends()||(target_temperature_bed!=0))
int getHeaterPower(int heater);
void disable_heater();
void updatePID();