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
b232f393
Commit
b232f393
authored
7 years ago
by
Scott Lahteine
Browse files
Options
Downloads
Patches
Plain Diff
AVR: Hidden option to use 8s watchdog
parent
9d4cfd20
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp
+10
-4
10 additions, 4 deletions
Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp
with
10 additions
and
4 deletions
Marlin/src/HAL/HAL_AVR/watchdog_AVR.cpp
+
10
−
4
View file @
b232f393
...
@@ -30,16 +30,22 @@
...
@@ -30,16 +30,22 @@
#include
"../../Marlin.h"
#include
"../../Marlin.h"
// Initialize watchdog with
a 4 sec interrupt time
// Initialize watchdog with
8s timeout, if possible. Otherwise, make it 4s.
void
watchdog_init
()
{
void
watchdog_init
()
{
#if ENABLED(WATCHDOG_DURATION_8S) && defined(WDTO_8S)
#define WDTO_NS WDTO_8S
#else
#define WDTO_NS WDTO_4S
#endif
#if ENABLED(WATCHDOG_RESET_MANUAL)
#if ENABLED(WATCHDOG_RESET_MANUAL)
// We enable the watchdog timer, but only for the interrupt.
// We enable the watchdog timer, but only for the interrupt.
// Take care, as this requires the correct order of operation, with interrupts disabled. See the datasheet of any AVR chip for details.
// Take care, as this requires the correct order of operation, with interrupts disabled.
// See the datasheet of any AVR chip for details.
wdt_reset
();
wdt_reset
();
_WD_CONTROL_REG
=
_BV
(
_WD_CHANGE_BIT
)
|
_BV
(
WDE
);
_WD_CONTROL_REG
=
_BV
(
_WD_CHANGE_BIT
)
|
_BV
(
WDE
);
_WD_CONTROL_REG
=
_BV
(
WDIE
)
|
WDTO_
4
S
;
_WD_CONTROL_REG
=
_BV
(
WDIE
)
|
WDTO_
N
S
;
#else
#else
wdt_enable
(
WDTO_
4
S
);
wdt_enable
(
WDTO_
N
S
);
#endif
#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