diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d1d4ed..9afe32d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,44 +7,40 @@ on: types: - created +env: + PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk + jobs: build: + strategy: + fail-fast: false + matrix: + sdk_version: + - '2.0.0' + - '1.5.1' runs-on: ubuntu-latest steps: - - name: Setup Python - uses: actions/setup-python@v3 + - name: Install ARM GCC + uses: carlosperate/arm-none-eabi-gcc-action@v1 + with: + release: '12.3.Rel1' - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout pico-sdk - run: | - git clone --depth 1 -b develop https://github.com/raspberrypi/pico-sdk ~/pico-sdk - echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk - # checkout tinyusb in pico-sdk and switch to PR branch - git -C ~/pico-sdk submodule update --init - git -C ~/pico-sdk/lib/tinyusb fetch - git -C ~/pico-sdk/lib/tinyusb checkout master - - - name: Set Toolchain URL - run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz - - - name: Cache Toolchain - uses: actions/cache@v3 - id: cache-toolchain + uses: actions/checkout@v4 with: - path: ~/cache/ - key: ${{ runner.os }}-22-05-05-${{ env.TOOLCHAIN_URL }} + repository: raspberrypi/pico-sdk + ref: ${{ matrix.sdk_version }} + path: pico-sdk - - name: Install Toolchain - if: steps.cache-toolchain.outputs.cache-hit != 'true' + - name: Checkout TinyUSB run: | - mkdir -p ~/cache/toolchain - wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz - tar -C ~/cache/toolchain -xaf toolchain.tar.gz - - - name: Set Toolchain Path - run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin` + # checkout tinyusb in pico-sdk and switch to master branch + git -C $PICO_SDK_PATH submodule update --init + git -C $PICO_SDK_PATH/lib/tinyusb fetch + git -C $PICO_SDK_PATH/lib/tinyusb checkout master - name: Build run: | @@ -54,9 +50,9 @@ jobs: cmake .. make - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: - name: example_binaries + name: example_binaries-sdk-${{ matrix.sdk_version }} path: | examples/build/usb_device/usb_device.uf2 examples/build/usb_device/usb_device.hex diff --git a/.github/workflows/build_arduino.yml b/.github/workflows/build_arduino.yml index f43f3e2..60953db 100644 --- a/.github/workflows/build_arduino.yml +++ b/.github/workflows/build_arduino.yml @@ -18,11 +18,8 @@ jobs: runs-on: ubuntu-latest steps: - - name: Setup Python - uses: actions/setup-python@v3 - - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Arduino CLI run: | diff --git a/examples/capture_hid_report/capture_hid_report.c b/examples/capture_hid_report/capture_hid_report.c index 8eb4c61..e0927b6 100644 --- a/examples/capture_hid_report/capture_hid_report.c +++ b/examples/capture_hid_report/capture_hid_report.c @@ -2,6 +2,7 @@ #include #include +#include "hardware/clocks.h" #include "pico/stdlib.h" #include "pico/multicore.h" #include "pico/bootrom.h" diff --git a/examples/host_hid_to_device_cdc/host_hid_to_device_cdc.c b/examples/host_hid_to_device_cdc/host_hid_to_device_cdc.c index d7e4d1e..7f717bd 100644 --- a/examples/host_hid_to_device_cdc/host_hid_to_device_cdc.c +++ b/examples/host_hid_to_device_cdc/host_hid_to_device_cdc.c @@ -33,6 +33,7 @@ #include #include +#include "hardware/clocks.h" #include "pico/stdlib.h" #include "pico/multicore.h" #include "pico/bootrom.h" diff --git a/examples/test_ll/test_ll.c b/examples/test_ll/test_ll.c index 522cd0d..5ad402a 100644 --- a/examples/test_ll/test_ll.c +++ b/examples/test_ll/test_ll.c @@ -3,6 +3,7 @@ #include #include +#include "hardware/clocks.h" #include "hardware/gpio.h" #include "hardware/sync.h" #include "pico/stdlib.h" diff --git a/examples/usb_device/usb_device.c b/examples/usb_device/usb_device.c index fd94735..bcd53f3 100644 --- a/examples/usb_device/usb_device.c +++ b/examples/usb_device/usb_device.c @@ -3,6 +3,7 @@ #include #include +#include "hardware/clocks.h" #include "pico/stdlib.h" #include "pico/multicore.h" #include "pico/bootrom.h" diff --git a/src/usb_rx.pio b/src/usb_rx.pio index 04514a8..76e6fbe 100644 --- a/src/usb_rx.pio +++ b/src/usb_rx.pio @@ -156,11 +156,13 @@ J2: % c-sdk { #include "hardware/clocks.h" +#if PICO_SDK_VERSION_MAJOR < 2 static __always_inline void pio_sm_set_jmp_pin(PIO pio, uint sm, uint jmp_pin) { pio->sm[sm].execctrl = (pio->sm[sm].execctrl & ~PIO_SM0_EXECCTRL_JMP_PIN_BITS) | (jmp_pin << PIO_SM0_EXECCTRL_JMP_PIN_LSB); } +#endif static inline void usb_rx_fs_program_init(PIO pio, uint sm, uint offset, uint pin_dp, uint pin_dm, int pin_debug) { if (pin_dp < pin_dm) { diff --git a/src/usb_rx.pio.h b/src/usb_rx.pio.h index 33638cf..4beaa35 100644 --- a/src/usb_rx.pio.h +++ b/src/usb_rx.pio.h @@ -173,11 +173,13 @@ static inline pio_sm_config usb_nrzi_decoder_debug_program_get_default_config(ui } #include "hardware/clocks.h" +#if PICO_SDK_VERSION_MAJOR < 2 static __always_inline void pio_sm_set_jmp_pin(PIO pio, uint sm, uint jmp_pin) { pio->sm[sm].execctrl = (pio->sm[sm].execctrl & ~PIO_SM0_EXECCTRL_JMP_PIN_BITS) | (jmp_pin << PIO_SM0_EXECCTRL_JMP_PIN_LSB); } +#endif static inline void usb_rx_fs_program_init(PIO pio, uint sm, uint offset, uint pin_dp, uint pin_dm, int pin_debug) { if (pin_dp < pin_dm) { pio_sm_set_consecutive_pindirs(pio, sm, pin_dp, 2, false);