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
24e956d1
Commit
24e956d1
authored
5 years ago
by
Tanguy Pruvot
Committed by
Scott Lahteine
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Avoid int8_t underflow on filament runout (#13895)
parent
483822f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/src/feature/runout.h
+5
-2
5 additions, 2 deletions
Marlin/src/feature/runout.h
with
5 additions
and
2 deletions
Marlin/src/feature/runout.h
+
5
−
2
View file @
24e956d1
...
...
@@ -41,6 +41,9 @@
#endif
//#define FILAMENT_RUNOUT_SENSOR_DEBUG
#ifndef FILAMENT_RUNOUT_THRESHOLD
#define FILAMENT_RUNOUT_THRESHOLD 5
#endif
class
FilamentMonitorBase
{
public:
...
...
@@ -337,11 +340,11 @@ class FilamentSensorBase {
class
RunoutResponseDebounced
{
private:
static
constexpr
int8_t
runout_threshold
=
5
;
static
constexpr
int8_t
runout_threshold
=
FILAMENT_RUNOUT_THRESHOLD
;
static
int8_t
runout_count
;
public:
static
inline
void
reset
()
{
runout_count
=
runout_threshold
;
}
static
inline
void
run
()
{
runout_count
--
;
}
static
inline
void
run
()
{
if
(
runout_count
>=
0
)
runout_count
--
;
}
static
inline
bool
has_run_out
()
{
return
runout_count
<
0
;
}
static
inline
void
block_completed
(
const
block_t
*
const
b
)
{
UNUSED
(
b
);
}
static
inline
void
filament_present
(
const
uint8_t
extruder
)
{
runout_count
=
runout_threshold
;
UNUSED
(
extruder
);
}
...
...
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