1919
2020#define usb_edge_detector_wrap_target 3
2121#define usb_edge_detector_wrap 9
22+ #define usb_edge_detector_pio_version 0
2223
2324static const uint16_t usb_edge_detector_program_instructions [] = {
2425 0xc022 , // 0: irq wait 2
@@ -47,6 +48,10 @@ static const struct pio_program usb_edge_detector_program = {
4748 .instructions = usb_edge_detector_program_instructions ,
4849 .length = 17 ,
4950 .origin = -1 ,
51+ .pio_version = 0 ,
52+ #if PICO_PIO_VERSION > 0
53+ .used_gpio_ranges = 0x0
54+ #endif
5055};
5156
5257static inline pio_sm_config usb_edge_detector_program_get_default_config (uint offset ) {
@@ -62,6 +67,7 @@ static inline pio_sm_config usb_edge_detector_program_get_default_config(uint of
6267
6368#define usb_edge_detector_debug_wrap_target 3
6469#define usb_edge_detector_debug_wrap 9
70+ #define usb_edge_detector_debug_pio_version 0
6571
6672static const uint16_t usb_edge_detector_debug_program_instructions [] = {
6773 0xc022 , // 0: irq wait 2 side 0
@@ -90,6 +96,10 @@ static const struct pio_program usb_edge_detector_debug_program = {
9096 .instructions = usb_edge_detector_debug_program_instructions ,
9197 .length = 17 ,
9298 .origin = -1 ,
99+ .pio_version = 0 ,
100+ #if PICO_PIO_VERSION > 0
101+ .used_gpio_ranges = 0x0
102+ #endif
93103};
94104
95105static inline pio_sm_config usb_edge_detector_debug_program_get_default_config (uint offset ) {
@@ -106,6 +116,7 @@ static inline pio_sm_config usb_edge_detector_debug_program_get_default_config(u
106116
107117#define usb_nrzi_decoder_wrap_target 0
108118#define usb_nrzi_decoder_wrap 6
119+ #define usb_nrzi_decoder_pio_version 0
109120
110121static const uint16_t usb_nrzi_decoder_program_instructions [] = {
111122 // .wrap_target
@@ -127,6 +138,10 @@ static const struct pio_program usb_nrzi_decoder_program = {
127138 .instructions = usb_nrzi_decoder_program_instructions ,
128139 .length = 10 ,
129140 .origin = -1 ,
141+ .pio_version = 0 ,
142+ #if PICO_PIO_VERSION > 0
143+ .used_gpio_ranges = 0x0
144+ #endif
130145};
131146
132147static inline pio_sm_config usb_nrzi_decoder_program_get_default_config (uint offset ) {
@@ -142,6 +157,7 @@ static inline pio_sm_config usb_nrzi_decoder_program_get_default_config(uint off
142157
143158#define usb_nrzi_decoder_debug_wrap_target 0
144159#define usb_nrzi_decoder_debug_wrap 6
160+ #define usb_nrzi_decoder_debug_pio_version 0
145161
146162static const uint16_t usb_nrzi_decoder_debug_program_instructions [] = {
147163 // .wrap_target
@@ -163,6 +179,10 @@ static const struct pio_program usb_nrzi_decoder_debug_program = {
163179 .instructions = usb_nrzi_decoder_debug_program_instructions ,
164180 .length = 10 ,
165181 .origin = -1 ,
182+ .pio_version = 0 ,
183+ #if PICO_PIO_VERSION > 0
184+ .used_gpio_ranges = 0x0
185+ #endif
166186};
167187
168188static inline pio_sm_config usb_nrzi_decoder_debug_program_get_default_config (uint offset ) {
@@ -173,6 +193,13 @@ static inline pio_sm_config usb_nrzi_decoder_debug_program_get_default_config(ui
173193}
174194
175195#include "hardware/clocks.h"
196+ #if PICO_SDK_VERSION_MAJOR < 2
197+ static __always_inline void pio_sm_set_jmp_pin (PIO pio , uint sm , uint jmp_pin ) {
198+ pio -> sm [sm ].execctrl =
199+ (pio -> sm [sm ].execctrl & ~PIO_SM0_EXECCTRL_JMP_PIN_BITS ) |
200+ (jmp_pin << PIO_SM0_EXECCTRL_JMP_PIN_LSB );
201+ }
202+ #endif
176203static inline void usb_rx_fs_program_init (PIO pio , uint sm , uint offset , uint pin_dp , uint pin_dm , int pin_debug ) {
177204 if (pin_dp < pin_dm ) {
178205 pio_sm_set_consecutive_pindirs (pio , sm , pin_dp , 2 , false);
0 commit comments