Skip to content

Commit c5d107a

Browse files
committed
pico-sdk: Update new code with Zephyr API changes
New code introduced to the SDK needs to be compatible with the Zephyr changes. - Change use of hardware_alarm_callback_t to match 0938995 . - Change use of irq_set_enabled to pico_irq_is_enabled to match 827be28 . Locally tested to confirm that this builds as required. Signed-off-by: Andrew Featherstone <[email protected]>
1 parent 9c7a841 commit c5d107a

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

ChangeLog.zephyr.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ Need to take care to not break these changes when updating pico-sdk.
1010
- [#7] pico-sdk: hardware_timer: Don't add irq handler to interrupt vector
1111
- src/rp2_common/hardware_timer/timer.c
1212
- [#6] pico-sdk: hardware_timer: Add argument to irq handler to handle userdata
13+
- src/host/hardware_timer/include/hardware/timer.h
1314
- src/rp2_common/hardware_timer/include/hardware/timer.h
1415
- src/rp2_common/hardware_timer/timer.c
16+
- test/pico_time_test/pico_time_test.c
1517
- [#5] pico-sdk: Rename is_irq_enabled() to pico_is_irq_enabled()
18+
- src/host/hardware_irq/include/hardware/irq.h
1619
- src/rp2_common/hardware_irq/include/hardware/irq.h
1720
- src/rp2_common/hardware_irq/irq.c
1821
- src/rp2_common/pico_multicore/multicore.c

src/host/hardware_irq/include/hardware/irq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ void irq_set_enabled(uint num, bool enabled);
174174
* \param num Interrupt number \ref interrupt_nums
175175
* \return true if the interrupt is enabled
176176
*/
177-
bool irq_is_enabled(uint num);
177+
bool pico_irq_is_enabled(uint num);
178178

179179
/*! \brief Enable/disable multiple interrupts on the executing core
180180
* \ingroup hardware_irq

src/host/hardware_timer/include/hardware/timer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void busy_wait_us(uint64_t delay_us);
3333
void busy_wait_ms(uint32_t delay_m);
3434
void busy_wait_until(absolute_time_t t);
3535
bool time_reached(absolute_time_t t);
36-
typedef void (*hardware_alarm_callback_t)(uint alarm_num);
36+
typedef void (*hardware_alarm_callback_t)(uint alarm_num, void *data);
3737
void hardware_alarm_claim(uint alarm_num);
3838
void hardware_alarm_unclaim(uint alarm_num);
3939
int hardware_alarm_claim_unused(bool required);

src/rp2_common/pico_multicore/multicore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void multicore_reset_core1(void) {
115115
// own purposes (expecting FIFO content after core 1 is launched). We must disable
116116
// the IRQ during the handshake, then restore afterward
117117
uint irq_num = SIO_FIFO_IRQ_NUM(0);
118-
bool enabled = irq_is_enabled(irq_num);
118+
bool enabled = pico_irq_is_enabled(irq_num);
119119
irq_set_enabled(irq_num, false);
120120

121121
// Bring core 1 back out of reset. It will drain its own mailbox FIFO, then push

test/pico_time_test/pico_time_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static bool timer_callback_issue_1953(repeating_timer_t *rt) {
295295
}
296296

297297
// Callback should only occur if the alarm is set in the past
298-
static void alarm_pool_stuck_issue_1953(uint alarm) {
298+
static void alarm_pool_stuck_issue_1953(uint alarm, void *data) {
299299
hard_assert(false);
300300
}
301301

0 commit comments

Comments
 (0)