Skip to content
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

temp runaway: proper cast to prevent any overflow. #1309

Merged
merged 1 commit into from
Jan 4, 2015

Conversation

philfifi
Copy link
Contributor

@philfifi philfifi commented Jan 4, 2015

Hello,
(this time pull request to Dev branch, sorry about the multiple attemps)

I noticed that the temp runaway feature was not working any more in my environment:
avr-gcc (GCC) 4.9.2
avr-libc 1.8.1
arduino 1.0.5
Mendel90 + Melzi

After digging, I noticed that the operation (millis() - timer) > period_seconds1000 was always returning false, hence the proposed fix. It cast to (unsigned long) to be of the same type as millis().

Tested by setting the hotend temperature, waiting for it to be reached, and unplugging the heater wire. On the Stable branch, nothing happens, while with this fix the runaway protection fires after the desired amount of time.

This branch is based on the merge-base from Stable and Development branches.
Thanks

alexborro added a commit that referenced this pull request Jan 4, 2015
temp runaway: proper cast to prevent any overflow.
@alexborro alexborro merged commit d2b6e62 into MarlinFirmware:Development Jan 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants