Move fan_state to fancheck.cpp and make it static

No change in memory
This commit is contained in:
Guðni Már Gilbert 2023-04-14 17:23:48 +00:00
parent ebdcfbec50
commit b67c359129
3 changed files with 2 additions and 2 deletions

View File

@ -320,7 +320,6 @@ extern uint32_t total_filament_used; // mm/100 or 10um
/// @param _total_print_time has unit minutes, for example 123 minutes
void save_statistics(uint32_t _total_filament_used, uint32_t _total_print_time);
extern bool fan_state[2];
extern int fan_edge_counter[2];
extern int fan_speed[2];

View File

@ -188,7 +188,7 @@ bool loading_flag = false;
#define XY_NO_RESTORE_FLAG (mesh_bed_leveling_flag || homing_flag)
bool fan_state[2];
int fan_edge_counter[2];
int fan_speed[2];

View File

@ -220,6 +220,7 @@ void checkExtruderAutoFans()
#if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1))
void readFanTach() {
static bool fan_state[2];
#ifdef FAN_SOFT_PWM
if (READ(TACH_0) != fan_state[0]) {
if(fan_measuring) fan_edge_counter[0] ++;