mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
MPI
This commit is contained in:
@@ -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
20
main/LoopManager.cpp
Normal 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
18
main/LoopManager.h
Normal 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
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user