Fans loop macro
This commit is contained in:
		| @@ -210,11 +210,12 @@ extern millis_t max_inactive_time, stepper_inactive_time; | ||||
|     extern bool fans_paused; | ||||
|     extern uint8_t paused_fan_speed[FAN_COUNT]; | ||||
|   #endif | ||||
|   #define FANS_LOOP(I) LOOP_L_N(I, FAN_COUNT) | ||||
| #endif | ||||
|  | ||||
| inline void zero_fan_speeds() { | ||||
|   #if FAN_COUNT > 0 | ||||
|     LOOP_L_N(i, FAN_COUNT) fan_speed[i] = 0; | ||||
|     FANS_LOOP(i) fan_speed[i] = 0; | ||||
|   #endif | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -39,7 +39,7 @@ millis_t Power::lastPowerOn; | ||||
|  | ||||
| bool Power::is_power_needed() { | ||||
|   #if ENABLED(AUTO_POWER_FANS) | ||||
|     for (uint8_t i = 0; i < FAN_COUNT; i++) if (fan_speed[i]) return true; | ||||
|     FANS_LOOP(i) if (fan_speed[i]) return true; | ||||
|   #endif | ||||
|  | ||||
|   #if ENABLED(AUTO_POWER_E_FANS) | ||||
|   | ||||
| @@ -277,7 +277,7 @@ void PrintJobRecovery::resume() { | ||||
|   } | ||||
|  | ||||
|   // Restore print cooling fan speeds | ||||
|   for (uint8_t i = 0; i < FAN_COUNT; i++) { | ||||
|   FANS_LOOP(i) { | ||||
|     uint8_t f = info.fan_speed[i]; | ||||
|     if (f) { | ||||
|       sprintf_P(cmd, PSTR("M106 P%i S%i"), i, f); | ||||
|   | ||||
| @@ -1181,7 +1181,7 @@ void Planner::check_axes_activity() { | ||||
|   if (has_blocks_queued()) { | ||||
|  | ||||
|     #if FAN_COUNT > 0 | ||||
|       for (uint8_t i = 0; i < FAN_COUNT; i++) | ||||
|       FANS_LOOP(i) | ||||
|         tail_fan_speed[i] = block_buffer[block_buffer_tail].fan_speed[i]; | ||||
|     #endif | ||||
|  | ||||
| @@ -1204,7 +1204,7 @@ void Planner::check_axes_activity() { | ||||
|   } | ||||
|   else { | ||||
|     #if FAN_COUNT > 0 | ||||
|       for (uint8_t i = 0; i < FAN_COUNT; i++) tail_fan_speed[i] = fan_speed[i]; | ||||
|       FANS_LOOP(i) tail_fan_speed[i] = fan_speed[i]; | ||||
|     #endif | ||||
|  | ||||
|     #if ENABLED(BARICUDA) | ||||
| @@ -1751,7 +1751,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move, | ||||
|   #endif | ||||
|  | ||||
|   #if FAN_COUNT > 0 | ||||
|     for (uint8_t i = 0; i < FAN_COUNT; i++) block->fan_speed[i] = fan_speed[i]; | ||||
|     FANS_LOOP(i) block->fan_speed[i] = fan_speed[i]; | ||||
|   #endif | ||||
|  | ||||
|   #if ENABLED(BARICUDA) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user