2026-03-31 11:04:43 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include "esp_log.h"
|
2026-04-08 14:07:37 +08:00
|
|
|
#include "freertos/FreeRTOS.h"
|
|
|
|
|
#include "freertos/task.h"
|
2026-03-31 11:04:43 +08:00
|
|
|
|
|
|
|
|
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");
|
2026-03-31 11:04:43 +08:00
|
|
|
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");
|
|
|
|
|
}
|