From 726a38712e17f1f31436d033d0597237c086d309 Mon Sep 17 00:00:00 2001 From: Mike La Spina Date: Mon, 9 May 2022 17:18:47 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20Fan=20Tail=20Speed=20Init?= =?UTF-8?q?=20(#24076)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/src/module/planner.cpp | 30 +++++++++++++++--------------- Marlin/src/module/planner.h | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 6dc2c9e084..a22a99340f 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -1306,7 +1306,7 @@ void Planner::check_axes_activity() { #if HAS_FAN && DISABLED(LASER_SYNCHRONOUS_M106_M107) #define HAS_TAIL_FAN_SPEED 1 - static uint8_t tail_fan_speed[FAN_COUNT] = ARRAY_N_1(FAN_COUNT, 128); + static uint8_t tail_fan_speed[FAN_COUNT] = ARRAY_N_1(FAN_COUNT, 13); bool fans_need_update = false; #endif @@ -1342,18 +1342,18 @@ void Planner::check_axes_activity() { #if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_I, DISABLE_J, DISABLE_K, DISABLE_E) for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { - block_t *block = &block_buffer[b]; + block_t * const bnext = &block_buffer[b]; LOGICAL_AXIS_CODE( - if (TERN0(DISABLE_E, block->steps.e)) axis_active.e = true, - if (TERN0(DISABLE_X, block->steps.x)) axis_active.x = true, - if (TERN0(DISABLE_Y, block->steps.y)) axis_active.y = true, - if (TERN0(DISABLE_Z, block->steps.z)) axis_active.z = true, - if (TERN0(DISABLE_I, block->steps.i)) axis_active.i = true, - if (TERN0(DISABLE_J, block->steps.j)) axis_active.j = true, - if (TERN0(DISABLE_K, block->steps.k)) axis_active.k = true, - if (TERN0(DISABLE_U, block->steps.u)) axis_active.u = true, - if (TERN0(DISABLE_V, block->steps.v)) axis_active.v = true, - if (TERN0(DISABLE_W, block->steps.w)) axis_active.w = true + if (TERN0(DISABLE_E, bnext->steps.e)) axis_active.e = true, + if (TERN0(DISABLE_X, bnext->steps.x)) axis_active.x = true, + if (TERN0(DISABLE_Y, bnext->steps.y)) axis_active.y = true, + if (TERN0(DISABLE_Z, bnext->steps.z)) axis_active.z = true, + if (TERN0(DISABLE_I, bnext->steps.i)) axis_active.i = true, + if (TERN0(DISABLE_J, bnext->steps.j)) axis_active.j = true, + if (TERN0(DISABLE_K, bnext->steps.k)) axis_active.k = true, + if (TERN0(DISABLE_U, bnext->steps.u)) axis_active.u = true, + if (TERN0(DISABLE_V, bnext->steps.v)) axis_active.v = true, + if (TERN0(DISABLE_W, bnext->steps.w)) axis_active.w = true ); } #endif @@ -1451,14 +1451,14 @@ void Planner::check_axes_activity() { * currently in the planner. */ void Planner::autotemp_task() { - static float oldt = 0; + static float oldt = 0.0f; if (!autotemp_enabled) return; if (thermalManager.degTargetHotend(active_extruder) < autotemp_min - 2) return; // Below the min? - float high = 0.0; + float high = 0.0f; for (uint8_t b = block_buffer_tail; b != block_buffer_head; b = next_block_index(b)) { - block_t *block = &block_buffer[b]; + const block_t * const block = &block_buffer[b]; if (NUM_AXIS_GANG(block->steps.x, || block->steps.y, || block->steps.z, || block->steps.i, || block->steps.j, || block->steps.k, || block->steps.u, || block->steps.v, || block->steps.w)) { const float se = (float)block->steps.e / block->step_event_count * SQRT(block->nominal_speed_sqr); // mm/sec; NOLESS(high, se); diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index afcc5a1566..dbc8592179 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -1022,7 +1022,7 @@ class Planner { return limit_value; } - #endif // !CLASSIC_JERK + #endif // HAS_JUNCTION_DEVIATION }; #define PLANNER_XY_FEEDRATE() _MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS])