-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change M126 return value #23
base: master
Are you sure you want to change the base?
Conversation
I think the kicker is to make sure that MakerBot's firmware also does & 0x01 on the one byte operand and/or uses any non-zero value as "true". |
Just checked. At least for Mightyboard's it looks ok: https://github.com/makerbot/MightyBoardFirmware/blob/207c6db181565dacba22a0d4cc271dbe71cfcd7a/firmware/src/MightyBoard/Motherboard/Command.cc#L420 |
On 13/08/2017 4:46 PM, Mark Walker wrote:
I think the kicker is to make sure that MakerBot's firmware also does & 0x01 on the one byte operand and/or uses any non-zero value as "true".
|
Seems like we might want to just pass through the value as the byte instead of normalizing to 0-100. Mainly so that M106 S255 still works the same as before for non upgraded firmwares. And then if necessary normalize on the firmware side to 0-100 if that works better on that side. It's a few more bytes on the firmware side that way, but more likely to be backward compatible. Yes? |
The point is i was looking on Sailfish while i was writing it. They are storing values of fan in EEPROM as 0-100. I added just possibility to change this value via gcode. If there is way to switch from 0-255 to 0-100 without using floats and dividing in this function. It will be ok. I just dont want to put another cpu consuming operations,cuz look ahead how the final formula looks like, its just phat. |
@pszczelaszkov: My suggestion to ensure things work OK on Makerbot default firmware is to |= 0x1 the value if it's >0 (while still treating fan=1 as a special case - but having GPX-output gcode never output fan=1). Yes, this will increase the desired fan rate slightly in 50% of cases, but that's better than not having the fan turn on at all. In this case, for M106/M107, it would be the responsibility of GPX to convert that to the proper commands, ensuring that the fan is on. |
Well its not direct pull request but rather point to discuss,
Since everything thats not 0 is always true, why there is casting to 1:0 ?
Imho it complicate things. I think the only firmware that uses this call is Sailfish.
I even created pull request on Sailfish making use of M126
https://github.com/jetty840/Sailfish-MightyBoardFirmware/pull/183
We tested this change on s3d and slic3r (which i modified a little too) but i wont pull request there until we discuss this change. Its nice feature on MB having dynamic fan change.