File tree Expand file tree Collapse file tree 6 files changed +38
-71
lines changed Expand file tree Collapse file tree 6 files changed +38
-71
lines changed Original file line number Diff line number Diff line change @@ -14,16 +14,16 @@ add_executable(${PROJECT})
14
14
15
15
# Example source
16
16
target_sources (${PROJECT} PUBLIC
17
- ${CMAKE_CURRENT_SOURCE_DIR} /src/cdc_app.c
18
- ${CMAKE_CURRENT_SOURCE_DIR} /src/hid_app.c
19
- ${CMAKE_CURRENT_SOURCE_DIR} /src/main.c
20
- ${CMAKE_CURRENT_SOURCE_DIR} /src/msc_app.c
21
- )
17
+ ${CMAKE_CURRENT_SOURCE_DIR} /src/cdc_app.c
18
+ ${CMAKE_CURRENT_SOURCE_DIR} /src/hid_app.c
19
+ ${CMAKE_CURRENT_SOURCE_DIR} /src/main.c
20
+ ${CMAKE_CURRENT_SOURCE_DIR} /src/msc_app.c
21
+ )
22
22
23
23
# Example include
24
24
target_include_directories (${PROJECT} PUBLIC
25
- ${CMAKE_CURRENT_SOURCE_DIR} /src
26
- )
25
+ ${CMAKE_CURRENT_SOURCE_DIR} /src
26
+ )
27
27
28
28
# Configure compilation flags and libraries for the example... see the corresponding function
29
29
# in hw/bsp/FAMILY/family.cmake for details.
Original file line number Diff line number Diff line change @@ -14,14 +14,14 @@ add_executable(${PROJECT})
14
14
15
15
# Example source
16
16
target_sources (${PROJECT} PUBLIC
17
- ${CMAKE_CURRENT_SOURCE_DIR} /src/hid_app.c
18
- ${CMAKE_CURRENT_SOURCE_DIR} /src/main.c
19
- )
17
+ ${CMAKE_CURRENT_SOURCE_DIR} /src/hid_app.c
18
+ ${CMAKE_CURRENT_SOURCE_DIR} /src/main.c
19
+ )
20
20
21
21
# Example include
22
22
target_include_directories (${PROJECT} PUBLIC
23
- ${CMAKE_CURRENT_SOURCE_DIR} /src
24
- )
23
+ ${CMAKE_CURRENT_SOURCE_DIR} /src
24
+ )
25
25
26
26
# Configure compilation flags and libraries for the example... see the corresponding function
27
27
# in hw/bsp/FAMILY/family.cmake for details.
Original file line number Diff line number Diff line change @@ -14,19 +14,19 @@ add_executable(${PROJECT})
14
14
15
15
# Example source
16
16
target_sources (${PROJECT} PUBLIC
17
- ${CMAKE_CURRENT_SOURCE_DIR} /src/main.c
18
- ${CMAKE_CURRENT_SOURCE_DIR} /src/msc_app.c
19
- ${TOP} /lib/fatfs/source/ff.c
20
- ${TOP} /lib/fatfs/source/ffsystem.c
21
- ${TOP} /lib/fatfs/source/ffunicode.c
22
- )
17
+ ${CMAKE_CURRENT_SOURCE_DIR} /src/main.c
18
+ ${CMAKE_CURRENT_SOURCE_DIR} /src/msc_app.c
19
+ ${TOP} /lib/fatfs/source/ff.c
20
+ ${TOP} /lib/fatfs/source/ffsystem.c
21
+ ${TOP} /lib/fatfs/source/ffunicode.c
22
+ )
23
23
24
24
# Example include
25
25
target_include_directories (${PROJECT} PUBLIC
26
- ${CMAKE_CURRENT_SOURCE_DIR} /src
27
- ${TOP} /lib/fatfs/source
28
- ${TOP} /lib/embedded-cli
29
- )
26
+ ${CMAKE_CURRENT_SOURCE_DIR} /src
27
+ ${TOP} /lib/fatfs/source
28
+ ${TOP} /lib/embedded-cli
29
+ )
30
30
31
31
# Configure compilation flags and libraries for the example... see the corresponding function
32
32
# in hw/bsp/FAMILY/family.cmake for details.
Original file line number Diff line number Diff line change 25
25
26
26
#include "board.h"
27
27
28
- #if 0
29
- #define LED_PHASE_MAX 8
30
-
31
- static struct
32
- {
33
- uint32_t phase [LED_PHASE_MAX ];
34
- uint8_t phase_count ;
35
-
36
- bool led_state ;
37
- uint8_t current_phase ;
38
- uint32_t current_ms ;
39
- }led_pattern ;
40
-
41
- void board_led_pattern (uint32_t const phase_ms [], uint8_t count )
42
- {
43
- memcpy (led_pattern .phase , phase_ms , 4 * count );
44
- led_pattern .phase_count = count ;
45
-
46
- // reset with 1st phase is on
47
- led_pattern .current_ms = board_millis ();
48
- led_pattern .current_phase = 0 ;
49
- led_pattern .led_state = true;
50
- board_led_on ();
51
- }
52
-
53
- void board_led_task (void )
54
- {
55
- if ( led_pattern .phase_count == 0 ) return ;
56
-
57
- uint32_t const duration = led_pattern .phase [led_pattern .current_phase ];
58
-
59
- // return if not enough time
60
- if (board_millis () - led_pattern .current_ms < duration ) return ;
61
-
62
- led_pattern .led_state = !led_pattern .led_state ;
63
- board_led_write (led_pattern .led_state );
64
-
65
- led_pattern .current_ms += duration ;
66
- led_pattern .current_phase ++ ;
67
-
68
- if (led_pattern .current_phase == led_pattern .phase_count )
69
- {
70
- led_pattern .current_phase = 0 ;
71
- led_pattern .led_state = true;
72
- board_led_on ();
73
- }
74
- }
75
- #endif
76
-
77
28
//--------------------------------------------------------------------+
78
29
// newlib read()/write() retarget
79
30
//--------------------------------------------------------------------+
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ endif ()
12
12
set (CMAKE_SYSTEM_PROCESSOR cortex-m7 CACHE INTERNAL "System Processor" )
13
13
set (CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR} /../../../examples/cmake/toolchain/arm_${TOOLCHAIN}.cmake )
14
14
15
+ set (FAMILY_MCUS MIMXRT CACHE INTERNAL "" )
16
+
15
17
# include board specific
16
18
include (${CMAKE_CURRENT_LIST_DIR} /boards/${BOARD}/board.cmake )
17
19
@@ -89,6 +91,7 @@ function(family_configure_target TARGET)
89
91
${TOP} /src/portable/ehci/ehci.c
90
92
# BSP
91
93
${CMAKE_CURRENT_FUNCTION_LIST_DIR} /family.c
94
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR} /../board.c
92
95
)
93
96
target_include_directories (${BSP_TARGET} PUBLIC
94
97
${CMAKE_CURRENT_FUNCTION_LIST_DIR}
@@ -152,3 +155,7 @@ endfunction()
152
155
function (family_configure_device_example TARGET )
153
156
family_configure_target (${TARGET} )
154
157
endfunction ()
158
+
159
+ function (family_configure_host_example TARGET )
160
+ family_configure_target (${TARGET} )
161
+ endfunction ()
Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ cmake_minimum_required(VERSION 3.17)
6
6
# Add tinyusb to a target
7
7
function (add_tinyusb TARGET )
8
8
target_sources (${TARGET} PUBLIC
9
+ # common
9
10
${CMAKE_CURRENT_FUNCTION_LIST_DIR} /tusb.c
10
11
${CMAKE_CURRENT_FUNCTION_LIST_DIR} /common/tusb_fifo.c
12
+ # device
11
13
${CMAKE_CURRENT_FUNCTION_LIST_DIR} /device/usbd.c
12
14
${CMAKE_CURRENT_FUNCTION_LIST_DIR} /device/usbd_control.c
13
15
${CMAKE_CURRENT_FUNCTION_LIST_DIR} /class/audio/audio_device.c
@@ -22,6 +24,13 @@ function(add_tinyusb TARGET)
22
24
${CMAKE_CURRENT_FUNCTION_LIST_DIR} /class/usbtmc/usbtmc_device.c
23
25
${CMAKE_CURRENT_FUNCTION_LIST_DIR} /class/vendor/vendor_device.c
24
26
${CMAKE_CURRENT_FUNCTION_LIST_DIR} /class/video/video_device.c
27
+ # host
28
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR} /host/usbh.c
29
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR} /host/hub.c
30
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR} /class/cdc/cdc_host.c
31
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR} /class/hid/hid_host.c
32
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR} /class/msc/msc_host.c
33
+ ${CMAKE_CURRENT_FUNCTION_LIST_DIR} /class/vendor/vendor_host.c
25
34
)
26
35
target_include_directories (${TARGET} PUBLIC
27
36
${CMAKE_CURRENT_FUNCTION_LIST_DIR}
You can’t perform that action at this time.
0 commit comments