Skip to content

Commit

Permalink
Merge branch 'main' into fix/buffer-overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sekigon-gonnoc committed Aug 24, 2024
2 parents 2c19e57 + 7902e9f commit dddb76b
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 33 deletions.
54 changes: 25 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/build_arduino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
1 change: 1 addition & 0 deletions examples/capture_hid_report/capture_hid_report.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <stdio.h>
#include <string.h>

#include "hardware/clocks.h"
#include "pico/stdlib.h"
#include "pico/multicore.h"
#include "pico/bootrom.h"
Expand Down
1 change: 1 addition & 0 deletions examples/host_hid_to_device_cdc/host_hid_to_device_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <stdio.h>
#include <string.h>

#include "hardware/clocks.h"
#include "pico/stdlib.h"
#include "pico/multicore.h"
#include "pico/bootrom.h"
Expand Down
1 change: 1 addition & 0 deletions examples/test_ll/test_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <string.h>
#include <strings.h>

#include "hardware/clocks.h"
#include "hardware/gpio.h"
#include "hardware/sync.h"
#include "pico/stdlib.h"
Expand Down
1 change: 1 addition & 0 deletions examples/usb_device/usb_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <stdio.h>
#include <string.h>

#include "hardware/clocks.h"
#include "pico/stdlib.h"
#include "pico/multicore.h"
#include "pico/bootrom.h"
Expand Down
2 changes: 2 additions & 0 deletions src/usb_rx.pio
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions src/usb_rx.pio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dddb76b

Please sign in to comment.