This commit is contained in:
2025-07-07 22:44:57 -04:00
parent fd4207bebf
commit ddbf2287ea
54 changed files with 13224 additions and 105 deletions

View File

@@ -1,5 +1,5 @@
idf_component_register(SRCS "main.cpp"
PRIV_REQUIRES spi_flash nvs_flash esp_event rpc constants config rmt esp_driver_gptimer dataLink
idf_component_register(SRCS "main.cpp" "LoopManager.cpp"
PRIV_REQUIRES spi_flash nvs_flash esp_event rpc constants config rmt esp_driver_gptimer dataLink flatbuffers
INCLUDE_DIRS "")
if(DEFINED BOARD_NAME AND BOARD_NAME)

20
main/LoopManager.cpp Normal file
View File

@@ -0,0 +1,20 @@
//
// Created by Johnathon Slightham on 2025-07-05.
//
#include "LoopManager.h"
#include <iostream>
#include <memory>
#include <MessagingInterface.h>
void LoopManager::control_loop() {
const auto messaging_interface = std::make_unique<MessagingInterface>();
char buffer[512];
while (true) {
messaging_interface->recv(buffer, 512, 0, 1);
std::cout << buffer << std::endl;
}
}

18
main/LoopManager.h Normal file
View File

@@ -0,0 +1,18 @@
//
// Created by Johnathon Slightham on 2025-07-05.
//
#ifndef LOOPMANAGER_H
#define LOOPMANAGER_H
class LoopManager {
public:
static void control_loop();
private:
};
#endif //LOOPMANAGER_H

View File

@@ -11,6 +11,7 @@
#include "TCPServer.h"
#include "ConfigManager.h"
#include "constants/tcp.h"
#include "LoopManager.h"
extern "C" [[noreturn]] void app_main(void) {
ConfigManager::init_config();
@@ -20,12 +21,5 @@ extern "C" [[noreturn]] void app_main(void) {
mDNSDiscoveryService::setup();
const auto tcp_server = std::make_unique<TCPServer>(TCP_PORT);
printf("Hello world!\n");
for (int i = 0; ; i++) {
printf("Beat %d\n", i);
vTaskDelay(10000 / portTICK_PERIOD_MS);
}
LoopManager::control_loop();
}