Skip to content

Commit 7902e9f

Browse files
Merge pull request sekigon-gonnoc#126 from adafruit/sdk2_fix
Remove pio_sm_set_jmp_pin because Pico SDK 2 has it
2 parents fe3b1e2 + 770e3b2 commit 7902e9f

File tree

8 files changed

+34
-33
lines changed

8 files changed

+34
-33
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,40 @@ on:
77
types:
88
- created
99

10+
env:
11+
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
12+
1013
jobs:
1114
build:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
sdk_version:
19+
- '2.0.0'
20+
- '1.5.1'
1221
runs-on: ubuntu-latest
1322
steps:
14-
- name: Setup Python
15-
uses: actions/setup-python@v3
23+
- name: Install ARM GCC
24+
uses: carlosperate/arm-none-eabi-gcc-action@v1
25+
with:
26+
release: '12.3.Rel1'
1627

1728
- name: Checkout
18-
uses: actions/checkout@v3
29+
uses: actions/checkout@v4
1930

2031
- name: Checkout pico-sdk
21-
run: |
22-
git clone --depth 1 -b develop https://github.com/raspberrypi/pico-sdk ~/pico-sdk
23-
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
24-
# checkout tinyusb in pico-sdk and switch to PR branch
25-
git -C ~/pico-sdk submodule update --init
26-
git -C ~/pico-sdk/lib/tinyusb fetch
27-
git -C ~/pico-sdk/lib/tinyusb checkout master
28-
29-
- name: Set Toolchain URL
30-
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
31-
32-
- name: Cache Toolchain
33-
uses: actions/cache@v3
34-
id: cache-toolchain
32+
uses: actions/checkout@v4
3533
with:
36-
path: ~/cache/
37-
key: ${{ runner.os }}-22-05-05-${{ env.TOOLCHAIN_URL }}
34+
repository: raspberrypi/pico-sdk
35+
ref: ${{ matrix.sdk_version }}
36+
path: pico-sdk
3837

39-
- name: Install Toolchain
40-
if: steps.cache-toolchain.outputs.cache-hit != 'true'
38+
- name: Checkout TinyUSB
4139
run: |
42-
mkdir -p ~/cache/toolchain
43-
wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz
44-
tar -C ~/cache/toolchain -xaf toolchain.tar.gz
45-
46-
- name: Set Toolchain Path
47-
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
40+
# checkout tinyusb in pico-sdk and switch to master branch
41+
git -C $PICO_SDK_PATH submodule update --init
42+
git -C $PICO_SDK_PATH/lib/tinyusb fetch
43+
git -C $PICO_SDK_PATH/lib/tinyusb checkout master
4844
4945
- name: Build
5046
run: |
@@ -54,9 +50,9 @@ jobs:
5450
cmake ..
5551
make
5652
57-
- uses: actions/upload-artifact@v3
53+
- uses: actions/upload-artifact@v4
5854
with:
59-
name: example_binaries
55+
name: example_binaries-sdk-${{ matrix.sdk_version }}
6056
path: |
6157
examples/build/usb_device/usb_device.uf2
6258
examples/build/usb_device/usb_device.hex

.github/workflows/build_arduino.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ jobs:
1818

1919
runs-on: ubuntu-latest
2020
steps:
21-
- name: Setup Python
22-
uses: actions/setup-python@v3
23-
2421
- name: Checkout
25-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2623

2724
- name: Install Arduino CLI
2825
run: |

examples/capture_hid_report/capture_hid_report.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <stdio.h>
33
#include <string.h>
44

5+
#include "hardware/clocks.h"
56
#include "pico/stdlib.h"
67
#include "pico/multicore.h"
78
#include "pico/bootrom.h"

examples/host_hid_to_device_cdc/host_hid_to_device_cdc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <stdio.h>
3434
#include <string.h>
3535

36+
#include "hardware/clocks.h"
3637
#include "pico/stdlib.h"
3738
#include "pico/multicore.h"
3839
#include "pico/bootrom.h"

examples/test_ll/test_ll.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <string.h>
44
#include <strings.h>
55

6+
#include "hardware/clocks.h"
67
#include "hardware/gpio.h"
78
#include "hardware/sync.h"
89
#include "pico/stdlib.h"

examples/usb_device/usb_device.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <stdio.h>
44
#include <string.h>
55

6+
#include "hardware/clocks.h"
67
#include "pico/stdlib.h"
78
#include "pico/multicore.h"
89
#include "pico/bootrom.h"

src/usb_rx.pio

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,13 @@ J2:
156156
% c-sdk {
157157
#include "hardware/clocks.h"
158158

159+
#if PICO_SDK_VERSION_MAJOR < 2
159160
static __always_inline void pio_sm_set_jmp_pin(PIO pio, uint sm, uint jmp_pin) {
160161
pio->sm[sm].execctrl =
161162
(pio->sm[sm].execctrl & ~PIO_SM0_EXECCTRL_JMP_PIN_BITS) |
162163
(jmp_pin << PIO_SM0_EXECCTRL_JMP_PIN_LSB);
163164
}
165+
#endif
164166

165167
static inline void usb_rx_fs_program_init(PIO pio, uint sm, uint offset, uint pin_dp, uint pin_dm, int pin_debug) {
166168
if (pin_dp < pin_dm) {

src/usb_rx.pio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,13 @@ static inline pio_sm_config usb_nrzi_decoder_debug_program_get_default_config(ui
173173
}
174174

175175
#include "hardware/clocks.h"
176+
#if PICO_SDK_VERSION_MAJOR < 2
176177
static __always_inline void pio_sm_set_jmp_pin(PIO pio, uint sm, uint jmp_pin) {
177178
pio->sm[sm].execctrl =
178179
(pio->sm[sm].execctrl & ~PIO_SM0_EXECCTRL_JMP_PIN_BITS) |
179180
(jmp_pin << PIO_SM0_EXECCTRL_JMP_PIN_LSB);
180181
}
182+
#endif
181183
static inline void usb_rx_fs_program_init(PIO pio, uint sm, uint offset, uint pin_dp, uint pin_dm, int pin_debug) {
182184
if (pin_dp < pin_dm) {
183185
pio_sm_set_consecutive_pindirs(pio, sm, pin_dp, 2, false);

0 commit comments

Comments
 (0)