|
ICARUS OS (Intelligent Cooperative Architecture for Real-time Unified Systems) 0.1.0
Preemptive Real-Time Operating System for ARM Cortex-M7
|
#include <stdint.h>#include <stdbool.h>Go to the source code of this file.
Macros | |
| #define | CDC_WRITE_MAX_RETRIES 500u |
Maximum number of busy-retry attempts inside CDC_Write. | |
Functions | |
| bool | CDC_Write (const uint8_t *data, uint16_t len) |
Push len bytes to the USB CDC IN endpoint. | |
| bool | CDC_WriteString (const char *s) |
| Convenience wrapper that pushes a NUL-terminated C string. | |
| #define CDC_WRITE_MAX_RETRIES 500u |
Maximum number of busy-retry attempts inside CDC_Write.
Each retry sleeps one OS tick (task_active_sleep(1)), so the upper bound on a single CDC_Write call is roughly CDC_WRITE_MAX_RETRIES ticks. Default 500 → about 0.5 s at the kernel's 1 ms tick.
| bool CDC_Write | ( | const uint8_t * | data, |
| uint16_t | len | ||
| ) |
Push len bytes to the USB CDC IN endpoint.
| data | Pointer to the bytes to send (must be non-NULL when len > 0). |
| len | Number of bytes to send. |
true if the bytes were accepted by the CDC stack within CDC_WRITE_MAX_RETRIES busy-retries; false otherwise (caller's bytes were not sent).task_active_sleep(1) and would deadlock from an ISR.data must remain valid until the function returns. Definition at line 33 of file cdc.c.
References CDC_Transmit_FS(), CDC_WRITE_MAX_RETRIES, and task_active_sleep().
Referenced by CDC_WriteString().
| bool CDC_WriteString | ( | const char * | s | ) |
Convenience wrapper that pushes a NUL-terminated C string.
| s | NUL-terminated string. NULL is treated as a no-op success. |
true on success, false if the underlying CDC_Write could not flush within the retry budget. Definition at line 112 of file cdc.c.
References CDC_Write().