Skip to content

Commit

Permalink
sdk 1.5 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler committed Jan 26, 2025
1 parent b559b3e commit 21b0b3e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/sdk_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ static __always_inline void pio_sm_set_jmp_pin(PIO pio, uint sm, uint jmp_pin) {
(pio->sm[sm].execctrl & ~PIO_SM0_EXECCTRL_JMP_PIN_BITS) |
(jmp_pin << PIO_SM0_EXECCTRL_JMP_PIN_LSB);
}

static_assert(PIO1_BASE - PIO0_BASE == (1u << 20), "hardware layout mismatch");
#define PIO_INSTANCE(instance) ((pio_hw_t *)(PIO0_BASE + (instance) * (1u << 20)))
static __always_inline PIO pio_get_instance(uint instance) {
return PIO_INSTANCE(instance);
}

#define NUM_PIO_IRQS (2u)
#define PIO_IRQ_NUM(pio, irqn) (PIO0_IRQ_0 + NUM_PIO_IRQS * PIO_NUM(pio) + (irqn))

#endif

#if PICO_SDK_VERSION_MAJOR < 2 || (PICO_SDK_VERSION_MAJOR == 2 && PICO_SDK_VERSION_MINOR < 1)
Expand Down

0 comments on commit 21b0b3e

Please sign in to comment.