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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
c16818b2
Unverified
Commit
c16818b2
authored
Apr 16, 2020
by
Giuliano Zaro
Committed by
GitHub
Apr 16, 2020
Browse files
Options
Downloads
Patches
Plain Diff
Fix SAMD51 timer usage (#17471)
parent
78a50795
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Marlin/src/HAL/SAMD51/Servo.cpp
+4
-4
4 additions, 4 deletions
Marlin/src/HAL/SAMD51/Servo.cpp
Marlin/src/HAL/SAMD51/inc/SanityCheck.h
+4
-0
4 additions, 0 deletions
Marlin/src/HAL/SAMD51/inc/SanityCheck.h
with
8 additions
and
4 deletions
Marlin/src/HAL/SAMD51/Servo.cpp
+
4
−
4
View file @
c16818b2
...
...
@@ -55,7 +55,7 @@
static
volatile
int8_t
currentServoIndex
[
_Nbr_16timers
];
// index for the servo being pulsed for each timer (or -1 if refresh interval)
FORCE_INLINE
static
uint16_t
getTimerCount
()
{
Tc
*
const
tc
=
TimerConfig
[
SERVO_TC
].
pT
imer
;
Tc
*
const
tc
=
TimerConfig
[
SERVO_TC
].
pT
c
;
tc
->
COUNT16
.
CTRLBSET
.
reg
=
TC_CTRLBCLR_CMD_READSYNC
;
SYNC
(
tc
->
COUNT16
.
SYNCBUSY
.
bit
.
CTRLB
||
tc
->
COUNT16
.
SYNCBUSY
.
bit
.
COUNT
);
...
...
@@ -67,7 +67,7 @@ FORCE_INLINE static uint16_t getTimerCount() {
// Interrupt handler for the TC
// ----------------------------
HAL_SERVO_TIMER_ISR
()
{
Tc
*
const
tc
=
TimerConfig
[
SERVO_TC
].
pT
imer
;
Tc
*
const
tc
=
TimerConfig
[
SERVO_TC
].
pT
c
;
const
timer16_Sequence_t
timer
=
#ifndef _useTimer1
_timer2
...
...
@@ -127,7 +127,7 @@ HAL_SERVO_TIMER_ISR() {
}
void
initISR
(
timer16_Sequence_t
timer
)
{
Tc
*
const
tc
=
TimerConfig
[
SERVO_TC
].
pT
imer
;
Tc
*
const
tc
=
TimerConfig
[
SERVO_TC
].
pT
c
;
const
uint8_t
tcChannel
=
TIMER_TCCHANNEL
(
timer
);
static
bool
initialized
=
false
;
// Servo TC has been initialized
...
...
@@ -204,7 +204,7 @@ void initISR(timer16_Sequence_t timer) {
}
void
finISR
(
timer16_Sequence_t
timer
)
{
Tc
*
const
tc
=
TimerConfig
[
SERVO_TC
].
pT
imer
;
Tc
*
const
tc
=
TimerConfig
[
SERVO_TC
].
pT
c
;
const
uint8_t
tcChannel
=
TIMER_TCCHANNEL
(
timer
);
// Disable the match channel interrupt request
...
...
...
...
This diff is collapsed.
Click to expand it.
Marlin/src/HAL/SAMD51/inc/SanityCheck.h
+
4
−
0
View file @
c16818b2
...
...
@@ -35,6 +35,10 @@
#error "OnBoard SPI BUS can't be shared with other devices."
#endif
#if SERVO_TC == RTC_TIMER_NUM
#error "Servos can't use RTC timer"
#endif
#if ENABLED(EMERGENCY_PARSER)
#error "EMERGENCY_PARSER is not yet implemented for SAMD51. Disable EMERGENCY_PARSER to continue."
#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