Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
52974889
Commit
52974889
authored
12 years ago
by
daid303
Browse files
Options
Downloads
Patches
Plain Diff
Minor changes in the temperature code for some cleanup.
parent
4e26ecc9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/temperature.cpp
+27
-38
27 additions, 38 deletions
Marlin/temperature.cpp
with
27 additions
and
38 deletions
Marlin/temperature.cpp
+
27
−
38
View file @
52974889
...
...
@@ -111,33 +111,24 @@ static volatile bool temp_meas_ready = false;
unsigned
long
watchmillis
=
0
;
#endif //WATCHPERIOD
// Init min and max temp with extreme values to prevent false errors during startup
static
int
minttemp
[
EXTRUDERS
]
=
{
0
};
static
int
maxttemp
[
EXTRUDERS
]
=
{
16383
};
// the first value used for all
static
int
bed_minttemp
=
0
;
static
int
bed_maxttemp
=
16383
;
static
void
*
heater_ttbl_map
[
EXTRUDERS
]
=
{
(
void
*
)
heater_0_temptable
#if EXTRUDERS > 1
,
(
void
*
)
heater_1_temptable
#endif
#if EXTRUDERS > 2
,
(
void
*
)
heater_2_temptable
#endif
#if EXTRUDERS > 3
#error Unsupported number of extruders
#endif
};
static
int
heater_ttbllen_map
[
EXTRUDERS
]
=
{
heater_0_temptable_len
#if EXTRUDERS > 1
,
heater_1_temptable_len
#endif
#if EXTRUDERS > 2
,
heater_2_temptable_len
#endif
#if EXTRUDERS > 3
#error Unsupported number of extruders
# error Unsupported number of extruders
#elif EXTRUDERS > 2
# define ARRAY_BY_EXTRUDERS(v1, v2, v3) { v1, v2, v3 }
#elif EXTRUDERS > 1
# define ARRAY_BY_EXTRUDERS(v1, v2, v3) { v1, v2 }
#else
# define ARRAY_BY_EXTRUDERS(v1, v2, v3) { v1 }
#endif
};
// Init min and max temp with extreme values to prevent false errors during startup
static
int
minttemp
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
(
0
,
0
,
0
);
static
int
maxttemp
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
(
16383
,
16383
,
16383
);
// the first value used for all
static
int
bed_minttemp
=
0
;
static
int
bed_maxttemp
=
16383
;
static
void
*
heater_ttbl_map
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
((
void
*
)
heater_0_temptable
,
(
void
*
)
heater_1_temptable
,
(
void
*
)
heater_2_temptable
);
static
int
heater_ttbllen_map
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
(
heater_0_temptable_len
,
heater_1_temptable_len
,
heater_2_temptable_len
);
//===========================================================================
//============================= functions ============================
...
...
@@ -820,6 +811,9 @@ void max_temp_error(uint8_t e) {
SERIAL_ERRORLN
((
int
)
e
);
SERIAL_ERRORLNPGM
(
": Extruder switched off. MAXTEMP triggered !"
);
}
#ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
Stop
();
#endif
}
void
min_temp_error
(
uint8_t
e
)
{
...
...
@@ -829,6 +823,9 @@ void min_temp_error(uint8_t e) {
SERIAL_ERRORLN
((
int
)
e
);
SERIAL_ERRORLNPGM
(
": Extruder switched off. MINTEMP triggered !"
);
}
#ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
Stop
();
#endif
}
void
bed_max_temp_error
(
void
)
{
...
...
@@ -839,16 +836,19 @@ void bed_max_temp_error(void) {
SERIAL_ERROR_START
;
SERIAL_ERRORLNPGM
(
"Temperature heated bed switched off. MAXTEMP triggered !!"
);
}
#ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
Stop
();
#endif
}
#define HEAT_INTERVAL 250
#ifdef HEATER_0_USES_MAX6675
#define MAX6675_HEAT_INTERVAL 250
long
max6675_previous_millis
=
-
HEAT_INTERVAL
;
int
max6675_temp
=
2000
;
int
read_max6675
()
{
if
(
millis
()
-
max6675_previous_millis
<
HEAT_INTERVAL
)
if
(
millis
()
-
max6675_previous_millis
<
MAX6675_
HEAT_INTERVAL
)
return
max6675_temp
;
max6675_previous_millis
=
millis
();
...
...
@@ -1077,20 +1077,10 @@ ISR(TIMER0_COMPB_vect)
if
(
current_raw
[
e
]
>=
maxttemp
[
e
])
{
target_raw
[
e
]
=
0
;
max_temp_error
(
e
);
#ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
{
Stop
();;
}
#endif
}
if
(
current_raw
[
e
]
<=
minttemp
[
e
])
{
target_raw
[
e
]
=
0
;
min_temp_error
(
e
);
#ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
{
Stop
();
}
#endif
}
}
...
...
@@ -1098,7 +1088,6 @@ ISR(TIMER0_COMPB_vect)
if
(
current_raw_bed
>=
bed_maxttemp
)
{
target_raw_bed
=
0
;
bed_max_temp_error
();
Stop
();
}
#endif
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment