diff options
| author | Mengsk <[email protected]> | 2025-11-14 15:10:11 +0100 |
|---|---|---|
| committer | Mengsk <[email protected]> | 2025-11-14 15:10:11 +0100 |
| commit | ac903db1cee942232bcf7548a04ae6f9b952f08b (patch) | |
| tree | 7f534d628d0fecb5110a6f4441265651c079fa45 /examples/device/video_capture | |
| parent | 6b3970d5ff7547778ed5e1fc295dcfd1fbcad7e8 (diff) | |
| parent | fc5415bff6f177ad5f122f38dd937f577042bb32 (diff) | |
Merge remote-tracking branch 'tinyusb/master' into embedded-ideas/master
Signed-off-by: Mengsk <[email protected]>
Diffstat (limited to 'examples/device/video_capture')
| -rw-r--r-- | examples/device/video_capture/src/main.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/examples/device/video_capture/src/main.c b/examples/device/video_capture/src/main.c index ede8e3e4c..ffa2a7afa 100644 --- a/examples/device/video_capture/src/main.c +++ b/examples/device/video_capture/src/main.c @@ -53,7 +53,7 @@ void usb_device_task(void *param); void video_task(void* param); #if CFG_TUSB_OS == OPT_OS_FREERTOS -void freertos_init_task(void); +void freertos_init(void); #endif #if !defined(CFG_EXAMPLE_VIDEO_READONLY) || defined(CFG_EXAMPLE_VIDEO_BUFFERLESS) @@ -79,7 +79,7 @@ int main(void) { // If using FreeRTOS: create blinky, tinyusb device, video task #if CFG_TUSB_OS == OPT_OS_FREERTOS - freertos_init_task(); + freertos_init(); #else // init device stack on configured roothub port tusb_rhport_init_t dev_init = { @@ -248,8 +248,12 @@ static void video_send_frame(void) { } unsigned cur = board_millis(); - if (cur - start_ms < interval_ms) return; // not enough time - if (tx_busy) return; + if (cur - start_ms < interval_ms) { + return; // not enough time + } + if (tx_busy) { + return; + } start_ms += interval_ms; tx_busy = 1; @@ -312,7 +316,9 @@ void led_blinking_task(void* param) { #if CFG_TUSB_OS == OPT_OS_FREERTOS vTaskDelay(blink_interval_ms / portTICK_PERIOD_MS); #else - if (board_millis() - start_ms < blink_interval_ms) return; // not enough time + if (board_millis() - start_ms < blink_interval_ms) { + return; // not enough time + } #endif start_ms += blink_interval_ms; @@ -375,7 +381,7 @@ void usb_device_task(void *param) { } } -void freertos_init_task(void) { +void freertos_init(void) { #if configSUPPORT_STATIC_ALLOCATION xTaskCreateStatic(led_blinking_task, "blinky", BLINKY_STACK_SIZE, NULL, 1, blinky_stack, &blinky_taskdef); xTaskCreateStatic(usb_device_task, "usbd", USBD_STACK_SIZE, NULL, configMAX_PRIORITIES-1, usb_device_stack, &usb_device_taskdef); |
