Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pico-sdk
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microcontroller
pico-sdk
Commits
9290bdde
Unverified
Commit
9290bdde
authored
1 year ago
by
Sonya Vasquez
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix harware_alarm_irq_number typo (#1619)
parent
2de70c79
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/rp2_common/hardware_timer/timer.c
+4
-4
4 additions, 4 deletions
src/rp2_common/hardware_timer/timer.c
with
4 additions
and
4 deletions
src/rp2_common/hardware_timer/timer.c
+
4
−
4
View file @
9290bdde
...
@@ -106,7 +106,7 @@ void busy_wait_until(absolute_time_t t) {
...
@@ -106,7 +106,7 @@ void busy_wait_until(absolute_time_t t) {
}
}
/// \end::busy_wait[]
/// \end::busy_wait[]
static
inline
uint
harware_alarm_irq_number
(
uint
alarm_num
)
{
static
inline
uint
har
d
ware_alarm_irq_number
(
uint
alarm_num
)
{
return
TIMER_IRQ_0
+
alarm_num
;
return
TIMER_IRQ_0
+
alarm_num
;
}
}
...
@@ -150,7 +150,7 @@ void hardware_alarm_set_callback(uint alarm_num, hardware_alarm_callback_t callb
...
@@ -150,7 +150,7 @@ void hardware_alarm_set_callback(uint alarm_num, hardware_alarm_callback_t callb
// note this should probably be subsumed by irq_set_exclusive_handler anyway, since that
// note this should probably be subsumed by irq_set_exclusive_handler anyway, since that
// should disallow IRQ handlers on both cores
// should disallow IRQ handlers on both cores
check_hardware_alarm_num_param
(
alarm_num
);
check_hardware_alarm_num_param
(
alarm_num
);
uint
irq_num
=
harware_alarm_irq_number
(
alarm_num
);
uint
irq_num
=
har
d
ware_alarm_irq_number
(
alarm_num
);
spin_lock_t
*
lock
=
spin_lock_instance
(
PICO_SPINLOCK_ID_TIMER
);
spin_lock_t
*
lock
=
spin_lock_instance
(
PICO_SPINLOCK_ID_TIMER
);
uint32_t
save
=
spin_lock_blocking
(
lock
);
uint32_t
save
=
spin_lock_blocking
(
lock
);
if
(
callback
)
{
if
(
callback
)
{
...
@@ -208,7 +208,7 @@ bool hardware_alarm_set_target(uint alarm_num, absolute_time_t target) {
...
@@ -208,7 +208,7 @@ bool hardware_alarm_set_target(uint alarm_num, absolute_time_t target) {
timer_hw
->
intr
=
1u
<<
alarm_num
;
timer_hw
->
intr
=
1u
<<
alarm_num
;
// ... including anything pending on the processor - perhaps unnecessary, but
// ... including anything pending on the processor - perhaps unnecessary, but
// our timer flag says we aren't expecting anything.
// our timer flag says we aren't expecting anything.
irq_clear
(
harware_alarm_irq_number
(
alarm_num
));
irq_clear
(
har
d
ware_alarm_irq_number
(
alarm_num
));
// and clear our flag so that if the IRQ handler is already active (because it is on
// and clear our flag so that if the IRQ handler is already active (because it is on
// the other core) it will also skip doing anything
// the other core) it will also skip doing anything
timer_callbacks_pending
=
old_timer_callbacks_pending
;
timer_callbacks_pending
=
old_timer_callbacks_pending
;
...
...
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