Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions .github/actions/setup_toolchain/download/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,38 @@ runs:
curl -L "$TOOLCHAIN_URL" -o toolchain.zip
unzip -q toolchain.zip -d ~/cache/${TOOLCHAIN}
~/cache/${TOOLCHAIN}/xpack-arm-none-eabi-gcc-14.2.1-1.1/bin/arm-none-eabi-gcc.exe --version
elif [[ ${FILE_EXT} == gz ]]; then
wget --progress=dot:giga ${TOOLCHAIN_URL} -O toolchain.tar.gz
tar -C ~/cache/${TOOLCHAIN} -xaf toolchain.tar.gz
else
echo "Unsupported toolchain file extension: ${FILE_EXT}"
exit 1
# Handle tarballs regardless of compression suffix (.gz, .xz, .bz2, etc.).
wget --progress=dot:giga ${TOOLCHAIN_URL} -O toolchain.tar
tar -C ~/cache/${TOOLCHAIN} -xaf toolchain.tar
fi
shell: bash

- name: Setup Toolchain
env:
TOOLCHAIN: ${{ inputs.toolchain }}
run: |
apt_install_with_retry() {
for attempt in 1 2 3; do
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends "$@" && return 0

if [[ "$attempt" -eq 3 ]]; then
echo "apt install failed after $attempt attempts: $*"
return 1
fi

echo "apt install failed, retrying in 15s..."
sleep 15
done
}

if [[ ${TOOLCHAIN} == arm-iar ]]; then
sudo dpkg -i ~/cache/${TOOLCHAIN}/iar-lmsc-tools.deb
sudo apt install -y ~/cache/${TOOLCHAIN}/cxarm.deb
apt_install_with_retry ~/cache/${TOOLCHAIN}/cxarm.deb
TOOLCHAIN_PATH="/opt/iar/cxarm/arm/bin"
elif [[ ${TOOLCHAIN} == ft9xx-gcc ]]; then
sudo apt install -y ~/cache/${TOOLCHAIN}/ft9xxtoolchain.deb
apt_install_with_retry ~/cache/${TOOLCHAIN}/ft9xxtoolchain.deb
TOOLCHAIN_PATH="/opt/ft32/bin"
else
# Find the single toolchain bin directory
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,18 @@ jobs:

- name: Build Fuzzer
run: |
sudo apt install libc++-dev libc++abi-dev
for attempt in 1 2 3; do
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends libc++-dev libc++abi-dev && break

if [ "$attempt" -eq 3 ]; then
echo "apt install failed after $attempt attempts"
exit 1
fi

echo "apt install failed, retrying in 15s..."
sleep 15
done
clang --version
export CC=clang
export CXX=clang++
Expand Down
2 changes: 1 addition & 1 deletion examples/device/webusb_serial/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_requ
return false;
}

void tud_vendor_rx_cb(uint8_t idx, const uint8_t *buffer, uint32_t bufsize) {
void tud_vendor_rx_cb(uint8_t idx, const uint8_t *buffer, uint16_t bufsize) {
(void)idx;
(void)buffer;
(void)bufsize;
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/test/device/midi2/test_midi2_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "tusb_types.h"
#include "class/audio/audio.h"
#include "class/midi/midi.h"
#include "device/usbd.h"
#include "midi_descriptor_macros.h"

void setUp(void) {}
void tearDown(void) {}
Expand Down
2 changes: 1 addition & 1 deletion test/unit-test/test/device/msc/test_msc_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "tusb_fifo.h"
#include "tusb.h"
#include "usbd.h"
TEST_SOURCE_FILE("usbd_control.c")
TEST_SOURCE_FILE("usbd.c")
TEST_SOURCE_FILE("msc_device.c")

// Mock File
Expand Down
6 changes: 6 additions & 0 deletions test/unit-test/test/support/midi_descriptor_macros.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef MIDI_DESCRIPTOR_MACROS_H_
#define MIDI_DESCRIPTOR_MACROS_H_

#include "device/usbd.h"

#endif
Loading