From 338dac258b401dd33ba5ff75edb460a0a2e27d10 Mon Sep 17 00:00:00 2001 From: GMagician <3684609+GMagician@users.noreply.github.com> Date: Mon, 5 Feb 2018 21:27:39 +0100 Subject: [PATCH] [2.0.x] Fix compiler error when G26 is enabled (#9492) --- Marlin/src/gcode/bedlevel/G26.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index 29817ed3ab..406308a5f6 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -726,14 +726,15 @@ void GcodeSuite::G26() { * All angles are offset by 15 degrees to allow for a smaller table. */ #define A_CNT ((360 / 30) / 2) - #define _COS(A) (trig_table[((N + A_CNT * 8) % A_CNT)] * (A >= A_CNT ? -1 : 1)) + #define _COS(A) (trig_table[((A + A_CNT * 8) % A_CNT)] * (A >= A_CNT ? -1 : 1)) #define _SIN(A) (-_COS((A + A_CNT / 2) % (A_CNT * 2))) float trig_table[A_CNT]; for (uint8_t i = 0; i < A_CNT; i++) trig_table[i] = INTERSECTION_CIRCLE_RADIUS * cos(RADIANS(i * 30 + 15)); + mesh_index_pair location; do { - const mesh_index_pair location = g26_continue_with_closest + location = g26_continue_with_closest ? find_closest_circle_to_print(current_position[X_AXIS], current_position[Y_AXIS]) : find_closest_circle_to_print(g26_x_pos, g26_y_pos); // Find the closest Mesh Intersection to where we are now.