Skip to content

Commit 4fd121d

Browse files
committed
feat(cherryusb): add cherryusb device & host demo
Signed-off-by: sakumisu <[email protected]>
1 parent b6ac07f commit 4fd121d

13 files changed

+682
-0
lines changed

usb/CMakeLists.txt

+12
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,15 @@ if (TARGET tinyusb_pico_pio_usb)
1313
else ()
1414
message("Skipping TinyUSB dual examples, as TinyUSB hw/mcu/raspberry_pi/Pico-PIO-USB submodule unavailable")
1515
endif ()
16+
17+
if (TARGET cherryusb_device)
18+
add_subdirectory(cherryusb/device)
19+
else()
20+
message("Skipping CherryUSB device examples as CherryUSB is unavailable")
21+
endif()
22+
23+
if (TARGET cherryusb_host)
24+
add_subdirectory(cherryusb/host)
25+
else()
26+
message("Skipping CherryUSB host examples as CherryUSB is unavailable")
27+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
/*
2+
* FreeRTOS V202111.00
3+
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
* this software and associated documentation files (the "Software"), to deal in
7+
* the Software without restriction, including without limitation the rights to
8+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
* the Software, and to permit persons to whom the Software is furnished to do so,
10+
* subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in all
13+
* copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
*
22+
* http://www.FreeRTOS.org
23+
* http://aws.amazon.com/freertos
24+
*
25+
* 1 tab == 4 spaces!
26+
*/
27+
28+
#ifndef FREERTOS_CONFIG_EXAMPLES_COMMON_H
29+
#define FREERTOS_CONFIG_EXAMPLES_COMMON_H
30+
31+
/*-----------------------------------------------------------
32+
* Application specific definitions.
33+
*
34+
* These definitions should be adjusted for your particular hardware and
35+
* application requirements.
36+
*
37+
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
38+
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
39+
*
40+
* See http://www.freertos.org/a00110.html
41+
*----------------------------------------------------------*/
42+
43+
/* Scheduler Related */
44+
#define configUSE_PREEMPTION 1
45+
#define configUSE_TICKLESS_IDLE 0
46+
#define configUSE_IDLE_HOOK 0
47+
#define configUSE_TICK_HOOK 0
48+
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
49+
#define configMAX_PRIORITIES 32
50+
#define configMINIMAL_STACK_SIZE ( configSTACK_DEPTH_TYPE ) 512
51+
#define configUSE_16_BIT_TICKS 0
52+
53+
#define configIDLE_SHOULD_YIELD 1
54+
55+
/* Synchronization Related */
56+
#define configUSE_MUTEXES 1
57+
#define configUSE_RECURSIVE_MUTEXES 1
58+
#define configUSE_APPLICATION_TASK_TAG 0
59+
#define configUSE_COUNTING_SEMAPHORES 1
60+
#define configQUEUE_REGISTRY_SIZE 8
61+
#define configUSE_QUEUE_SETS 1
62+
#define configUSE_TIME_SLICING 1
63+
#define configUSE_NEWLIB_REENTRANT 0
64+
// todo need this for lwip FreeRTOS sys_arch to compile
65+
#define configENABLE_BACKWARD_COMPATIBILITY 1
66+
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 5
67+
68+
/* System */
69+
#define configSTACK_DEPTH_TYPE uint32_t
70+
#define configMESSAGE_BUFFER_LENGTH_TYPE size_t
71+
72+
/* Memory allocation related definitions. */
73+
#define configSUPPORT_STATIC_ALLOCATION 0
74+
#define configSUPPORT_DYNAMIC_ALLOCATION 1
75+
#define configTOTAL_HEAP_SIZE (128*1024)
76+
#define configAPPLICATION_ALLOCATED_HEAP 0
77+
78+
/* Hook function related definitions. */
79+
#define configCHECK_FOR_STACK_OVERFLOW 0
80+
#define configUSE_MALLOC_FAILED_HOOK 0
81+
#define configUSE_DAEMON_TASK_STARTUP_HOOK 0
82+
83+
/* Run time and task stats gathering related definitions. */
84+
#define configGENERATE_RUN_TIME_STATS 0
85+
#define configUSE_TRACE_FACILITY 1
86+
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
87+
88+
/* Co-routine related definitions. */
89+
#define configUSE_CO_ROUTINES 0
90+
#define configMAX_CO_ROUTINE_PRIORITIES 1
91+
92+
/* Software timer related definitions. */
93+
#define configUSE_TIMERS 1
94+
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
95+
#define configTIMER_QUEUE_LENGTH 10
96+
#define configTIMER_TASK_STACK_DEPTH 1024
97+
98+
/* Interrupt nesting behaviour configuration. */
99+
/*
100+
#define configKERNEL_INTERRUPT_PRIORITY [dependent of processor]
101+
#define configMAX_SYSCALL_INTERRUPT_PRIORITY [dependent on processor and application]
102+
#define configMAX_API_CALL_INTERRUPT_PRIORITY [dependent on processor and application]
103+
*/
104+
105+
#if FREE_RTOS_KERNEL_SMP // set by the RP2xxx SMP port of FreeRTOS
106+
/* SMP port only */
107+
#ifndef configNUMBER_OF_CORES
108+
#define configNUMBER_OF_CORES 2
109+
#endif
110+
#define configNUM_CORES configNUMBER_OF_CORES
111+
#define configTICK_CORE 0
112+
#define configRUN_MULTIPLE_PRIORITIES 1
113+
#if configNUMBER_OF_CORES > 1
114+
#define configUSE_CORE_AFFINITY 1
115+
#endif
116+
#define configUSE_PASSIVE_IDLE_HOOK 0
117+
#endif
118+
119+
/* RP2040 specific */
120+
#define configSUPPORT_PICO_SYNC_INTEROP 1
121+
#define configSUPPORT_PICO_TIME_INTEROP 1
122+
123+
#include <assert.h>
124+
/* Define to trap errors during development. */
125+
#define configASSERT(x) assert(x)
126+
127+
/* Set the following definitions to 1 to include the API function, or zero
128+
to exclude the API function. */
129+
#define INCLUDE_vTaskPrioritySet 1
130+
#define INCLUDE_uxTaskPriorityGet 1
131+
#define INCLUDE_vTaskDelete 1
132+
#define INCLUDE_vTaskSuspend 1
133+
#define INCLUDE_vTaskDelayUntil 1
134+
#define INCLUDE_vTaskDelay 1
135+
#define INCLUDE_xTaskGetSchedulerState 1
136+
#define INCLUDE_xTaskGetCurrentTaskHandle 1
137+
#define INCLUDE_uxTaskGetStackHighWaterMark 1
138+
#define INCLUDE_xTaskGetIdleTaskHandle 1
139+
#define INCLUDE_eTaskGetState 1
140+
#define INCLUDE_xTimerPendFunctionCall 1
141+
#define INCLUDE_xTaskAbortDelay 1
142+
#define INCLUDE_xTaskGetHandle 1
143+
#define INCLUDE_xTaskResumeFromISR 1
144+
#define INCLUDE_xQueueGetMutexHolder 1
145+
146+
#if PICO_RP2350
147+
#define configENABLE_MPU 0
148+
#define configENABLE_TRUSTZONE 0
149+
#define configRUN_FREERTOS_SECURE_ONLY 1
150+
#define configENABLE_FPU 1
151+
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 16
152+
#endif
153+
154+
/* A header file that defines trace macro can be included here. */
155+
156+
#endif /* FREERTOS_CONFIG_H */
157+

0 commit comments

Comments
 (0)