Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MarlinKimbra
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
MarlinKimbra
Commits
8feaa0b2
Commit
8feaa0b2
authored
Jun 05, 2016
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wait_tempbed has to be called only if there is a tempbed!
parent
8e0c00ec
Pipeline
#102
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
62 deletions
+66
-62
MK_Main.cpp
MK/module/MK_Main.cpp
+66
-62
No files found.
MK/module/MK_Main.cpp
View file @
8feaa0b2
...
@@ -3117,77 +3117,79 @@ inline void wait_heater(bool no_wait_for_cooling = true) {
...
@@ -3117,77 +3117,79 @@ inline void wait_heater(bool no_wait_for_cooling = true) {
KEEPALIVE_STATE
(
IN_HANDLER
);
KEEPALIVE_STATE
(
IN_HANDLER
);
}
}
inline
void
wait_bed
(
bool
no_wait_for_cooling
=
true
)
{
#if HAS(TEMP_BED)
inline
void
wait_bed
(
bool
no_wait_for_cooling
=
true
)
{
#if TEMP_BED_RESIDENCY_TIME > 0
#if TEMP_BED_RESIDENCY_TIME > 0
millis_t
residency_start_ms
=
0
;
millis_t
residency_start_ms
=
0
;
// Loop until the temperature has stabilized
// Loop until the temperature has stabilized
#define TEMP_BED_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_BED_RESIDENCY_TIME) * 1000UL))
#define TEMP_BED_CONDITIONS (!residency_start_ms || PENDING(now, residency_start_ms + (TEMP_BED_RESIDENCY_TIME) * 1000UL))
#else
#else
// Loop until the temperature is very close target
// Loop until the temperature is very close target
#define TEMP_BED_CONDITIONS (wants_to_cool ? isCoolingBed() : isHeatingBed())
#define TEMP_BED_CONDITIONS (wants_to_cool ? isCoolingBed() : isHeatingBed())
#endif // TEMP_BED_RESIDENCY_TIME > 0
#endif // TEMP_BED_RESIDENCY_TIME > 0
float
theTarget
=
-
1
;
float
theTarget
=
-
1
;
bool
wants_to_cool
;
bool
wants_to_cool
;
cancel_heatup
=
false
;
cancel_heatup
=
false
;
millis_t
now
,
next_temp_ms
=
0
;
millis_t
now
,
next_temp_ms
=
0
;
KEEPALIVE_STATE
(
NOT_BUSY
);
KEEPALIVE_STATE
(
NOT_BUSY
);
// Wait for temperature to come close enough
// Wait for temperature to come close enough
do
{
do
{
now
=
millis
();
now
=
millis
();
if
(
ELAPSED
(
now
,
next_temp_ms
))
{
//Print Temp Reading every 1 second while heating up.
if
(
ELAPSED
(
now
,
next_temp_ms
))
{
//Print Temp Reading every 1 second while heating up.
next_temp_ms
=
now
+
1000UL
;
next_temp_ms
=
now
+
1000UL
;
print_heaterstates
();
print_heaterstates
();
#if TEMP_BED_RESIDENCY_TIME > 0
#if TEMP_BED_RESIDENCY_TIME > 0
ECHO_M
(
SERIAL_W
);
ECHO_M
(
SERIAL_W
);
if
(
residency_start_ms
)
{
if
(
residency_start_ms
)
{
long
rem
=
(((
TEMP_BED_RESIDENCY_TIME
)
*
1000UL
)
-
(
now
-
residency_start_ms
))
/
1000UL
;
long
rem
=
(((
TEMP_BED_RESIDENCY_TIME
)
*
1000UL
)
-
(
now
-
residency_start_ms
))
/
1000UL
;
ECHO_EV
(
rem
);
ECHO_EV
(
rem
);
}
}
else
{
else
{
ECHO_EM
(
"?"
);
ECHO_EM
(
"?"
);
}
}
#else
#else
ECHO_E
;
ECHO_E
;
#endif
#endif
}
}
// Target temperature might be changed during the loop
// Target temperature might be changed during the loop
if
(
theTarget
!=
degTargetBed
())
{
if
(
theTarget
!=
degTargetBed
())
{
wants_to_cool
=
isCoolingBed
();
wants_to_cool
=
isCoolingBed
();
theTarget
=
degTargetBed
();
theTarget
=
degTargetBed
();
// Exit if S<lower>, continue if S<higher>, R<lower>, or R<higher>
// Exit if S<lower>, continue if S<higher>, R<lower>, or R<higher>
if
(
no_wait_for_cooling
&&
wants_to_cool
)
break
;
if
(
no_wait_for_cooling
&&
wants_to_cool
)
break
;
// Prevent a wait-forever situation if R is misused i.e. M190 R0
// Prevent a wait-forever situation if R is misused i.e. M190 R0
// Simply don't wait to cool a bed under 30C
// Simply don't wait to cool a bed under 30C
if
(
wants_to_cool
&&
theTarget
<
30
)
break
;
if
(
wants_to_cool
&&
theTarget
<
30
)
break
;
}
}
idle
();
idle
();
refresh_cmd_timeout
();
// to prevent stepper_inactive_time from running out
refresh_cmd_timeout
();
// to prevent stepper_inactive_time from running out
#if TEMP_BED_RESIDENCY_TIME > 0
#if TEMP_BED_RESIDENCY_TIME > 0
float
temp_diff
=
fabs
(
theTarget
-
degTargetBed
());
float
temp_diff
=
fabs
(
theTarget
-
degTargetBed
());
if
(
!
residency_start_ms
)
{
if
(
!
residency_start_ms
)
{
// Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time.
// Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time.
if
(
temp_diff
<
TEMP_BED_WINDOW
)
residency_start_ms
=
millis
();
if
(
temp_diff
<
TEMP_BED_WINDOW
)
residency_start_ms
=
millis
();
}
}
else
if
(
temp_diff
>
TEMP_BED_HYSTERESIS
)
{
else
if
(
temp_diff
>
TEMP_BED_HYSTERESIS
)
{
// Restart the timer whenever the temperature falls outside the hysteresis.
// Restart the timer whenever the temperature falls outside the hysteresis.
residency_start_ms
=
millis
();
residency_start_ms
=
millis
();
}
}
#endif //TEMP_BED_RESIDENCY_TIME > 0
#endif //TEMP_BED_RESIDENCY_TIME > 0
}
while
(
!
cancel_heatup
&&
TEMP_BED_CONDITIONS
);
}
while
(
!
cancel_heatup
&&
TEMP_BED_CONDITIONS
);
LCD_MESSAGEPGM
(
MSG_BED_DONE
);
LCD_MESSAGEPGM
(
MSG_BED_DONE
);
KEEPALIVE_STATE
(
IN_HANDLER
);
KEEPALIVE_STATE
(
IN_HANDLER
);
}
}
#endif // HAS(TEMP_BED)
#if HAS(TEMP_CHAMBER)
#if HAS(TEMP_CHAMBER)
inline
void
wait_chamber
(
bool
no_wait_for_heating
=
true
)
{
inline
void
wait_chamber
(
bool
no_wait_for_heating
=
true
)
{
...
@@ -7882,8 +7884,10 @@ inline void gcode_M503() {
...
@@ -7882,8 +7884,10 @@ inline void gcode_M503() {
setTargetHotend
(
old_target_temperature
[
e
],
e
);
setTargetHotend
(
old_target_temperature
[
e
],
e
);
wait_heater
();
wait_heater
();
}
}
setTargetBed
(
old_target_temperature_bed
);
#if HAS(TEMP_BED)
wait_bed
();
setTargetBed
(
old_target_temperature_bed
);
wait_bed
();
#endif
}
}
// Show load message
// Show load message
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment