Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion cmake/pico_pre_load_toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(PICO_TOOLCHAIN_PATH "${PICO_TOOLCHAIN_PATH}" CACHE INTERNAL "")
# Set a default build type if none was specified
set(default_build_type "Release")

list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_PREFIX_PATH)
list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_PREFIX_PATH PICO_SDK_PATH)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Defaulting build type to '${default_build_type}' since not specified.")
Expand Down
26 changes: 14 additions & 12 deletions pico_sdk_version.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, default=Current SDK major version, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, default=Current SDK major version, group=pico_base
set(PICO_SDK_VERSION_MAJOR 2)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, default=Current SDK minor version, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, default=Current SDK minor version, group=pico_base
set(PICO_SDK_VERSION_MINOR 1)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, default=Current SDK revision, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, default=Current SDK revision, group=pico_base
set(PICO_SDK_VERSION_REVISION 2)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_PRE_RELEASE_ID, Optional SDK pre-release version identifier, default=Current SDK pre-release identifier, type=string, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_PRE_RELEASE_ID, Optional SDK pre-release version identifier, default=Current SDK pre-release identifier, type=string, group=pico_base
set(PICO_SDK_VERSION_PRE_RELEASE_ID develop)
if (NOT DEFINED PICO_SDK_VERSION_MAJOR)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, default=Current SDK major version, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_MAJOR, SDK major version number, type=int, default=Current SDK major version, group=pico_base
set(PICO_SDK_VERSION_MAJOR 2)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, default=Current SDK minor version, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_MINOR, SDK minor version number, type=int, default=Current SDK minor version, group=pico_base
set(PICO_SDK_VERSION_MINOR 1)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, default=Current SDK revision, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_REVISION, SDK version revision, type=int, default=Current SDK revision, group=pico_base
set(PICO_SDK_VERSION_REVISION 2)
# PICO_BUILD_DEFINE: PICO_SDK_VERSION_PRE_RELEASE_ID, Optional SDK pre-release version identifier, default=Current SDK pre-release identifier, type=string, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_PRE_RELEASE_ID, Optional SDK pre-release version identifier, default=Current SDK pre-release identifier, type=string, group=pico_base
set(PICO_SDK_VERSION_PRE_RELEASE_ID develop)
endif()

# PICO_BUILD_DEFINE: PICO_SDK_VERSION_STRING, SDK version string, type=string, default=Current SDK version string, group=pico_base
# PICO_CMAKE_CONFIG: PICO_SDK_VERSION_STRING, SDK version string, type=string, default=Current SDK version string, group=pico_base
Expand Down
2 changes: 2 additions & 0 deletions src/boards/include/boards/amethyst_fpga.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pico_board_cmake_set(PICO_PLATFORM, rp2350)
// For board detection
#define RASPBERRYPI_AMETHYST_FPGA

#define RASPBERRYPI_FPGA 1

#define PICO_NO_FPGA_CHECK 0

// --- UART ---
Expand Down
6 changes: 3 additions & 3 deletions src/cmake/rp2_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ pico_add_subdirectory(rp2_common/hardware_watchdog)
pico_add_subdirectory(rp2_common/hardware_xip_cache)
pico_add_subdirectory(rp2_common/hardware_xosc)

if (PICO_RP2350 OR PICO_COMBINED_DOCS)
if (PICO_COMBINED_DOCS OR NOT PICO_RP2040)
pico_add_subdirectory(rp2_common/hardware_powman)
# Note in spite of the name this is usable on Arm as well as RISC-V:
pico_add_subdirectory(rp2_common/hardware_riscv_platform_timer)
pico_add_subdirectory(rp2_common/hardware_sha256)
endif()

if (PICO_RP2350 OR PICO_COMBINED_DOCS)
if (PICO_COMBINED_DOCS OR NOT PICO_RP2040)
pico_add_subdirectory(rp2_common/hardware_dcp)
pico_add_subdirectory(rp2_common/hardware_rcp)
endif()
Expand Down Expand Up @@ -108,7 +108,7 @@ if (NOT PICO_BARE_METAL)
pico_add_subdirectory(rp2_common/pico_printf)
pico_add_subdirectory(rp2_common/pico_rand)

if (PICO_RP2350 OR PICO_COMBINED_DOCS)
if (PICO_COMBINED_DOCS OR NOT PICO_RP2040)
pico_add_subdirectory(rp2_common/pico_sha256)
endif()

Expand Down
9 changes: 9 additions & 0 deletions src/rp2040/hardware_regs/include/hardware/platform_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@

#define HAS_SIO_DIVIDER 1
#define HAS_RP2040_RTC 1

#ifndef FPGA_CLK_SYS_HZ
#define FPGA_CLK_SYS_HZ (48 * MHZ)
#endif

#ifndef FPGA_CLK_REF_HZ
#define FPGA_CLK_REF_HZ (12 * MHZ)
#endif

// PICO_CONFIG: XOSC_HZ, Crystal oscillator frequency in Hz, type=int, default=12000000, advanced=true, group=hardware_base
// NOTE: The system and USB clocks are generated from the frequency using two PLLs.
// If you override this define, or SYS_CLK_HZ/USB_CLK_HZ below, you will *also* need to add your own adjusted PLL set-up defines to
Expand Down
10 changes: 10 additions & 0 deletions src/rp2350/hardware_regs/include/hardware/platform_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@
#define HAS_POWMAN_TIMER 1
#define HAS_RP2350_TRNG 1
#define HAS_HSTX 1
#define HAS_PADS_BANK0_ISOLATION 1
#define __RISCV_PMP_CHECKED 1

#ifndef FPGA_CLK_SYS_HZ
#define FPGA_CLK_SYS_HZ (48 * MHZ)
#endif

#ifndef FPGA_CLK_REF_HZ
#define FPGA_CLK_REF_HZ (12 * MHZ)
#endif

// PICO_CONFIG: XOSC_HZ, Crystal oscillator frequency in Hz, type=int, default=12000000, advanced=true, group=hardware_base
// NOTE: The system and USB clocks are generated from the frequency using two PLLs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ typedef int (*bootrom_api_callback_generic_t)(uint32_t r0, uint32_t r1, uint32_t
#define BOOTROM_NS_API_get_b_partition 7
#define BOOTROM_NS_API_COUNT 8

#define OTP_CMD_ROW_BITS 0x0000ffffu
#define OTP_CMD_ROW_BITS _u(0x0000ffff)
#define OTP_CMD_ROW_LSB _u(0)
#define OTP_CMD_WRITE_BITS 0x00010000u
#define OTP_CMD_WRITE_BITS _u(0x00010000)
#define OTP_CMD_WRITE_LSB _u(16)
#define OTP_CMD_ECC_BITS 0x00020000u
#define OTP_CMD_ECC_BITS _u(0x00020000)
#define OTP_CMD_ECC_LSB _u(17)

#ifndef __ASSEMBLER__
Expand Down
4 changes: 2 additions & 2 deletions src/rp2_common/hardware_clocks/clocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,12 @@ static const uint8_t gpin0_src[CLK_COUNT] = {
CLOCKS_CLK_REF_CTRL_AUXSRC_VALUE_CLKSRC_GPIN0, // CLK_REF
CLOCKS_CLK_SYS_CTRL_AUXSRC_VALUE_CLKSRC_GPIN0, // CLK_SYS
CLOCKS_CLK_PERI_CTRL_AUXSRC_VALUE_CLKSRC_GPIN0, // CLK_PERI
#if !PICO_RP2040
#if HAS_HSTX
CLOCKS_CLK_HSTX_CTRL_AUXSRC_VALUE_CLKSRC_GPIN0, // CLK_HSTX
#endif
CLOCKS_CLK_USB_CTRL_AUXSRC_VALUE_CLKSRC_GPIN0, // CLK_USB
CLOCKS_CLK_ADC_CTRL_AUXSRC_VALUE_CLKSRC_GPIN0, // CLK_ADC
#if PICO_RP2040
#if HAS_RP2040_RTC
CLOCKS_CLK_RTC_CTRL_AUXSRC_VALUE_CLKSRC_GPIN0, // CLK_RTC
#endif
};
Expand Down
2 changes: 1 addition & 1 deletion src/rp2_common/hardware_gpio/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void gpio_set_function(uint gpio, gpio_function_t fn) {
// Zero all fields apart from fsel; we want this IO to do what the peripheral tells it.
// This doesn't affect e.g. pullup/pulldown, as these are in pad controls.
io_bank0_hw->io[gpio].ctrl = fn << IO_BANK0_GPIO0_CTRL_FUNCSEL_LSB;
#if !PICO_RP2040
#if HAS_PADS_BANK0_ISOLATION
// Remove pad isolation now that the correct peripheral is in control of the pad
hw_clear_bits(&pads_bank0_hw->io[gpio], PADS_BANK0_GPIO0_ISO_BITS);
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/rp2_common/hardware_rtc/include/hardware/rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
#define _HARDWARE_RTC_H

#include "pico.h"
#if HAS_RP2040_RTC
#include "hardware/structs/rtc.h"
#endif

/** \file hardware/rtc.h
* \defgroup hardware_rtc hardware_rtc
Expand Down
5 changes: 3 additions & 2 deletions src/rp2_common/pico_bit_ops/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ if (NOT TARGET pico_bit_ops)
${CMAKE_CURRENT_LIST_DIR}/bit_ops_aeabi.S
)

target_link_libraries(pico_bit_ops_pico INTERFACE pico_bootrom pico_bit_ops_headers)
target_link_libraries(pico_bit_ops_pico INTERFACE pico_bit_ops_headers)

if (NOT PICO_RP2350)
if (PICO_RP2040)
target_link_libraries(pico_bit_ops_pico INTERFACE pico_bootrom)
# gcc
pico_wrap_function(pico_bit_ops_pico __clzsi2)
pico_wrap_function(pico_bit_ops_pico __clzsi2)
Expand Down
2 changes: 2 additions & 0 deletions src/rp2_common/pico_bit_ops/bit_ops_aeabi.S
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
*/

#include "pico/asm_helper.S"
#if PICO_RP2040
#include "pico/bootrom.h"
#endif
#include "pico/runtime_init.h"

pico_default_asm_setup
Expand Down
2 changes: 1 addition & 1 deletion src/rp2_common/pico_bootrom/bootrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ int rom_add_flash_runtime_partition(uint32_t start_offset, uint32_t size, uint32
}

int rom_pick_ab_update_partition(uint32_t *workarea_base, uint32_t workarea_size, uint partition_a_num) {
#if PICO_RP2350
#if !PICO_RP2040
// Generated from adding the following code into the bootrom
// scan_workarea_t* scan_workarea = (scan_workarea_t*)workarea;
// printf("VERSION_DOWNGRADE_ERASE_ADDR %08x\n", &(always->zero_init.version_downgrade_erase_flash_addr));
Expand Down
2 changes: 1 addition & 1 deletion src/rp2_common/pico_bootrom/include/pico/bootrom.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ __force_inline static void *rom_hword_as_ptr(uint16_t rom_address) {

#ifdef __riscv
static __force_inline bool rom_size_is_64k(void) {
#ifdef RASPBERRYPI_AMETHYST_FPGA
#if RASPBERRYPI_FPGA
return *(uint16_t*)0x14 >= 0x8000;
#else
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/rp2_common/pico_btstack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ endif ()

set(BTSTACK_TEST_PATH "src/bluetooth.h")
if (NOT PICO_BTSTACK_PATH)
set(PICO_BTSTACK_PATH ${PROJECT_SOURCE_DIR}/lib/btstack)
set(PICO_BTSTACK_PATH ${PICO_SDK_PATH}/lib/btstack)
if (PICO_CYW43_SUPPORTED AND NOT EXISTS ${PICO_BTSTACK_PATH}/${BTSTACK_TEST_PATH})
message(WARNING "btstack submodule has not been initialized; Pico W BLE support will be unavailable.
hint: try 'git submodule update --init' from your SDK directory (${PICO_SDK_PATH}).")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "pico.h"
#if PICO_RP2040_B0_SUPPORTED || PICO_RP2040_B1_SUPPORTED
#include "pico/time.h"
#include "hardware/structs/usb.h"
#include "hardware/gpio.h"
Expand All @@ -17,7 +18,6 @@
#define LS_K 0b10
#define LS_SE1 0b11

#if PICO_RP2040_B0_SUPPORTED || PICO_RP2040_B1_SUPPORTED
static void hw_enumeration_fix_wait_se0(void);
static void hw_enumeration_fix_force_ls_j(void);
static void hw_enumeration_fix_finish(void);
Expand Down
2 changes: 1 addition & 1 deletion src/rp2_common/pico_lwip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ endif ()

set(LWIP_TEST_PATH "src/Filelists.cmake")
if (NOT PICO_LWIP_PATH)
set(PICO_LWIP_PATH ${PROJECT_SOURCE_DIR}/lib/lwip)
set(PICO_LWIP_PATH ${PICO_SDK_PATH}/lib/lwip)
if (PICO_CYW43_SUPPORTED AND NOT EXISTS ${PICO_LWIP_PATH}/${LWIP_TEST_PATH})
message(WARNING "LWIP submodule has not been initialized; Pico W wireless support will be unavailable
#hint: try 'git submodule update --init' from your SDK directory (${PICO_SDK_PATH}).")
Expand Down
2 changes: 1 addition & 1 deletion src/rp2_common/pico_mbedtls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ endif()

set(MBEDTLS_TEST_PATH "library/aes.c")
if (NOT PICO_MBEDTLS_PATH)
set(PICO_MBEDTLS_PATH ${PROJECT_SOURCE_DIR}/lib/mbedtls)
set(PICO_MBEDTLS_PATH ${PICO_SDK_PATH}/lib/mbedtls)
elseif (NOT EXISTS ${PICO_MBEDTLS_PATH}/${MBEDTLS_TEST_PATH})
message(WARNING "PICO_MBEDTLS_PATH specified but content not present.")
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/rp2_common/pico_multicore/multicore.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "hardware/structs/scb.h"
#endif
#include "hardware/structs/sio.h"
#include "hardware/regs/psm.h"
#include "hardware/structs/psm.h"
#include "hardware/claim.h"

#if !PICO_RP2040
Expand Down
1 change: 0 additions & 1 deletion src/rp2_common/pico_printf/printf_none.S
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

#include "pico/asm_helper.S"
#include "pico/bootrom/sf_table.h"

pico_default_asm_setup

Expand Down
7 changes: 6 additions & 1 deletion src/rp2_common/pico_rand/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ target_sources(pico_rand INTERFACE
target_include_directories(pico_rand_headers SYSTEM INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)

pico_mirrored_target_link_libraries(pico_rand INTERFACE
pico_unique_id
hardware_clocks
hardware_timer
hardware_sync
)

if (TARGET pico_unique_id)
pico_mirrored_target_link_libraries(pico_rand INTERFACE
pico_unique_id
)
endif()
4 changes: 4 additions & 0 deletions src/rp2_common/pico_rand/rand.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@
*/

#include "pico/rand.h"
#if PICO_RAND_SEED_ENTROPY_SRC_BOARD_ID
#include "pico/unique_id.h"
#endif
#include "pico/time.h"
#include "hardware/clocks.h"
#include "hardware/structs/rosc.h"
#if PICO_RAND_SEED_ENTROPY_SRC_BUS_PERF_COUNTER || PICO_RAND_ENTROPY_SRC_BUS_PERF_COUNTER
#include "hardware/structs/busctrl.h"
#endif
#include "hardware/sync.h"

static bool rng_initialised = false;
Expand Down
8 changes: 7 additions & 1 deletion src/rp2_common/pico_runtime_init/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ pico_mirrored_target_link_libraries(pico_runtime_init INTERFACE
)

if (TARGET hardware_clocks)
pico_mirrored_target_link_libraries(pico_runtime_init INTERFACE hardware_clocks hardware_timer hardware_vreg)
pico_mirrored_target_link_libraries(pico_runtime_init INTERFACE hardware_clocks)
endif()
if (TARGET hardware_timer)
pico_mirrored_target_link_libraries(pico_runtime_init INTERFACE hardware_timer)
endif()
if (TARGET hardware_vreg)
pico_mirrored_target_link_libraries(pico_runtime_init INTERFACE hardware_vreg)
endif()

# pico/runtime_init.h includes pico/runtime.h
Expand Down
4 changes: 2 additions & 2 deletions src/rp2_common/pico_runtime_init/runtime_init_clocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ void __weak runtime_init_clocks(void) {
// Note: These need setting *before* the ticks are started
if (running_on_fpga()) {
for (uint i = 0; i < CLK_COUNT; i++) {
clock_set_reported_hz(i, 48 * MHZ);
clock_set_reported_hz(i, FPGA_CLK_SYS_HZ);
}
// clk_ref is 12MHz in both RP2040 and RP2350 FPGA
clock_set_reported_hz(clk_ref, 12 * MHZ);
clock_set_reported_hz(clk_ref, FPGA_CLK_REF_HZ);
// RP2040 has an extra clock, the rtc
#if HAS_RP2040_RTC
clock_set_reported_hz(clk_rtc, RTC_CLOCK_FREQ_HZ);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void runtime_init_per_core_install_stack_guard(void *stack_bottom) {
| 0x10000000; // XN = disable instruction fetch; no other bits means no permissions

#elif defined(__riscv)
#if !PICO_RP2350
#if !__RISCV_PMP_CHECKED
#error "Check PMP configuration for new platform"
#endif
// RISC-V PMP, RP2350 configuration of Hazard3: 8 non-hardwired regions,
Expand Down
10 changes: 5 additions & 5 deletions src/rp2_common/pico_stdio_uart/stdio_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ void stdio_uart_deinit_full(struct uart_inst *uart, int tx_pin, int rx_pin) {
uart_instance = uart;
stdio_set_driver_enabled(&stdio_uart, false);
uart_deinit(uart_instance);
#if PICO_RP2040
#if HAS_PADS_BANK0_ISOLATION
// Leave pads isolated
if (tx_pin >= 0) hw_set_bits(&pads_bank0_hw->io[tx_pin], PADS_BANK0_GPIO0_ISO_BITS);
if (rx_pin >= 0) hw_set_bits(&pads_bank0_hw->io[rx_pin], PADS_BANK0_GPIO0_ISO_BITS);
#else
((void)tx_pin);
((void)rx_pin);
#else
// Leave pads isolated
if (tx_pin >= 0) hw_set_bits(&pads_bank0_hw->io[tx_pin], PADS_BANK0_GPIO0_ISO_BITS);
if (rx_pin >= 0) hw_set_bits(&pads_bank0_hw->io[rx_pin], PADS_BANK0_GPIO0_ISO_BITS);
#endif
}

Expand Down
28 changes: 18 additions & 10 deletions src/rp2_common/tinyusb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ if (DEFINED ENV{PICO_TINYUSB_PATH} AND (NOT PICO_TINYUSB_PATH))
message("Using PICO_TINYUSB_PATH from environment ('${PICO_TINYUSB_PATH}')")
endif ()

set(TINYUSB_TEST_PATH "src/portable/raspberrypi/rp2040")
set(TINYUSB_TEST_PATH "hw/bsp/rp2040")
if (NOT PICO_TINYUSB_PATH)
set(PICO_TINYUSB_PATH ${PROJECT_SOURCE_DIR}/lib/tinyusb)
set(PICO_TINYUSB_PATH ${PICO_SDK_PATH}/lib/tinyusb)
if (NOT EXISTS ${PICO_TINYUSB_PATH}/${TINYUSB_TEST_PATH})
message(WARNING "TinyUSB submodule has not been initialized; USB support will be unavailable
if (EXISTS "${PICO_TINYUSB_PATH}/LICENSE")
message(WARNING "TinyUSB submodule has been initialized, but does not contain ${TINYUSB_TEST_PATH}; USB support will be unavailable")
else()
message(WARNING "TinyUSB submodule has not been initialized; USB support will be unavailable
hint: try 'git submodule update --init' from your SDK directory (${PICO_SDK_PATH}).")
endif()
endif()
elseif (NOT EXISTS ${PICO_TINYUSB_PATH}/${TINYUSB_TEST_PATH})
message(WARNING "PICO_TINYUSB_PATH specified but content not present.")
message(WARNING "PICO_TINYUSB_PATH specified, but does not contain ${TINYUSB_TEST_PATH}; USB support will be unavailable")
endif()

if (EXISTS ${PICO_TINYUSB_PATH}/${TINYUSB_TEST_PATH})
Expand All @@ -35,14 +39,18 @@ if (EXISTS ${PICO_TINYUSB_PATH}/${TINYUSB_TEST_PATH})
PICO_RP2040_USB_DEVICE_UFRAME_FIX=1
)

# unmarked version used by stdio USB
target_link_libraries(tinyusb_device_unmarked INTERFACE tinyusb_common pico_fix_rp2040_usb_device_enumeration tinyusb_device_base)
if (TARGET tinyusb_device_base)
# unmarked version used by stdio USB
target_link_libraries(tinyusb_device_unmarked INTERFACE tinyusb_common pico_fix_rp2040_usb_device_enumeration tinyusb_device_base)

pico_add_library(tinyusb_device)
target_link_libraries(tinyusb_device INTERFACE tinyusb_device_unmarked)
pico_add_library(tinyusb_device)
target_link_libraries(tinyusb_device INTERFACE tinyusb_device_unmarked)
endif()

pico_add_library(tinyusb_host)
target_link_libraries(tinyusb_host INTERFACE tinyusb_host_base tinyusb_common)
if (TARGET tinyusb_host_base)
pico_add_library(tinyusb_host)
target_link_libraries(tinyusb_host INTERFACE tinyusb_host_base tinyusb_common)
endif()

pico_add_library(tinyusb_board)
target_include_directories(tinyusb_board INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
Expand Down
Loading
Loading