You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Note: On **ThreadX**, USBX replaces the official ST USB library. The constructor parameters are different and require a USB PCD handle (e.g., `&hpcd_USB_FS`).
28
+
29
+
## Terminal Code Examples
24
30
25
31
```cpp
26
-
// Redirect standard input/output
32
+
// If using hardware UART
27
33
STDIO::read_ = &usart1.read_port_;
28
34
STDIO::write_ = &usart1.write_port_;
29
35
30
-
// Create virtual file system
36
+
// If using USB CDC
37
+
STDIO::read_ = &uart_cdc.read_port_;
38
+
STDIO::write_ = &uart_cdc.write_port_;
39
+
40
+
// Create a virtual file system
31
41
RamFS ramfs("XRobot");
32
42
33
-
// Create terminal
43
+
// Create the terminal
34
44
Terminal<32, 32, 5, 5> terminal(ramfs);
35
45
36
-
// Launch terminal task
46
+
// Method 1: Run as a task (default)
37
47
auto terminal_task = Timer::CreateTask(terminal.TaskFun, &terminal, 10);
> The `UserTxBufferFS` and `UserRxBufferFS` buffers are only used when the **official ST USB library** (under FreeRTOS) is used. These are not required in ThreadX + USBX mode.
87
+
88
+
---
89
+
90
+
## Code Generation Command
91
+
92
+
After modifying `.config.yaml`, use one of the following commands to regenerate the code:
0 commit comments