-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
Runout sensor without SD Card and updating print timer behaviour #4239
Conversation
Runout sensor without SD Card
*/ | ||
#if ENABLED(FILAMENT_RUNOUT_SENSOR) | ||
#if !HAS_FIL_RUNOUT | ||
#error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." | ||
#elif DISABLED(SDSUPPORT) | ||
#elif DISABLED(SDSUPPORT) && DISABLED(PRINTJOB_TIMER_AUTOSTART) | ||
#error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#error "FILAMENT_RUNOUT_SENSOR requires SDSUPPORT or PRINTJOB_TIMER_AUTOSTART."
if (no_wait_for_cooling || code_seen('R')) { | ||
thermalManager.setTargetBed(code_value_temp_abs()); | ||
#if ENABLED(PRINTJOB_TIMER_AUTOSTART) | ||
if(code_value_temp_abs() > BED_MINTEMP) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should produce slightly more optimal code, with one less call to code_value_temp_abs
:
const float temp = code_value_temp_abs();
thermalManager.setTargetBed(temp);
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
if (temp > BED_MINTEMP) {
. . .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…or not. The compiler will use its own temporary when juggling the return value of non-volatile functions.
Enabling runout sensor without SD card as well. For example, for sending g-code from desktop computer (Repetier-Host, slicer etc.) or from Raspberry Pi (octoprint etc.). Print timer is used for this feature (print statistics). We enhanced print timer triggers so bed heating will start timer too, and extruder heating without wait will not start timer:
M104 (extruder without wait) - high temp = none, low temp = stop timer
M109 (extruder with wait) - high temp = start timer, low temp = stop timer
M140 (bed without wait) - none
M190 (bed with wait) - high temp = start timer, low temp = none