Browse Source

Fix acosx condition (#17846)

Štěpán Dalecký 5 years ago
parent
commit
ebe8f2c605
No account linked to committer's email address
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      Marlin/src/module/planner.cpp

+ 2
- 2
Marlin/src/module/planner.cpp View File

2311
                       t = neg * junction_cos_theta;
2311
                       t = neg * junction_cos_theta;
2312
 
2312
 
2313
           // If angle is greater than 135 degrees (octagon), find speed for approximate arc
2313
           // If angle is greater than 135 degrees (octagon), find speed for approximate arc
2314
-          if (t < -0.7071067812f) {
2314
+          if (t > 0.7071067812f) {
2315
 
2315
 
2316
             #if ENABLED(JD_USE_MATH_ACOS)
2316
             #if ENABLED(JD_USE_MATH_ACOS)
2317
 
2317
 
2358
                 4.85301876f, 6.77019119f, 9.50873947f, 13.4009094f, 18.9188652f,
2358
                 4.85301876f, 6.77019119f, 9.50873947f, 13.4009094f, 18.9188652f,
2359
                 26.7320709f, 37.7884521f, 53.4292908f, 75.5522461f,  0.0f };
2359
                 26.7320709f, 37.7884521f, 53.4292908f, 75.5522461f,  0.0f };
2360
 
2360
 
2361
-              const int16_t idx = (t == 0.0f) ? 0 : __builtin_clz(int16_t((1.0f - t) * jd_lut_tll)) - jd_lut_tll0;
2361
+              const int16_t idx = (t == 0.0f) ? 0 : __builtin_clz(uint16_t((1.0f - t) * jd_lut_tll)) - jd_lut_tll0;
2362
 
2362
 
2363
               float junction_theta = t * pgm_read_float(&jd_lut_k[idx]) + pgm_read_float(&jd_lut_b[idx]);
2363
               float junction_theta = t * pgm_read_float(&jd_lut_k[idx]) + pgm_read_float(&jd_lut_b[idx]);
2364
               if (neg > 0) junction_theta = RADIANS(180) - junction_theta;
2364
               if (neg > 0) junction_theta = RADIANS(180) - junction_theta;

Loading…
Cancel
Save