Updating the speed of a spindle that is not the currently active tool seems to work only once.
T0
M3 P1 S200 ; works
M3 P1 S500 ; does not work
If we set the active tool with T1 it works.
When we try to change it through M4 it works but again only once:
T0
M3 P1 S200 ; works
M4 P1 S500 ; works
M4 P1 S1000 ; does not work
M3 P1 S1000 ; works
Is this the expected behavior, and if so what is the reason?
We checked the code and it seems to come from these lines:
https://github.com/Duet3D/RepRapFirmware/blob/1194bf3d4867a844fe442cfc7d1500d933521467/src/GCodes/GCodes2.cpp#L583-L586
And especially this one where the rpm is updated if there is a state change
https://github.com/Duet3D/RepRapFirmware/blob/1194bf3d4867a844fe442cfc7d1500d933521467/src/Tools/Spindle.cpp#L134-L141