Skip to content

Commit

Permalink
Build for Adafruit Feather RP2040 with USB Host
Browse files Browse the repository at this point in the history
  • Loading branch information
jfedor2 committed Apr 24, 2023
1 parent 8999622 commit 96f2067
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build-rp2040.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,15 @@ jobs:
PICO_BOARD=remapper cmake ..
make remapper_dual_a
cd ..
mkdir build-feather
cd build-feather
PICO_BOARD=feather_host cmake ..
make remapper
cd ..
mkdir artifacts
mv build/*.uf2 artifacts
mv build-boards/remapper_dual_a.uf2 artifacts/remapper_board.uf2
mv build-feather/remapper.uf2 artifacts/remapper_feather.uf2
working-directory: ./firmware
- uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions firmware/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ add_executable(remapper
src/interval_override.cc
)

if(PICO_BOARD STREQUAL "pico")
target_compile_definitions(remapper PUBLIC PICO_DEFAULT_UART_TX_PIN=16)
target_compile_definitions(remapper PUBLIC PICO_DEFAULT_UART_RX_PIN=17)
target_compile_definitions(remapper PUBLIC PIO_USB_DP_PIN=0)
endif()

target_include_directories(remapper PRIVATE
src
Expand Down
60 changes: 60 additions & 0 deletions firmware/src/boards/feather_host.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// -----------------------------------------------------
// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
// -----------------------------------------------------

#ifndef _BOARDS_FEATHER_HOST_H
#define _BOARDS_FEATHER_HOST_H

#define FEATHER_HOST_BOARD

// On some samples, the xosc can take longer to stabilize than is usual
#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
#endif

//------------- UART -------------//
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif

#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif

#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif

//------------- LED -------------//
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 13
#endif

#ifndef PICO_DEFAULT_WS2812_PIN
#define PICO_DEFAULT_WS2812_PIN 21
#endif

// --- FLASH ---

#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1

#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2
#endif

#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
#endif

#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0
#endif

// --- PIO USB ---

#ifndef PIO_USB_DP_PIN
#define PIO_USB_DP_PIN 16
#endif

#endif

0 comments on commit 96f2067

Please sign in to comment.