Skip to content

Commit

Permalink
#1851 fix signature of hardware_alarm_get_irq_num
Browse files Browse the repository at this point in the history
  • Loading branch information
kilograham committed Aug 20, 2024
1 parent e930bf3 commit 58a1a4d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/rp2_common/hardware_timer/include/hardware/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ extern "C" {
#ifndef TIMER_ALARM_IRQ_NUM
#if NUM_GENERIC_TIMERS == 1
static_assert(TIMER_IRQ_3 == TIMER_IRQ_0 + 3, "");
#define TIMER_ALARM_IRQ_NUM(timer, alarm_num) (TIMER_IRQ_0 + (alarm_num))
#define TIMER_ALARM_IRQ_NUM(timer, alarm_num) ({ ((void)(timer)); (TIMER_IRQ_0 + (alarm_num)); })
#else
static_assert(TIMER1_IRQ_3 == TIMER0_IRQ_0 + 7, "");
#define TIMER_ALARM_IRQ_NUM(timer, alarm_num) (TIMER0_IRQ_0 + TIMER_NUM(timer) * NUM_ALARMS + (alarm_num))
Expand Down Expand Up @@ -554,18 +554,17 @@ void hardware_alarm_force_irq(uint alarm_num);
* \param alarm_num the alarm number
* \sa TIMER_ALARM_IRQ_NUM
*/
static inline uint timer_hardware_alarm_get_irq_num(__unused timer_hw_t *timer, uint alarm_num) {
static inline uint timer_hardware_alarm_get_irq_num(timer_hw_t *timer, uint alarm_num) {
check_hardware_alarm_num_param(alarm_num);
return TIMER_ALARM_IRQ_NUM(timer, alarm_num);
}

/**
* \ingroup hardware_timer
* \brief Returns the \ref irq_num_t for the alarm interrupt from the given alarm on the default timer instance
* \param timer the timer instance
* \param alarm_num the alarm number
*/
static inline uint hardware_alarm_get_irq_num(timer_hw_t *timer, uint alarm_num) {
static inline uint hardware_alarm_get_irq_num(uint alarm_num) {
return timer_hardware_alarm_get_irq_num(PICO_DEFAULT_TIMER_INSTANCE(), alarm_num);
}

Expand Down

0 comments on commit 58a1a4d

Please sign in to comment.