Files
JoyD/ESP32/my_usb_project/rust_app/rust_app_wrapper.c

23 lines
556 B
C
Raw Normal View History

#include <stdio.h>
#include "esp_log.h"
2026-04-08 14:07:37 +08:00
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
static const char* TAG = "RustApp";
extern void rust_app_main();
2026-04-08 14:07:37 +08:00
void rust_app_task(void* pvParameters) {
ESP_LOGI(TAG, "Rust application task started");
rust_app_main();
}
2026-04-08 14:07:37 +08:00
void rust_app_wrapper_init() {
ESP_LOGI(TAG, "Initializing Rust application...");
// 创建一个新的任务来运行 Rust 应用
xTaskCreate(rust_app_task, "rust_app_task", 4096, NULL, 5, NULL);
ESP_LOGI(TAG, "Rust application task created");
}