Skip to content

Commit

Permalink
Update tinyusb, drive EN pin on boost converter
Browse files Browse the repository at this point in the history
Updates TinyUSB with the latest upstream changes and makes it so that
pin 18 is driven high on the Feather USB Host board (connected to the
enable pin on the boost converter supplying 5V to connected USB
devices).

Please note there has been some confusing renaming of the Pico-PIO-USB
related pin defines in TinyUSB.
  • Loading branch information
jfedor2 committed Apr 26, 2023
1 parent 96f2067 commit 0c41f26
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion firmware/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ add_executable(remapper
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)
target_compile_definitions(remapper PUBLIC PICO_DEFAULT_PIO_USB_DP_PIN=0)
endif()

target_include_directories(remapper PRIVATE
Expand Down
22 changes: 20 additions & 2 deletions firmware/src/boards/feather_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,26 @@

// --- PIO USB ---

#ifndef PIO_USB_DP_PIN
#define PIO_USB_DP_PIN 16
// these are currently the defaults in tinyusb, but it has changed in the past

#ifndef PICO_DEFAULT_PIO_USB_DP_PIN
#define PICO_DEFAULT_PIO_USB_DP_PIN 16
#endif

#ifndef PICO_DEFAULT_PIO_USB_VBUSEN_PIN
#define PICO_DEFAULT_PIO_USB_VBUSEN_PIN 18
#endif

// note that tinyusb defines PICO_DEFAULT_PIO_USB_VBUSEN_STATE in board.h,
// but uses PIO_USB_VBUSEN_STATE in family.c

#ifndef PIO_USB_VBUSEN_STATE
#define PIO_USB_VBUSEN_STATE 1
#endif

// note that tinyusb uses PICO_DEFAULT_PIO_USB_VBUSEN_PIN for the pin number,
// but PIO_USB_VBUSEN_PIN to decide whether to use it or not

#define PIO_USB_VBUSEN_PIN

#endif
2 changes: 1 addition & 1 deletion firmware/tinyusb
Submodule tinyusb updated 913 files

0 comments on commit 0c41f26

Please sign in to comment.