grblHAL / core

grblHAL core code and master Wiki
Other
304 stars 73 forks source link

Wrong spindle mask? #471

Closed Nick507 closed 3 months ago

Nick507 commented 3 months ago

In my_machine.h: #define SPINDLE0_ENABLE SPINDLE_VFD I guess it should be: #define SPINDLE0_ENABLE (1<<SPINDLE_MODVFD)

and in driver_opts.h:274 #define SPINDLE_ENABLE ((1<<SPINDLE0_ENABLE)|(1<<SPINDLE1_ENABLE)|(1<<SPINDLE2_ENABLE)|(1<<SPINDLE3_ENABLE)) should be: #define SPINDLE_ENABLE ((SPINDLE0_ENABLE)|(SPINDLE1_ENABLE)|(SPINDLE2_ENABLE)|(SPINDLE3_ENABLE))

Because as I understand, you want to get intersection mask between all types of used spindles.

terjeio commented 3 months ago

#define SPINDLE0_ENABLE SPINDLE_VFD is not correct since the SPINDLE_VFD symbol is not defined anywhere, use one of the predefined symbols or values.

Because as I understand, you want to get intersection mask between all types of used spindles.

Correct, and I chose to bit shift the spindle number in _driveropts.h.

Nick507 commented 3 months ago

is not correct since the SPINDLE_VFD symbol is not defined anywhere, use one of the predefined symbols or values.

The mistake is not just about undefined SPINDLE_VFD, but value must be a bit mask (1<<X) whereas current code is: //#define SPINDLE0_ENABLE SPINDLE_HUANYANG1

actually this comment relates to ESP32 driver repo, I've just add it here, because it is related to bug in driver_opts, which is core repo.

btw, should I close this issue?

UPD: sorry, seems that it was my mistake. define spindle with SPINDLE_HUANYANG1 and then make a bit mask in SPINDLE_ENABLE is correct.

Nick507 commented 3 months ago

There is no issue