clean up things, add makefile for host example

This commit is contained in:
hathach
2020-05-04 00:29:52 +07:00
parent 9538ca7d74
commit 4a3a448340
10 changed files with 104 additions and 78 deletions
+22
View File
@@ -0,0 +1,22 @@
include ../../../tools/top.mk
include ../../make.mk
INC += \
src \
$(TOP)/hw \
# Example source
EXAMPLE_SOURCE += $(wildcard src/*.c)
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))
# TinyUSB Host Stack source
SRC_C += \
src/host/usbh.c \
src/host/hub.c \
src/host/ehci/ehci.c \
src/class/cdc/cdc_host.c \
src/host/ehci/ehci.c \
src/portable/nxp/lpc18_43/hcd_lpc18_43.c
include ../../rules.mk
@@ -17,8 +17,8 @@
arm_target_debug_interface_type="ADIv5"
arm_target_device_name="LPC1857"
arm_target_interface_type="SWD"
c_preprocessor_definitions="LPC18xx;__LPC1800_FAMILY;__LPC185x_SUBFAMILY;ARM_MATH_CM3;FLASH_PLACEMENT=1;CORE_M3;BOARD_MCB1800;CFG_TUSB_MCU=OPT_MCU_LPC18XX;CFG_TUSB_MEM_SECTION= __attribute__((section(".bss2")))"
c_user_include_directories="../../src;$(rootDir)/hw;$(rootDir)/src;$(lpcDir)//inc;$(lpcDir)//inc/config_18xx"
c_preprocessor_definitions="LPC18xx;__LPC1800_FAMILY;__LPC185x_SUBFAMILY;ARM_MATH_CM3;FLASH_PLACEMENT=1;CORE_M3;BOARD_MCB1800;CFG_TUSB_MCU=OPT_MCU_LPC18XX;CFG_TUSB_MEM_SECTION= __attribute__((section(".bss2")));CFG_TUSB_DEBUG=2"
c_user_include_directories="../../src;$(rootDir)/hw;$(rootDir)/src;$(lpcDir)//inc;$(lpcDir)//inc/config_18xx;$(rootDir)/lib/SEGGER_RTT/RTT"
debug_register_definition_file="$(ProjectDir)/LPC18xx_Registers.xml"
debug_target_connection="J-Link"
gcc_entry_point="Reset_Handler"
@@ -101,12 +101,6 @@
</folder>
</folder>
</folder>
<folder
Name="segger_rtt"
exclude=""
filter="*.c;*.h"
path="../../../../../lib/segger_rtt"
recurse="No" />
<folder
Name="src"
exclude=""
@@ -119,6 +113,17 @@
filter="*.c;*.h"
path="../../../../../src"
recurse="Yes" />
<folder Name="lib">
<folder Name="SEGGER_RTT">
<folder Name="RTT">
<file file_name="../../../../../lib/SEGGER_RTT/RTT/SEGGER_RTT.c" />
<file file_name="../../../../../lib/SEGGER_RTT/RTT/SEGGER_RTT_printf.c" />
</folder>
<folder Name="Syscalls">
<file file_name="../../../../../lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_SES.c" />
</folder>
</folder>
</folder>
</project>
<configuration
Name="MCB1800"
@@ -20,7 +20,7 @@
arm_target_interface_type="SWD"
build_treat_warnings_as_errors="No"
c_preprocessor_definitions="CORE_M4;__LPC4300_FAMILY;__LPC435x_SUBFAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;BOARD_EA4357;CFG_TUSB_MCU=OPT_MCU_LPC43XX;CFG_TUSB_MEM_SECTION= __attribute__((section(&quot;.bss2&quot;)))"
c_user_include_directories="../../src;$(rootDir)/hw;$(rootDir)/src;$(lpcDir)//inc;$(lpcDir)//inc/config_43xx"
c_user_include_directories="../../src;$(rootDir)/hw;$(rootDir)/src;$(lpcDir)//inc;$(rootDir)/lib/SEGGER_RTT/RTT;$(lpcDir)//inc/config_43xx"
debug_register_definition_file="LPC43xx_Registers.xml"
debug_target_connection="J-Link"
gcc_enable_all_warnings="Yes"
@@ -122,11 +122,16 @@
<file file_name="LPC43xx_Vectors.s" />
<file file_name="thumb_crt0.s" />
</folder>
<folder
Name="segger_rtt"
exclude=""
filter="*.c;*.h"
path="../../../../../lib/segger_rtt"
recurse="No" />
<folder Name="lib">
<folder Name="SEGGER_RTT">
<folder Name="RTT">
<file file_name="../../../../../lib/SEGGER_RTT/RTT/SEGGER_RTT.c" />
<file file_name="../../../../../lib/SEGGER_RTT/RTT/SEGGER_RTT_printf.c" />
</folder>
<folder Name="Syscalls">
<file file_name="../../../../../lib/SEGGER_RTT/Syscalls/SEGGER_RTT_Syscalls_SES.c" />
</folder>
</folder>
</folder>
</project>
</solution>
+1 -1
View File
@@ -193,7 +193,7 @@ void print_greeting(void)
printf("- issue at https://github.com/hathach/tinyusb\n");
printf("--------------------------------------------------------------------\n\n");
printf("This Host demo is configured to support:");
printf("This Host demo is configured to support:\r\n");
printf(" - RTOS = %s\n", rtos_name[CFG_TUSB_OS]);
// if (CFG_TUH_CDC ) puts(" - Communication Device Class");
// if (CFG_TUH_MSC ) puts(" - Mass Storage");
+1 -14
View File
@@ -75,23 +75,10 @@
#define CFG_TUH_HID_MOUSE 0
#define CFG_TUSB_HOST_HID_GENERIC 0 // (not yet supported)
#define CFG_TUH_MSC 0
#define CFG_TUH_VENDOR 0
#define CFG_TUSB_HOST_DEVICE_MAX (CFG_TUH_HUB ? 5 : 1) // normal hub has 4 ports
//------------- CLASS -------------//
#define CFG_TUD_CDC 0
#define CFG_TUD_MSC 0
#define CFG_TUD_HID 0
#define CFG_TUD_VENDOR 0
// CDC FIFO size of TX and RX
#define CFG_TUD_CDC_RX_BUFSIZE 64
#define CFG_TUD_CDC_TX_BUFSIZE 64
// MSC Buffer size of Device Mass storage
#define CFG_TUD_MSC_BUFSIZE 512
#ifdef __cplusplus
}
#endif