Skip to content
Open
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
120 changes: 74 additions & 46 deletions .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
###########################

HyperSerialPico:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v6.0.2
Expand All @@ -19,7 +19,7 @@ jobs:
- name: Install GNU Arm Embedded Toolchain
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '12.2.Rel1'
release: '14.2.Rel1'

- name: Build packages
shell: bash
Expand All @@ -30,101 +30,129 @@ jobs:
cmake --build . --config Release

- uses: actions/upload-artifact@v7.0.0
name: Upload artifacts (commit)
if: (startsWith(github.event.ref, 'refs/tags') != true)
name: Upload artifacts (release)
with:
name: firmware-release-generic-RP2040
path: |
firmware/*.uf2

- name: Build packages for generic RP2350
shell: bash
run: |
cd build
rm -rf *
rm -rf ../firmware/*
cmake -DTARGET_BOARD=pico2 -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
zip -j ../firmware/firmware_generic_RP2350.zip ../firmware/*

- uses: actions/upload-artifact@v7.0.0
name: Upload artifacts (release)
if: startsWith(github.ref, 'refs/tags/')
name: Upload artifacts (release generic RP2350)
with:
name: firmware-release-generic
name: firmware-release-generic-RP2350
archive: false
path: |
firmware/*.uf2
firmware/*.zip

- name: Build packages for Adafruit Feather RP2040 Scorpio (release-only)
if: startsWith(github.ref, 'refs/tags/')
- name: Build packages for Adafruit Feather RP2040 Scorpio
shell: bash
run: |
cd build
rm *.*
rm ../firmware/*
echo "Neopixel is using GPIO16(OUTPUT_DATA_PIN) on output 0." > ../firmware/Firmwares_for_Adafruit_Feather_RP2040_Scorpio.txt
echo "SPI is using spi0 interface pins: GPIO19(OUTPUT_SPI_DATA_PIN) and GPIO18(OUTPUT_SPI_CLOCK_PIN) on output 3 and 2 respectively." >> ../firmware/Firmwares_for_Adafruit_Feather_RP2040_Scorpio.txt
rm -rf *
rm -rf ../firmware/*
echo "Neopixel is using GPIO16(OUTPUT_DATA_PIN) on output 0." > ../firmware/Pinout_for_Adafruit_Feather_RP2040_Scorpio.txt
echo "SPI is using spi0 interface pins: GPIO19(OUTPUT_SPI_DATA_PIN) and GPIO18(OUTPUT_SPI_CLOCK_PIN) on output 3 and 2 respectively." >> ../firmware/Pinout_for_Adafruit_Feather_RP2040_Scorpio.txt
cmake -DOVERRIDE_BOOT_WORKAROUND=ON -DOVERRIDE_DATA_PIN=16 -DOVERRIDE_SPI_DATA_PIN=19 -DOVERRIDE_SPI_CLOCK_PIN=18 -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
zip -j ../firmware/Adafruit_Feather_RP2040_Scorpio.zip ../firmware/*

- uses: actions/upload-artifact@v7.0.0
name: Upload artifacts (release Adafruit_Feather)
if: startsWith(github.ref, 'refs/tags/')
name: Upload artifacts (release for Adafruit_Feather_RP2040)
with:
name: firmware-release-adafruit-scorpio
name: firmware-release-adafruit-scorpio-RP2040
archive: false
path: |
firmware/*.zip

- name: Build packages for Adafruit ItsyBitsy RP2040 (release-only)
if: startsWith(github.ref, 'refs/tags/')
- name: Build packages for Adafruit ItsyBitsy RP2040
shell: bash
run: |
cd build
rm *.*
rm ../firmware/*
echo "Neopixel is using GPIO14(OUTPUT_DATA_PIN) on output 5." > ../firmware/Firmwares_for_Adafruit_ItsyBitsy_2040.txt
rm -rf *
rm -rf ../firmware/*
echo "Neopixel is using GPIO14(OUTPUT_DATA_PIN) on output 5." > ../firmware/Pinout_for_Adafruit_ItsyBitsy_RP2040.txt
cmake -DOVERRIDE_BOOT_WORKAROUND=ON -DOVERRIDE_DATA_PIN=14 -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
rm ../firmware/*_Spi.uf2
zip -j ../firmware/Adafruit_ItsyBitsy_2040.zip ../firmware/*
rm ../firmware/*_ws2801.uf2
zip -j ../firmware/Adafruit_ItsyBitsy_RP2040.zip ../firmware/*

- uses: actions/upload-artifact@v7.0.0
name: Upload artifacts (release Adafruit_ItsyBitsy)
if: startsWith(github.ref, 'refs/tags/')
name: Upload artifacts (release for Adafruit_ItsyBitsy_RP2040)
with:
name: firmware-release-adafruit-itsybitsy
name: firmware-release-adafruit-itsybitsy-RP2040
archive: false
path: |
firmware/*.zip

- name: Build packages for Pimoroni Plasma Stick 2040 W (release-only)
if: startsWith(github.ref, 'refs/tags/')
- name: Build packages for Pimoroni Plasma Stick RP2040 W
shell: bash
run: |
cd build
rm *.*
rm ../firmware/*
echo "Neopixel is using GPIO15(OUTPUT_DATA_PIN) on output PIXELS." > ../firmware/Firmwares_for_Pimoroni_Plasma_Stick_2040_W.txt
rm -rf *
rm -rf ../firmware/*
echo "Neopixel is using GPIO15(OUTPUT_DATA_PIN) on output PIXELS." > ../firmware/Pinout_for_Pimoroni_Plasma_Stick_RP2040_W.txt
cmake -DOVERRIDE_DATA_PIN=15 -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
rm ../firmware/*_Spi.uf2
zip -j ../firmware/Pimoroni_Plasma_Stick_2040_W.zip ../firmware/*
rm ../firmware/*_ws2801.uf2
zip -j ../firmware/Pimoroni_Plasma_Stick_RP2040_W.zip ../firmware/*

- uses: actions/upload-artifact@v7.0.0
name: Upload artifacts (release Pimoroni_Plasma_Stick_W)
if: startsWith(github.ref, 'refs/tags/')
name: Upload artifacts (release for Pimoroni_Plasma_Stick_RP2040_W)
with:
name: firmware-release-pimoroni-plasma-stick
name: firmware-release-pimoroni-plasma-stick-RP2040-W
archive: false
path: |
firmware/*.zip

- name: Build packages for Pimoroni Plasma 2040 (release-only)
if: startsWith(github.ref, 'refs/tags/')
- name: Build packages for Pimoroni Plasma 2040
shell: bash
run: |
cd build
rm *.*
rm ../firmware/*
echo "Neopixel is using GPIO15(OUTPUT_DATA_PIN) on output DA." > ../firmware/Firmwares_for_Pimoroni_Plasma_2040.txt
echo "SPI is using spi1 interface pins: GPIO15(OUTPUT_SPI_DATA_PIN) and GPIO14(OUTPUT_SPI_CLOCK_PIN) on output DA and CL respectively." >> ../firmware/Firmwares_for_Pimoroni_Plasma_2040.txt
rm -rf *
rm -rf ../firmware/*
echo "Neopixel is using GPIO15(OUTPUT_DATA_PIN) on output DA." > ../firmware/Pinout_for_Pimoroni_Plasma_RP2040.txt
echo "SPI is using spi1 interface pins: GPIO15(OUTPUT_SPI_DATA_PIN) and GPIO14(OUTPUT_SPI_CLOCK_PIN) on output DA and CL respectively." >> ../firmware/Pinout_for_Pimoroni_Plasma_RP2040.txt
cmake -DOVERRIDE_DATA_PIN=15 -DOVERRIDE_SPI_INTERFACE=spi1 -DOVERRIDE_SPI_DATA_PIN=15 -DOVERRIDE_SPI_CLOCK_PIN=14 -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
zip -j ../firmware/Pimoroni_Plasma_2040.zip ../firmware/*
zip -j ../firmware/Pimoroni_Plasma_RP2040.zip ../firmware/*

- uses: actions/upload-artifact@v7.0.0
name: Upload artifacts (release for Pimoroni_Plasma_RP2040)
with:
name: firmware-release-pimoroni-plasma-RP2040
archive: false
path: |
firmware/*.zip

- name: Build packages for Pimoroni Plasma RP2350
shell: bash
run: |
cd build
rm -rf *
rm -rf ../firmware/*
echo "Neopixel is using GPIO15(OUTPUT_DATA_PIN) on output DA." > ../firmware/Pinout_for_Pimoroni_Plasma_RP2350.txt
echo "SPI is using spi1 interface pins: GPIO15(OUTPUT_SPI_DATA_PIN) and GPIO14(OUTPUT_SPI_CLOCK_PIN) on output DA and CL respectively." >> ../firmware/Pinout_for_Pimoroni_Plasma_RP2350.txt
cmake -DTARGET_BOARD=pimoroni_plasma2350 -DOVERRIDE_DATA_PIN=15 -DOVERRIDE_SPI_INTERFACE=spi1 -DOVERRIDE_SPI_DATA_PIN=15 -DOVERRIDE_SPI_CLOCK_PIN=14 -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
zip -j ../firmware/Pimoroni_Plasma_RP2350.zip ../firmware/*

- uses: actions/upload-artifact@v7.0.0
name: Upload artifacts (release Pimoroni_Plasma)
if: startsWith(github.ref, 'refs/tags/')
name: Upload artifacts (release for Pimoroni_Plasma_RP2350)
with:
name: firmware-release-pimoroni-plasma
name: firmware-release-pimoroni-plasma-RP2350
archive: false
path: |
firmware/*.zip

Expand All @@ -136,7 +164,7 @@ jobs:
name: Publish Releases
if: startsWith(github.event.ref, 'refs/tags')
needs: [HyperSerialPico]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
Expand Down
28 changes: 23 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,26 @@ add_definitions ( -DPICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE=0 )
# initialize the SDK based on PICO_SDK_PATH
# note: this must happen before project()
set(PICO_SDK_PATH ${CMAKE_CURRENT_SOURCE_DIR}/sdk/pico)
set(FREERTOS_KERNEL_PATH ${CMAKE_CURRENT_SOURCE_DIR}/sdk/freertos)
# FreeRTOS config
add_library(freertos_config INTERFACE)
target_include_directories(freertos_config INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/sdk/config )
set(FREERTOS_KERNEL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/sdk/freertos")

# Target: 'pico' (RP2040) or 'pico2' (RP2350)
set(TARGET_BOARD "pico" CACHE STRING "Target board: pico or pico2")
set(PICO_BOARD ${TARGET_BOARD})

include(${PICO_SDK_PATH}/external/pico_sdk_import.cmake)

if (PICO_RP2350)
set(FREERTOS_PORT "GCC_ARM_CM33_NTZ" CACHE STRING "")
else()
set(FREERTOS_PORT "GCC_ARM_CM0" CACHE STRING "")
endif()

include(${FREERTOS_KERNEL_PATH}/portable/ThirdParty/GCC/RP2040/FreeRTOS_Kernel_import.cmake)

project(HyperSerialPico C CXX ASM)
project("HyperSerialPico_${PICO_CHIP}" C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

Expand All @@ -53,8 +67,8 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC)
pico_sdk_init()

# generic HyperSerialPico settings
set(HyperSerialPicoCompanionLibs FreeRTOS-Kernel FreeRTOS-Kernel-Heap1 pico_stdlib pico_multicore hardware_pio hardware_dma hardware_spi)
set(HyperSerialPicoCompanionIncludes ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/sdk/config)
set(HyperSerialPicoCompanionIncludes ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/sdk/config ${PICO_SDK_PATH}/src/rp2_common/pico_stdio_usb/include ${PICO_SDK_PATH}/src/common/pico_usb_reset_interface_headers/include)
set(HyperSerialPicoCompanionLibs FreeRTOS-Kernel freertos_config FreeRTOS-Kernel-Heap1 tinyusb_board tinyusb_device pico_stdlib pico_multicore hardware_pio hardware_dma hardware_spi)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/generated)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/firmware)

Expand Down Expand Up @@ -114,10 +128,14 @@ macro(HyperSerialPicoTarget HyperSerialPicoTargetName)
if (BOOT_WORKAROUND)
target_compile_definitions(${HyperSerialPicoTargetName} PUBLIC -DBOOT_WORKAROUND -DPICO_XOSC_STARTUP_DELAY_MULTIPLIER=64)
endif()

target_compile_definitions(${HyperSerialPicoTargetName} PRIVATE -DPICO_STDIO_USB_USE_DEFAULT_DESCRIPTORS=1)
target_sources(${HyperSerialPicoTargetName} PRIVATE ${PICO_SDK_PATH}/src/rp2_common/pico_stdio_usb/stdio_usb_descriptors.c)

target_include_directories(${HyperSerialPicoTargetName} PRIVATE ${HyperSerialPicoCompanionIncludes})
target_link_libraries(${HyperSerialPicoTargetName} ${HyperSerialPicoCompanionLibs})
pico_add_extra_outputs(${HyperSerialPicoTargetName})
pico_enable_stdio_usb(${HyperSerialPicoTargetName} 1)
pico_enable_stdio_usb(${HyperSerialPicoTargetName} 0)
pico_enable_stdio_uart(${HyperSerialPicoTargetName} 0)
pico_generate_pio_header(${HyperSerialPicoTargetName} ${CMAKE_CURRENT_SOURCE_DIR}/pio/neopixel.pio OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/generated)
pico_generate_pio_header(${HyperSerialPicoTargetName} ${CMAKE_CURRENT_SOURCE_DIR}/pio/neopixel_ws2812b.pio OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/generated)
Expand Down
3 changes: 0 additions & 3 deletions include/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ class Base
// handle to tasks
TaskHandle_t processDataHandle = nullptr;
TaskHandle_t processSerialHandle = nullptr;
// semaphore to synchronize them
semaphore_t serialSemaphore;
semaphore_t receiverSemaphore;
// current queue position
volatile int queueCurrent = 0;
// queue end position
Expand Down
8 changes: 4 additions & 4 deletions include/calibration.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ class CalibrationConfig
* @brief print RGBW calibration parameters when no data is received
*
*/
void printCalibration()
template <size_t N>
void printCalibration(char (&output)[N])
{
char output[128];
snprintf(output, sizeof(output),"RGBW => Gain: %i/255, red: %i, green: %i, blue: %i\r\n", gain, red, green, blue);
printf(output);
snprintf(output, N, "RGBW => Gain: %i/255, red: %i, green: %i, blue: %i\r\n", gain, red, green, blue);
tud_cdc_write_str(output);
}
} calibrationConfig;

Expand Down
Loading