grblHAL / iMXRT1062

grblHAL driver for NXP iMXRT1062 (Teensy 4.x)
Other
50 stars 37 forks source link

Spindle sync compile error #38

Closed LaurentLM closed 2 years ago

LaurentLM commented 2 years ago

Hello,

I am getting an error here when compiling with spindle_sync enabled https://github.com/grblHAL/iMXRT1062/blob/dc680ff2588b2a5771c7930e8b8da137266e3e25/grblHAL_Teensy4/src/driver.c#L1494-L1495

I changed that line back to what it was in an older version and managed to get things working: if((hal.spindle.get_data = settings->spindle.ppr > 0 ? spindleGetData : NULL) && (spindle_encoder.ppr != settings->spindle.ppr || pidf_config_changed(&spindle_tracker.pid, &settings->position.pid))) {

It's probably not the perfect fix and would be worth someone having look at it.

terjeio commented 2 years ago

Thanks, this is the correct statement:

        if((hal.spindle.get_data = (hal.spindle.cap.at_speed = settings->spindle.ppr > 0) ? spindleGetData : NULL) &&
             (spindle_encoder.ppr != settings->spindle.ppr || pidf_config_changed(&spindle_tracker.pid, &settings->position.pid))) {

Will fix in the next commit.