fix host midi build
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
||||
|
||||
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
||||
# gets PROJECT name for the example
|
||||
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
project(${PROJECT})
|
||||
project(${PROJECT} C CXX ASM)
|
||||
|
||||
# Checks this example is valid for the family and initializes the project
|
||||
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# Espressif has its own cmake build system
|
||||
if(FAMILY STREQUAL "espressif")
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_executable(${PROJECT})
|
||||
|
||||
# Example source
|
||||
@@ -22,6 +27,6 @@ target_include_directories(${PROJECT} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Configure compilation flags and libraries for the example... see the corresponding function
|
||||
# in hw/bsp/FAMILY/family.cmake for details.
|
||||
family_configure_host_example(${PROJECT})
|
||||
# Configure compilation flags and libraries for the example without RTOS.
|
||||
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
|
||||
family_configure_host_example(${PROJECT} noos)
|
||||
|
@@ -1,9 +1,13 @@
|
||||
include ../../../tools/top.mk
|
||||
include ../../make.mk
|
||||
include ../../build_system/make/make.mk
|
||||
|
||||
INC += \
|
||||
src \
|
||||
$(TOP)/hw \
|
||||
|
||||
# Example source
|
||||
EXAMPLE_SOURCE += $(wildcard src/*.c)
|
||||
EXAMPLE_SOURCE += \
|
||||
src/main.c
|
||||
|
||||
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
|
||||
include ../../rules.mk
|
||||
|
||||
include ../../build_system/make/rules.mk
|
||||
|
@@ -1 +1,20 @@
|
||||
mcu:ESP32S2
|
||||
mcu:ESP32S3
|
||||
mcu:ESP32P4
|
||||
mcu:KINETIS_KL
|
||||
mcu:LPC175X_6X
|
||||
mcu:LPC177X_8X
|
||||
mcu:LPC18XX
|
||||
mcu:LPC40XX
|
||||
mcu:LPC43XX
|
||||
mcu:MAX3421
|
||||
mcu:MIMXRT1XXX
|
||||
mcu:MIMXRT10XX
|
||||
mcu:MIMXRT11XX
|
||||
mcu:MSP432E4
|
||||
mcu:RP2040
|
||||
mcu:RX65X
|
||||
mcu:RAXXX
|
||||
mcu:STM32F4
|
||||
mcu:STM32F7
|
||||
mcu:STM32H7
|
||||
|
@@ -27,10 +27,8 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bsp/board.h"
|
||||
#include "bsp/board_api.h"
|
||||
#include "tusb.h"
|
||||
#include "class/midi/midi_host.h"
|
||||
|
||||
|
||||
#if CFG_TUH_MIDI
|
||||
|
||||
|
@@ -29,6 +29,7 @@ function(tinyusb_target_add TARGET)
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/host/hub.c
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/class/cdc/cdc_host.c
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/class/hid/hid_host.c
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/class/midi/midi_host.c
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/class/msc/msc_host.c
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/class/vendor/vendor_host.c
|
||||
# typec
|
||||
|
@@ -29,7 +29,7 @@
|
||||
#if (TUSB_OPT_HOST_ENABLED && CFG_TUH_MIDI)
|
||||
|
||||
#include "host/usbh.h"
|
||||
#include "host/usbh_classdriver.h"
|
||||
#include "host/usbh_pvt.h"
|
||||
|
||||
#include "midi_host.h"
|
||||
|
||||
@@ -131,7 +131,7 @@ static uint32_t write_flush(uint8_t dev_addr, midih_interface_t* midi);
|
||||
//--------------------------------------------------------------------+
|
||||
// USBH API
|
||||
//--------------------------------------------------------------------+
|
||||
void midih_init(void)
|
||||
bool midih_init(void)
|
||||
{
|
||||
tu_memclr(&_midi_host, sizeof(_midi_host));
|
||||
// config fifos
|
||||
@@ -146,6 +146,7 @@ void midih_init(void)
|
||||
tu_fifo_config_mutex(&p_midi_host->tx_ff, osal_mutex_create(&p_midi_host->tx_ff_mutex), NULL);
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool midih_xfer_cb(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes)
|
||||
|
@@ -107,7 +107,7 @@ uint8_t tuh_midi_get_all_istrings(uint8_t dev_addr, const uint8_t** istrings);
|
||||
//--------------------------------------------------------------------+
|
||||
// Internal Class Driver API
|
||||
//--------------------------------------------------------------------+
|
||||
void midih_init (void);
|
||||
bool midih_init (void);
|
||||
bool midih_open (uint8_t rhport, uint8_t dev_addr, tusb_desc_interface_t const *desc_itf, uint16_t max_len);
|
||||
bool midih_set_config (uint8_t dev_addr, uint8_t itf_num);
|
||||
bool midih_xfer_cb (uint8_t dev_addr, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes);
|
||||
|
@@ -1489,7 +1489,7 @@ static void process_enumeration(tuh_xfer_t* xfer) {
|
||||
dev->i_serial = desc_device->iSerialNumber;
|
||||
|
||||
if (tuh_desc_device_cb) {
|
||||
tuh_desc_device_cb(daddr, (tusb_desc_device_t const*) _usbh_ctrl_buf);
|
||||
tuh_desc_device_cb(daddr, (tusb_desc_device_t const*) _usbh_epbuf.ctrl);
|
||||
}
|
||||
|
||||
// Get 9-byte for total length
|
||||
@@ -1520,7 +1520,7 @@ static void process_enumeration(tuh_xfer_t* xfer) {
|
||||
|
||||
case ENUM_SET_CONFIG:
|
||||
if (tuh_desc_config_cb) {
|
||||
tuh_desc_config_cb(daddr, (const tusb_desc_configuration_t*) _usbh_ctrl_buf);
|
||||
tuh_desc_config_cb(daddr, (const tusb_desc_configuration_t*) _usbh_epbuf.ctrl);
|
||||
}
|
||||
|
||||
TU_ASSERT(tuh_configuration_set(daddr, CONFIG_NUM, process_enumeration, ENUM_CONFIG_DRIVER),);
|
||||
|
@@ -21,6 +21,7 @@ TINYUSB_SRC_C += \
|
||||
src/host/hub.c \
|
||||
src/class/cdc/cdc_host.c \
|
||||
src/class/hid/hid_host.c \
|
||||
src/class/midi/midi_host.c \
|
||||
src/class/msc/msc_host.c \
|
||||
src/class/vendor/vendor_host.c \
|
||||
src/typec/usbc.c \
|
||||
|
Reference in New Issue
Block a user