mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-04-19 06:23:44 +02:00
upload mutimodal
This commit is contained in:
@@ -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
|
||||
)
|
||||
40
components/Helpers/Helpers/main_globals.cpp
Normal file
40
components/Helpers/Helpers/main_globals.cpp
Normal 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);
|
||||
}
|
||||
28
components/Helpers/Helpers/main_globals.hpp
Normal file
28
components/Helpers/Helpers/main_globals.hpp
Normal 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
|
||||
Reference in New Issue
Block a user