summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-03-24 01:19:32 +0700
committerhathach <[email protected]>2019-03-24 01:19:32 +0700
commit18f248b142a477b2134d23a2902d8d7de6e4c195 (patch)
tree6dff75edadb85d400198659fdaf118edd5addca9
parent29e075b8b968806c4a9ebffdbdfacbd9b01cf029 (diff)
remove tusb_hal_millis() usage, less work for porting
-rw-r--r--docs/porting.md6
-rw-r--r--examples/device/cdc_msc_hid/ses/lpc13xx/lpc13xx.emProject1
-rw-r--r--examples/device/cdc_msc_hid/ses/lpc175x_6x/lpc175x_6x.emProject59
-rw-r--r--examples/device/cdc_msc_hid/ses/lpc18xx/lpc18xx.emProject1
-rw-r--r--examples/device/cdc_msc_hid/ses/lpc40xx/lpc40xx.emProject1
-rw-r--r--examples/device/cdc_msc_hid/ses/lpc43xx/lpc43xx.emProject1
-rw-r--r--examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject1
-rw-r--r--examples/device/cdc_msc_hid/ses/samd21/samd21.emProject1
-rw-r--r--examples/device/cdc_msc_hid/ses/samd51/samd51.emProject1
-rw-r--r--examples/device/cdc_msc_hid/ses/stm32f4/stm32f4.emProject1
-rw-r--r--examples/device/cdc_msc_hid_freertos/ses/lpc175x_6x/FreeRTOSConfig.h2
-rw-r--r--examples/device/cdc_msc_hid_freertos/ses/lpc175x_6x/lpc175x_6x.emProject34
-rw-r--r--examples/device/cdc_msc_hid_freertos/ses/nrf5x/nrf5x.emProject8
-rw-r--r--examples/device/cdc_msc_hid_freertos/ses/samd21/samd21.emProject2
-rw-r--r--examples/device/cdc_msc_hid_freertos/ses/samd51/samd51.emProject2
-rw-r--r--examples/host/cdc_msc_hid/src/main.c9
-rw-r--r--hw/bsp/board.h4
-rw-r--r--hw/bsp/ea4088qs/board_ea4088qs.c5
-rw-r--r--hw/bsp/ea4357/board_ea4357.c5
-rw-r--r--hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c5
-rw-r--r--hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c5
-rw-r--r--hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c5
-rw-r--r--hw/bsp/mcb1800/board_mcb1800.c5
-rw-r--r--hw/bsp/metro_m0_express/board_metro_m0_express.c5
-rw-r--r--hw/bsp/metro_m4_express/board_metro_m4_express.c5
-rw-r--r--hw/bsp/pca10056/board_pca10056.c11
-rw-r--r--hw/bsp/stm32f303disc/board_stm32f303disc.c5
-rw-r--r--hw/bsp/stm32f407g_disc1/board_stm32f407g_disc1.c5
-rw-r--r--src/common/tusb_timeout.h4
-rw-r--r--src/osal/osal.c48
-rw-r--r--src/osal/osal.h2
-rw-r--r--src/osal/osal_none.h9
-rw-r--r--src/portable/nordic/nrf5x/hal_nrf5x.c2
-rw-r--r--src/portable/nxp/lpc18_43/dcd_lpc18_43.c2
-rw-r--r--src/tusb.h1
-rw-r--r--src/tusb_hal.h52
36 files changed, 71 insertions, 244 deletions
diff --git a/docs/porting.md b/docs/porting.md
index f5af82800..70c9f25aa 100644
--- a/docs/porting.md
+++ b/docs/porting.md
@@ -53,12 +53,6 @@ The OS Abstraction Layer is responsible for providing basic data structures for
The code is almost entirely agnostic of MCU and lives in `src/osal`.
-#### tusb_hal_millis
-
-The OPT_OS_NONE option is the only option which requires an MCU specific function. It needs `tusb_hal_millis` to measure the passage of time. On ARM this is commonly done with SysTick. The function returns the elapsed number of milliseconds since startup.
-
-`tusb_hal_millis` is also provided in `hw/bsp/<board name>/board_<board name>.c` because it may vary with MCU use.
-
### Device API
After the USB device is setup, the USB device code works by processing events on the main thread (by calling `tud_task`). These events are queued by the USB interrupt handler. So, there are three parts to the device low-level API: device setup, endpoint setup and interrupt processing.
diff --git a/examples/device/cdc_msc_hid/ses/lpc13xx/lpc13xx.emProject b/examples/device/cdc_msc_hid/ses/lpc13xx/lpc13xx.emProject
index 9654a951e..a3a59af71 100644
--- a/examples/device/cdc_msc_hid/ses/lpc13xx/lpc13xx.emProject
+++ b/examples/device/cdc_msc_hid/ses/lpc13xx/lpc13xx.emProject
@@ -54,7 +54,6 @@
<file file_name="../../../../../hw/bsp/board.h" />
<folder Name="lpcxpresso1347">
<file file_name="../../../../../hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c" />
- <file file_name="../../../../../hw/bsp/lpcxpresso1347/board_lpcxpresso1347.h" />
</folder>
</folder>
<folder Name="mcu">
diff --git a/examples/device/cdc_msc_hid/ses/lpc175x_6x/lpc175x_6x.emProject b/examples/device/cdc_msc_hid/ses/lpc175x_6x/lpc175x_6x.emProject
index aff0bf3e6..d0b065370 100644
--- a/examples/device/cdc_msc_hid/ses/lpc175x_6x/lpc175x_6x.emProject
+++ b/examples/device/cdc_msc_hid/ses/lpc175x_6x/lpc175x_6x.emProject
@@ -47,39 +47,40 @@
<file file_name="../../../../../hw/bsp/board.h" />
<folder Name="lpcxpresso1769">
<file file_name="../../../../../hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c" />
- <file file_name="../../../../../hw/bsp/lpcxpresso1769/board_lpcxpresso1769.h" />
</folder>
</folder>
<folder Name="mcu">
<folder Name="nxp">
- <folder Name="lpc_chip_175x_6x">
- <folder Name="inc">
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/chip.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/chip_lpc175x_6x.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/chip_lpc177x_8x.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/chip_lpc407x_8x.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/clock_17xx_40xx.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/cmsis.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/cmsis_175x_6x.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/core_cm3.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/core_cmFunc.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/core_cmInstr.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/gpio_17xx_40xx.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/gpioint_17xx_40xx.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/iocon_17xx_40xx.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/lpc_types.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/sys_config.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/sysctl_17xx_40xx.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/uart_17xx_40xx.h" />
- </folder>
- <folder Name="src">
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/chip_17xx_40xx.c" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/clock_17xx_40xx.c" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/gpio_17xx_40xx.c" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/iocon_17xx_40xx.c" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/sysctl_17xx_40xx.c" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/sysinit_17xx_40xx.c" />
- <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/uart_17xx_40xx.c" />
+ <folder Name="lpcopen">
+ <folder Name="lpc_chip_175x_6x">
+ <folder Name="inc">
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/chip.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/chip_lpc175x_6x.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/chip_lpc177x_8x.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/chip_lpc407x_8x.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/clock_17xx_40xx.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/cmsis.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/cmsis_175x_6x.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/core_cm3.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/core_cmFunc.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/core_cmInstr.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/gpio_17xx_40xx.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/gpioint_17xx_40xx.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/iocon_17xx_40xx.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/lpc_types.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/sys_config.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/sysctl_17xx_40xx.h" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc/uart_17xx_40xx.h" />
+ </folder>
+ <folder Name="src">
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/chip_17xx_40xx.c" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/clock_17xx_40xx.c" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/gpio_17xx_40xx.c" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/iocon_17xx_40xx.c" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/sysctl_17xx_40xx.c" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/sysinit_17xx_40xx.c" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/uart_17xx_40xx.c" />
+ </folder>
</folder>
</folder>
</folder>
diff --git a/examples/device/cdc_msc_hid/ses/lpc18xx/lpc18xx.emProject b/examples/device/cdc_msc_hid/ses/lpc18xx/lpc18xx.emProject
index 286e76e3a..e7ce7a02a 100644
--- a/examples/device/cdc_msc_hid/ses/lpc18xx/lpc18xx.emProject
+++ b/examples/device/cdc_msc_hid/ses/lpc18xx/lpc18xx.emProject
@@ -54,7 +54,6 @@
<file file_name="../../../../../hw/bsp/board.h" />
<folder Name="mcb1800">
<file file_name="../../../../../hw/bsp/mcb1800/board_mcb1800.c" />
- <file file_name="../../../../../hw/bsp/mcb1800/board_mcb1800.h" />
</folder>
</folder>
<folder Name="mcu">
diff --git a/examples/device/cdc_msc_hid/ses/lpc40xx/lpc40xx.emProject b/examples/device/cdc_msc_hid/ses/lpc40xx/lpc40xx.emProject
index 90718a51b..5a1cbe52b 100644
--- a/examples/device/cdc_msc_hid/ses/lpc40xx/lpc40xx.emProject
+++ b/examples/device/cdc_msc_hid/ses/lpc40xx/lpc40xx.emProject
@@ -56,7 +56,6 @@
<file file_name="../../../../../hw/bsp/board.h" />
<folder Name="ea4088qs">
<file file_name="../../../../../hw/bsp/ea4088qs/board_ea4088qs.c" />
- <file file_name="../../../../../hw/bsp/ea4088qs/board_ea4088qs.h" />
</folder>
</folder>
<folder Name="mcu">
diff --git a/examples/device/cdc_msc_hid/ses/lpc43xx/lpc43xx.emProject b/examples/device/cdc_msc_hid/ses/lpc43xx/lpc43xx.emProject
index d67cd3ce4..26444c469 100644
--- a/examples/device/cdc_msc_hid/ses/lpc43xx/lpc43xx.emProject
+++ b/examples/device/cdc_msc_hid/ses/lpc43xx/lpc43xx.emProject
@@ -47,7 +47,6 @@
<file file_name="../../../../../hw/bsp/board.h" />
<folder Name="ea4357">
<file file_name="../../../../../hw/bsp/ea4357/board_ea4357.c" />
- <file file_name="../../../../../hw/bsp/ea4357/board_ea4357.h" />
<file file_name="../../../../../hw/bsp/ea4357/pca9532.c" />
<file file_name="../../../../../hw/bsp/ea4357/pca9532.h" />
</folder>
diff --git a/examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject b/examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject
index f95b43318..6f5614f27 100644
--- a/examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject
+++ b/examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject
@@ -44,7 +44,6 @@
<folder Name="bsp">
<folder Name="pca10056">
<file file_name="../../../../../hw/bsp/pca10056/board_pca10056.c" />
- <file file_name="../../../../../hw/bsp/pca10056/board_pca10056.h" />
</folder>
<file file_name="../../../../../hw/bsp/ansi_escape.h" />
<file file_name="../../../../../hw/bsp/board.h" />
diff --git a/examples/device/cdc_msc_hid/ses/samd21/samd21.emProject b/examples/device/cdc_msc_hid/ses/samd21/samd21.emProject
index 6aa73d1e4..e65873008 100644
--- a/examples/device/cdc_msc_hid/ses/samd21/samd21.emProject
+++ b/examples/device/cdc_msc_hid/ses/samd21/samd21.emProject
@@ -46,7 +46,6 @@
<file file_name="../../../../../hw/bsp/board.h" />
<folder Name="metro_m0_express">
<file file_name="../../../../../hw/bsp/metro_m0_express/board_metro_m0_express.c" />
- <file file_name="../../../../../hw/bsp/metro_m0_express/board_metro_m0_express.h" />
</folder>
</folder>
<folder Name="mcu">
diff --git a/examples/device/cdc_msc_hid/ses/samd51/samd51.emProject b/examples/device/cdc_msc_hid/ses/samd51/samd51.emProject
index e175873ee..280afdcd1 100644
--- a/examples/device/cdc_msc_hid/ses/samd51/samd51.emProject
+++ b/examples/device/cdc_msc_hid/ses/samd51/samd51.emProject
@@ -47,7 +47,6 @@
<file file_name="../../../../../hw/bsp/board.h" />
<folder Name="metro_m4_express">
<file file_name="../../../../../hw/bsp/metro_m4_express/board_metro_m4_express.c" />
- <file file_name="../../../../../hw/bsp/metro_m4_express/board_metro_m4_express.h" />
</folder>
</folder>
<folder Name="mcu">
diff --git a/examples/device/cdc_msc_hid/ses/stm32f4/stm32f4.emProject b/examples/device/cdc_msc_hid/ses/stm32f4/stm32f4.emProject
index 4067e4c10..83067fd09 100644
--- a/examples/device/cdc_msc_hid/ses/stm32f4/stm32f4.emProject
+++ b/examples/device/cdc_msc_hid/ses/stm32f4/stm32f4.emProject
@@ -63,7 +63,6 @@
<folder Name="bsp">
<folder Name="stm32f407g_disc1">
<file file_name="../../../../../hw/bsp/stm32f407g_disc1/board_stm32f407g_disc1.c" />
- <file file_name="../../../../../hw/bsp/stm32f407g_disc1/board_stm32f407g_disc1.h" />
</folder>
<file file_name="../../../../../hw/bsp/board.h" />
</folder>
diff --git a/examples/device/cdc_msc_hid_freertos/ses/lpc175x_6x/FreeRTOSConfig.h b/examples/device/cdc_msc_hid_freertos/ses/lpc175x_6x/FreeRTOSConfig.h
index 0fad1dc89..5d3ba479e 100644
--- a/examples/device/cdc_msc_hid_freertos/ses/lpc175x_6x/FreeRTOSConfig.h
+++ b/examples/device/cdc_msc_hid_freertos/ses/lpc175x_6x/FreeRTOSConfig.h
@@ -4,7 +4,7 @@
//--------------------------------------------------------------------+
// See http://www.freertos.org/a00110.html.
//--------------------------------------------------------------------+
-#include "LPC17xx.h"
+#include "chip.h"
#define configCPU_CLOCK_HZ SystemCoreClock
diff --git a/examples/device/cdc_msc_hid_freertos/ses/lpc175x_6x/lpc175x_6x.emProject b/examples/device/cdc_msc_hid_freertos/ses/lpc175x_6x/lpc175x_6x.emProject
index 893d6b507..5493af626 100644
--- a/examples/device/cdc_msc_hid_freertos/ses/lpc175x_6x/lpc175x_6x.emProject
+++ b/examples/device/cdc_msc_hid_freertos/ses/lpc175x_6x/lpc175x_6x.emProject
@@ -19,8 +19,8 @@
arm_target_device_name="LPC1769"
arm_target_interface_type="SWD"
build_treat_warnings_as_errors="No"
- c_preprocessor_definitions="LPC175x_6x;__LPC1700_FAMILY;__LPC176x_SUBFAMILY;ARM_MATH_CM3;FLASH_PLACEMENT=1;BOARD_LPCXPRESSO1769;CFG_TUSB_MCU=OPT_MCU_LPC175X_6X"
- c_user_include_directories=".;../../src;$(rootDir)/hw;$(rootDir)/src;$(lpcDir)/CMSIS_CORE_LPC17xx/inc;$(lpcDir)/LPC17xx_DriverLib/include;$(freertosDir)/Source/include;$(freertosDir)/Source/portable/GCC/ARM_CM3"
+ c_preprocessor_definitions="LPC175x_6x;__LPC1700_FAMILY;__LPC176x_SUBFAMILY;ARM_MATH_CM3;FLASH_PLACEMENT=1;CORE_M3;CFG_TUSB_MCU=OPT_MCU_LPC175X_6X"
+ c_user_include_directories=".;../../src;$(rootDir)/hw;$(rootDir)/src;$(rootDir)/hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/inc;$(rootDir)/lib/FreeRTOS/Source/include;$(rootDir)/lib/FreeRTOS/Source/portable/GCC/ARM_CM3"
debug_register_definition_file="LPC176x5x_Registers.xml"
debug_target_connection="J-Link"
gcc_enable_all_warnings="Yes"
@@ -29,7 +29,7 @@
linker_memory_map_file="LPC1769_MemoryMap.xml"
linker_section_placement_file="flash_placement.xml"
linker_section_placements_segments="FLASH RX 0x00000000 0x00080000;RAM RWX 0x10000000 0x00008000"
- macros="DeviceFamily=LPC1700;DeviceSubFamily=LPC176x;Target=LPC1769;Placement=Flash;rootDir=../../../../..;lpcDir=../../../../../hw/mcu/nxp/lpc175x_6x;freertosDir=../../../../../lib/FreeRTOS"
+ macros="DeviceFamily=LPC1700;DeviceSubFamily=LPC176x;Target=LPC1769;Placement=Flash;rootDir=../../../../.."
project_directory=""
project_type="Executable"
target_reset_script="Reset();"
@@ -43,30 +43,23 @@
recurse="Yes" />
<folder Name="hw">
<folder Name="bsp">
- <file file_name="../../../../../hw/bsp/ansi_escape.h" />
<file file_name="../../../../../hw/bsp/board.h" />
<folder Name="lpcxpresso1769">
<file file_name="../../../../../hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c" />
- <file file_name="../../../../../hw/bsp/lpcxpresso1769/board_lpcxpresso1769.h" />
</folder>
</folder>
<folder Name="mcu">
<folder Name="nxp">
- <folder Name="lpc175x_6x">
- <folder Name="CMSIS_CORE_LPC17xx">
- <folder Name="inc">
- <file file_name="../../../../../hw/mcu/nxp/lpc175x_6x/CMSIS_CORE_LPC17xx/inc/LPC17xx.h" />
- <file file_name="../../../../../hw/mcu/nxp/lpc175x_6x/CMSIS_CORE_LPC17xx/inc/system_LPC17xx.h" />
- </folder>
+ <folder Name="lpcopen">
+ <folder Name="lpc_chip_175x_6x">
<folder Name="src">
- <file file_name="../../../../../hw/mcu/nxp/lpc175x_6x/CMSIS_CORE_LPC17xx/src/system_LPC17xx.c" />
- </folder>
- </folder>
- <folder Name="LPC17xx_DriverLib">
- <folder Name="include" />
- <folder Name="source">
- <file file_name="../../../../../hw/mcu/nxp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_gpio.c" />
- <file file_name="../../../../../hw/mcu/nxp/lpc175x_6x/LPC17xx_DriverLib/source/lpc17xx_pinsel.c" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/chip_17xx_40xx.c" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/clock_17xx_40xx.c" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/gpio_17xx_40xx.c" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/iocon_17xx_40xx.c" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/sysctl_17xx_40xx.c" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/sysinit_17xx_40xx.c" />
+ <file file_name="../../../../../hw/mcu/nxp/lpcopen/lpc_chip_175x_6x/src/uart_17xx_40xx.c" />
</folder>
</folder>
</folder>
@@ -136,6 +129,9 @@
<file file_name="../../../../../lib/FreeRTOS/freertos_hook.c" />
</folder>
</folder>
+ <configuration
+ Name="LPCXpresso 1769"
+ c_preprocessor_definitions="BOARD_LPCXPRESSO1769" />
</project>
<configuration Name="LPCXpresso 1769" />
</solution>
diff --git a/examples/device/cdc_msc_hid_freertos/ses/nrf5x/nrf5x.emProject b/examples/device/cdc_msc_hid_freertos/ses/nrf5x/nrf5x.emProject
index ea4950682..ad236ae66 100644
--- a/examples/device/cdc_msc_hid_freertos/ses/nrf5x/nrf5x.emProject
+++ b/examples/device/cdc_msc_hid_freertos/ses/nrf5x/nrf5x.emProject
@@ -19,7 +19,7 @@
arm_target_device_name="nRF52840_xxAA"
arm_target_interface_type="SWD"
build_treat_warnings_as_errors="No"
- c_preprocessor_definitions="NRF52840_XXAA;__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;BOARD_PCA10056;CFG_TUSB_MCU=OPT_MCU_NRF5X"
+ c_preprocessor_definitions="NRF52840_XXAA;__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;CFG_TUSB_MCU=OPT_MCU_NRF5X"
c_user_include_directories="./;../../src;$(rootDir)/hw/cmsis/Include;$(rootDir)/hw;$(rootDir)/src;$(nrfxDir)/..;$(nrfxDir);$(nrfxDir)/mdk;$(nrfxDir)/hal;$(nrfxDir)/drivers/include;$(freertosDir)/Source/include;$(freertosDir)/Source/portable/GCC/ARM_CM4F"
debug_register_definition_file="nrf52840_Registers.xml"
debug_target_connection="J-Link"
@@ -44,9 +44,7 @@
<folder Name="bsp">
<folder Name="pca10056">
<file file_name="../../../../../hw/bsp/pca10056/board_pca10056.c" />
- <file file_name="../../../../../hw/bsp/pca10056/board_pca10056.h" />
</folder>
- <file file_name="../../../../../hw/bsp/ansi_escape.h" />
<file file_name="../../../../../hw/bsp/board.h" />
</folder>
<folder Name="mcu">
@@ -143,10 +141,12 @@
<file file_name="../../../../../lib/FreeRTOS/Source/tasks.c" />
<file file_name="../../../../../lib/FreeRTOS/Source/timers.c" />
</folder>
- <file file_name="../../../../../lib/FreeRTOS/FreeRTOSConfig.h" />
<file file_name="../../../../../lib/FreeRTOS/freertos_hook.c" />
</folder>
</folder>
+ <configuration
+ Name="pca10056"
+ c_preprocessor_definitions="BOARD_PCA10056" />
</project>
<configuration Name="pca10056" />
</solution>
diff --git a/examples/device/cdc_msc_hid_freertos/ses/samd21/samd21.emProject b/examples/device/cdc_msc_hid_freertos/ses/samd21/samd21.emProject
index 07e902645..18291fbfd 100644
--- a/examples/device/cdc_msc_hid_freertos/ses/samd21/samd21.emProject
+++ b/examples/device/cdc_msc_hid_freertos/ses/samd21/samd21.emProject
@@ -41,11 +41,9 @@
recurse="Yes" />
<folder Name="hw">
<folder Name="bsp">
- <file file_name="../../../../../hw/bsp/ansi_escape.h" />
<file file_name="../../../../../hw/bsp/board.h" />
<folder Name="metro_m0_express">
<file file_name="../../../../../hw/bsp/metro_m0_express/board_metro_m0_express.c" />
- <file file_name="../../../../../hw/bsp/metro_m0_express/board_metro_m0_express.h" />
</folder>
</folder>
<folder Name="mcu">
diff --git a/examples/device/cdc_msc_hid_freertos/ses/samd51/samd51.emProject b/examples/device/cdc_msc_hid_freertos/ses/samd51/samd51.emProject
index 81758d177..c18aad2eb 100644
--- a/examples/device/cdc_msc_hid_freertos/ses/samd51/samd51.emProject
+++ b/examples/device/cdc_msc_hid_freertos/ses/samd51/samd51.emProject
@@ -42,11 +42,9 @@
recurse="Yes" />
<folder Name="hw">
<folder Name="bsp">
- <file file_name="../../../../../hw/bsp/ansi_escape.h" />
<file file_name="../../../../../hw/bsp/board.h" />
<folder Name="metro_m4_express">
<file file_name="../../../../../hw/bsp/metro_m4_express/board_metro_m4_express.c" />
- <file file_name="../../../../../hw/bsp/metro_m4_express/board_metro_m4_express.h" />
</folder>
</folder>
<folder Name="mcu">
diff --git a/examples/host/cdc_msc_hid/src/main.c b/examples/host/cdc_msc_hid/src/main.c
index b38e44017..86ddb55e1 100644
--- a/examples/host/cdc_msc_hid/src/main.c
+++ b/examples/host/cdc_msc_hid/src/main.c
@@ -164,11 +164,14 @@ void tuh_hid_mouse_isr(uint8_t dev_addr, xfer_result_t event)
//--------------------------------------------------------------------+
void led_blinking_task(void)
{
- static tu_timeout_t tm = { .start = 0, .interval = 1000 }; // Blink every 1000 ms
+ const uint32_t interval_ms = 1000;
+ static uint32_t start_ms = 0;
+
static bool led_state = false;
- if ( !tu_timeout_expired(&tm) ) return; // not enough time
- tu_timeout_reset(&tm);
+ // Blink every 1000 ms
+ if ( board_millis() < start_ms + interval_ms) return; // not enough time
+ start_ms += interval_ms;
board_led_control(led_state);
led_state = 1 - led_state; // toggle
diff --git a/hw/bsp/board.h b/hw/bsp/board.h
index ea0f3152c..2a46c976b 100644
--- a/hw/bsp/board.h
+++ b/hw/bsp/board.h
@@ -86,6 +86,10 @@ static inline uint32_t board_millis(void)
return os_time_ticks_to_ms32( os_time_get() );
}
+#elif
+
+#error "Need to implement board_millis() for this OS"
+
#endif
//--------------------------------------------------------------------+
diff --git a/hw/bsp/ea4088qs/board_ea4088qs.c b/hw/bsp/ea4088qs/board_ea4088qs.c
index 11b3a7eb8..4f4e19ee0 100644
--- a/hw/bsp/ea4088qs/board_ea4088qs.c
+++ b/hw/bsp/ea4088qs/board_ea4088qs.c
@@ -166,11 +166,6 @@ void SysTick_Handler (void)
system_ticks++;
}
-uint32_t tusb_hal_millis(void)
-{
- return board_tick2ms(system_ticks);
-}
-
uint32_t board_millis(void)
{
return system_ticks;
diff --git a/hw/bsp/ea4357/board_ea4357.c b/hw/bsp/ea4357/board_ea4357.c
index e5e93033d..6d7d936db 100644
--- a/hw/bsp/ea4357/board_ea4357.c
+++ b/hw/bsp/ea4357/board_ea4357.c
@@ -65,11 +65,6 @@ void SysTick_Handler (void)
system_ticks++;
}
-uint32_t tusb_hal_millis(void)
-{
- return board_tick2ms(system_ticks);
-}
-
uint32_t board_millis(void)
{
return system_ticks;
diff --git a/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c b/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c
index d3883be54..fa0966831 100644
--- a/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c
+++ b/hw/bsp/lpcxpresso11u68/board_lpcxpresso11u68.c
@@ -103,11 +103,6 @@ void SysTick_Handler (void)
system_ticks++;
}
-uint32_t tusb_hal_millis(void)
-{
- return board_tick2ms(system_ticks);
-}
-
uint32_t board_millis(void)
{
return system_ticks;
diff --git a/hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c b/hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c
index 20b82cd62..4f7909b12 100644
--- a/hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c
+++ b/hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c
@@ -116,11 +116,6 @@ void SysTick_Handler (void)
system_ticks++;
}
-uint32_t tusb_hal_millis(void)
-{
- return board_tick2ms(system_ticks);
-}
-
uint32_t board_millis(void)
{
return system_ticks;
diff --git a/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c b/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c
index 0b7e7a1bd..420c90e60 100644
--- a/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c
+++ b/hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c
@@ -154,11 +154,6 @@ void SysTick_Handler (void)
system_ticks++;
}
-uint32_t tusb_hal_millis(void)
-{
- return board_tick2ms(system_ticks);
-}
-
uint32_t board_millis(void)
{
return system_ticks;
diff --git a/hw/bsp/mcb1800/board_mcb1800.c b/hw/bsp/mcb1800/board_mcb1800.c
index 7ace1a0ee..b81ecaad2 100644
--- a/hw/bsp/mcb1800/board_mcb1800.c
+++ b/hw/bsp/mcb1800/board_mcb1800.c
@@ -232,11 +232,6 @@ void SysTick_Handler (void)
system_ticks++;
}
-uint32_t tusb_hal_millis(void)
-{
- return board_tick2ms(system_ticks);
-}
-
uint32_t board_millis(void)
{
return system_ticks;
diff --git a/hw/bsp/metro_m0_express/board_metro_m0_express.c b/hw/bsp/metro_m0_express/board_metro_m0_express.c
index 48b8a15ef..11bb16c3c 100644
--- a/hw/bsp/metro_m0_express/board_metro_m0_express.c
+++ b/hw/bsp/metro_m0_express/board_metro_m0_express.c
@@ -113,11 +113,6 @@ void SysTick_Handler (void)
system_ticks++;
}
-uint32_t tusb_hal_millis(void)
-{
- return board_tick2ms(system_ticks);
-}
-
uint32_t board_millis(void)
{
return system_ticks;
diff --git a/hw/bsp/metro_m4_express/board_metro_m4_express.c b/hw/bsp/metro_m4_express/board_metro_m4_express.c
index ad86b54d7..6a134f807 100644
--- a/hw/bsp/metro_m4_express/board_metro_m4_express.c
+++ b/hw/bsp/metro_m4_express/board_metro_m4_express.c
@@ -102,11 +102,6 @@ void SysTick_Handler (void)
system_ticks++;
}
-uint32_t tusb_hal_millis(void)
-{
- return board_tick2ms(system_ticks);
-}
-
uint32_t board_millis(void)
{
return system_ticks;
diff --git a/hw/bsp/pca10056/board_pca10056.c b/hw/bsp/pca10056/board_pca10056.c
index 70662d9dd..923721fd7 100644
--- a/hw/bsp/pca10056/board_pca10056.c
+++ b/hw/bsp/pca10056/board_pca10056.c
@@ -36,8 +36,6 @@
#include "nrf_soc.h"
#endif
-#include "tusb.h"
-
/*------------------------------------------------------------------*/
/* MACRO TYPEDEF CONSTANT ENUM
*------------------------------------------------------------------*/
@@ -52,7 +50,7 @@ uint8_t _button_pins[] = { 11, 12, 24, 25 };
/*------------------------------------------------------------------*/
/* TUSB HAL MILLISECOND
*------------------------------------------------------------------*/
-#if CFG_TUSB_OS == OPT_OS_NONE
+#if CFG_TUSB_OS == OPT_OS_NONE
volatile uint32_t system_ticks = 0;
void SysTick_Handler (void)
@@ -60,11 +58,6 @@ void SysTick_Handler (void)
system_ticks++;
}
-uint32_t tusb_hal_millis(void)
-{
- return board_tick2ms(system_ticks);
-}
-
uint32_t board_millis(void)
{
return system_ticks;
@@ -93,7 +86,7 @@ void board_init(void)
// Button
for(uint8_t i=0; i<BOARD_BUTTON_COUNT; i++) nrf_gpio_cfg_input(_button_pins[i], NRF_GPIO_PIN_PULLUP);
-#if CFG_TUSB_OS == OPT_OS_NONE
+#if CFG_TUSB_OS == OPT_OS_NONE
// 1ms tick timer
SysTick_Config(SystemCoreClock/1000);
#endif
diff --git a/hw/bsp/stm32f303disc/board_stm32f303disc.c b/hw/bsp/stm32f303disc/board_stm32f303disc.c
index b7fbb3927..d2f6244f7 100644
--- a/hw/bsp/stm32f303disc/board_stm32f303disc.c
+++ b/hw/bsp/stm32f303disc/board_stm32f303disc.c
@@ -108,11 +108,6 @@ void SysTick_Handler (void)
system_ticks++;
}
-uint32_t tusb_hal_millis(void)
-{
- return board_tick2ms(system_ticks);
-}
-
uint32_t board_millis(void)
{
return system_ticks;
diff --git a/hw/bsp/stm32f407g_disc1/board_stm32f407g_disc1.c b/hw/bsp/stm32f407g_disc1/board_stm32f407g_disc1.c
index 08fc6bd66..d7b4a4bd3 100644
--- a/hw/bsp/stm32f407g_disc1/board_stm32f407g_disc1.c
+++ b/hw/bsp/stm32f407g_disc1/board_stm32f407g_disc1.c
@@ -103,11 +103,6 @@ void SysTick_Handler (void)
system_ticks++;
}
-uint32_t tusb_hal_millis(void)
-{
- return board_tick2ms(system_ticks);
-}
-
uint32_t board_millis(void)
{
return system_ticks;
diff --git a/src/common/tusb_timeout.h b/src/common/tusb_timeout.h
index bdade6b42..83a4dac63 100644
--- a/src/common/tusb_timeout.h
+++ b/src/common/tusb_timeout.h
@@ -43,6 +43,8 @@ typedef struct {
uint32_t interval;
}tu_timeout_t;
+#if 0
+
extern uint32_t tusb_hal_millis(void);
static inline void tu_timeout_set(tu_timeout_t* tt, uint32_t msec)
@@ -67,6 +69,8 @@ static inline void tu_timeout_restart(tu_timeout_t* tt)
tt->start = tusb_hal_millis();
}
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/src/osal/osal.c b/src/osal/osal.c
deleted file mode 100644
index b1ffa3942..000000000
--- a/src/osal/osal.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018, hathach (tinyusb.org)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- * This file is part of the TinyUSB stack.
- */
-
-#include "tusb_option.h"
-#include "osal.h"
-
-//--------------------------------------------------------------------+
-// TICK API
-//--------------------------------------------------------------------+
-#if CFG_TUSB_OS == OPT_OS_FREERTOS
-
-uint32_t tusb_hal_millis(void)
-{
- return ( ( ((uint64_t) xTaskGetTickCount()) * 1000) / configTICK_RATE_HZ );
-}
-
-#elif CFG_TUSB_OS == OPT_OS_MYNEWT
-
-uint32_t tusb_hal_millis(void)
-{
- return os_time_ticks_to_ms32( os_time_get() );
-}
-
-#endif
-
diff --git a/src/osal/osal.h b/src/osal/osal.h
index 413189b4e..7ceb22125 100644
--- a/src/osal/osal.h
+++ b/src/osal/osal.h
@@ -53,8 +53,6 @@ typedef void (*osal_task_func_t)( void * );
#else
/* RTOS Porting API
*
- * uint32_t tusb_hal_millis(void)
- *
* Task
* void osal_task_delay(uint32_t msec)
*
diff --git a/src/osal/osal_none.h b/src/osal/osal_none.h
index 17a802ed8..6144f3e5c 100644
--- a/src/osal/osal_none.h
+++ b/src/osal/osal_none.h
@@ -27,8 +27,6 @@
#ifndef _TUSB_OSAL_NONE_H_
#define _TUSB_OSAL_NONE_H_
-#include "tusb_hal.h"
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -38,8 +36,11 @@
//--------------------------------------------------------------------+
static inline void osal_task_delay(uint32_t msec)
{
- uint32_t start = tusb_hal_millis();
- while ( ( tusb_hal_millis() - start ) < msec ) {}
+ (void) msec;
+ // TODO only used by Host stack, will implement using SOF
+
+// uint32_t start = tusb_hal_millis();
+// while ( ( tusb_hal_millis() - start ) < msec ) {}
}
//--------------------------------------------------------------------+
diff --git a/src/portable/nordic/nrf5x/hal_nrf5x.c b/src/portable/nordic/nrf5x/hal_nrf5x.c
index 1d149eb8c..8477a56cd 100644
--- a/src/portable/nordic/nrf5x/hal_nrf5x.c
+++ b/src/portable/nordic/nrf5x/hal_nrf5x.c
@@ -40,8 +40,6 @@
#endif
#include "nrfx_power.h"
-
-#include "tusb_hal.h"
#include "device/dcd.h"
/*------------------------------------------------------------------*/
diff --git a/src/portable/nxp/lpc18_43/dcd_lpc18_43.c b/src/portable/nxp/lpc18_43/dcd_lpc18_43.c
index ec3ac188b..df82f70b9 100644
--- a/src/portable/nxp/lpc18_43/dcd_lpc18_43.c
+++ b/src/portable/nxp/lpc18_43/dcd_lpc18_43.c
@@ -32,8 +32,6 @@
// INCLUDE
//--------------------------------------------------------------------+
#include "common/tusb_common.h"
-#include "tusb_hal.h"
-
#include "device/dcd.h"
#include "dcd_lpc18_43.h"
diff --git a/src/tusb.h b/src/tusb.h
index c6d572436..122851b45 100644
--- a/src/tusb.h
+++ b/src/tusb.h
@@ -35,7 +35,6 @@
// INCLUDE
//--------------------------------------------------------------------+
#include "common/tusb_common.h"
-#include "tusb_hal.h"
#include "osal/osal.h"
#include "common/tusb_fifo.h"
diff --git a/src/tusb_hal.h b/src/tusb_hal.h
deleted file mode 100644
index 2dcafa77f..000000000
--- a/src/tusb_hal.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright (c) 2018, hathach (tinyusb.org)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- * This file is part of the TinyUSB stack.
- */
-
-#ifndef _TUSB_HAL_H_
-#define _TUSB_HAL_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-//--------------------------------------------------------------------+
-// INCLUDES
-//--------------------------------------------------------------------+
-#include "common/tusb_common.h"
-
-//--------------------------------------------------------------------+
-// HAL API
-//--------------------------------------------------------------------+
-
-// Only required to implement if using No RTOS (osal_none)
-// TODO could be remove
-uint32_t tusb_hal_millis(void);
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif /* _TUSB_HAL_H_ */
-