upload mutimodal

This commit is contained in:
Summer
2025-06-11 04:55:38 -07:00
committed by Lorow
parent b30a00900f
commit d9ace4bc05
41 changed files with 2484 additions and 219 deletions

View File

@@ -1,4 +1,4 @@
idf_component_register(SRCS "Helpers/helpers.cpp"
idf_component_register(SRCS "Helpers/helpers.cpp" "Helpers/main_globals.cpp"
INCLUDE_DIRS "Helpers"
REQUIRES esp_timer
)

View File

@@ -0,0 +1,40 @@
#include "main_globals.hpp"
#include "esp_log.h"
// Forward declarations
extern void start_video_streaming(void *arg);
// Global variables to be set by main
static esp_timer_handle_t* g_streaming_timer_handle = nullptr;
static TaskHandle_t* g_serial_manager_handle = nullptr;
// Functions for main to set the global handles
void setStreamingTimerHandle(esp_timer_handle_t* handle) {
g_streaming_timer_handle = handle;
}
void setSerialManagerHandle(TaskHandle_t* handle) {
g_serial_manager_handle = handle;
}
// Functions for components to access the handles
esp_timer_handle_t* getStreamingTimerHandle() {
return g_streaming_timer_handle;
}
TaskHandle_t* getSerialManagerHandle() {
return g_serial_manager_handle;
}
// Global pause state
bool startupPaused = false;
// Function to manually activate streaming
void activateStreaming(bool disableSetup) {
ESP_LOGI("[MAIN_GLOBALS]", "Manually activating streaming, disableSetup=%s", disableSetup ? "true" : "false");
TaskHandle_t* serialHandle = disableSetup ? g_serial_manager_handle : nullptr;
void* serialTaskHandle = (serialHandle && *serialHandle) ? *serialHandle : nullptr;
start_video_streaming(serialTaskHandle);
}

View File

@@ -0,0 +1,28 @@
#pragma once
#ifndef MAIN_GLOBALS_HPP
#define MAIN_GLOBALS_HPP
#include "esp_timer.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
// Functions for main to set global handles
void setStreamingTimerHandle(esp_timer_handle_t* handle);
void setSerialManagerHandle(TaskHandle_t* handle);
// Functions to access global handles from components
esp_timer_handle_t* getStreamingTimerHandle();
TaskHandle_t* getSerialManagerHandle();
// Function to manually activate streaming
void activateStreaming(bool disableSetup = false);
// Function to notify that a command was received during startup
extern void notify_startup_command_received();
// Global variables for startup state
extern bool startupCommandReceived;
extern esp_timer_handle_t startupTimerHandle;
extern bool startupPaused;
#endif