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

Runout sensor without SD Card and updating print timer behaviour #4239

Closed
wants to merge 23 commits into from
Closed

Conversation

clexpert
Copy link
Contributor

@clexpert clexpert commented Jul 8, 2016

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

Petr Zahradník junior and others added 2 commits July 8, 2016 15:00
*/
#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."
Copy link
Member

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) {
Copy link
Member

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) {
    . . .

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants