Cleanup includes

This actually gained us 10% more flash space
This commit is contained in:
2025-10-16 21:03:35 -04:00
parent ab7dc2d5d6
commit d69a5327de
29 changed files with 47 additions and 95 deletions

View File

@@ -4,8 +4,8 @@
#include <mutex>
#include <esp_log.h>
#include "esp_log.h"
#include "nvs_flash.h"
#include "constants/config.h"
#include "ConfigManager.h"

View File

@@ -8,9 +8,9 @@
#include <variant>
#include <unordered_map>
#include <shared_mutex>
#include <esp_check.h>
#include <nvs.h>
#include "esp_check.h"
#include "nvs.h"
#include "flatbuffers_generated/RobotModule_generated.h"
// Singleton to r/w config from the ESP32 nvs (thread safe and cached)

View File

@@ -1,6 +1,6 @@
#include "esp_log.h"
#include "DataLinkManager.h"
#include "RMTManager.h"
#include "esp_log.h"
/**
* @brief Construct a new Data Link Manager:: Data Link Manager object

View File

@@ -1,18 +1,16 @@
#ifndef DATA_LINK
#define DATA_LINK
#include "Frames.h"
#include "Tables.h"
#include <queue>
#include <memory>
#include <unordered_map>
#include "esp_event.h"
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include <queue> //c++ priority queue
#include <memory>
#include "Frames.h"
#include "Tables.h"
#include "RMTManager.h"
#include <unordered_map>
#define DEBUG_LINK_TAG "LinkLayer"

View File

@@ -1,9 +1,5 @@
#ifdef DATA_LINK
#include "freertos/FreeRTOS.h"
#include <variant>
#include <cstdint>
#define BROADCAST_ADDR 0xFF //used for discovery (finding the board's neighbours). this will mean the board ids will have 2^8-2 = 254 unique IDs that could be assigned
#define PC_ADDR 0x0 //setting 0 to be the PC

View File

@@ -3,7 +3,6 @@
//
#include "MPIMessageBuilder.h"
#include "SerializedMessage.h"
namespace Flatbuffers {

View File

@@ -3,7 +3,6 @@
//
#include "TopologyMessageBuilder.h"
#include "SerializedMessage.h"
namespace Flatbuffers {

View File

@@ -5,10 +5,6 @@
#ifndef ANGLECONTROLMESSAGEBUILDER_H_
#define ANGLECONTROLMESSAGEBUILDER_H_
#include <string>
#include <vector>
#include "SerializedMessage.h"
#include "flatbuffers_generated/AngleControlMessage_generated.h"
#include "flatbuffers/flatbuffers.h"

View File

@@ -5,7 +5,6 @@
#ifndef MPIMESSAGEBUILDER_H
#define MPIMESSAGEBUILDER_H
#include <string>
#include <vector>
#include "SerializedMessage.h"

View File

@@ -5,7 +5,6 @@
#ifndef TOPOLOGYMESSAGEBUILDER_H
#define TOPOLOGYMESSAGEBUILDER_H
#include <string>
#include <vector>
#include "SerializedMessage.h"

View File

@@ -1,8 +1,7 @@
#include "RMTManager.h"
#include "RMTSymbols.h"
#include "driver/rmt_tx.h"
#include "driver/rmt_rx.h"
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "esp_log.h"

View File

@@ -1,17 +1,14 @@
#ifndef RMT_COMMUNICATIONS
#define RMT_COMMUNICATIONS
#include "esp_event.h"
#include <cstring>
#include "esp_event.h"
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "driver/rmt_tx.h"
#include "driver/rmt_rx.h"
#include "soc/gpio_num.h"
#include "RMTSymbols.h"
#include <cstring>
#define MAX_CHANNELS 4
#define RMT_SYMBOL_BLOCK_SIZE 48

View File

@@ -3,12 +3,10 @@
//
#include "MessagingInterface.h"
#include <AngleControlMessageBuilder.h>
#include <ConfigManager.h>
#include <freertos/queue.h>
#include <freertos/semphr.h>
#include "AngleControlMessageBuilder.h"
#include "ConfigManager.h"
#include "freertos/queue.h"
#include "freertos/semphr.h"
#include "MPIMessageBuilder.h"
MessagingInterface::~MessagingInterface() {

View File

@@ -1,8 +1,8 @@
#include <iostream>
#include <memory>
#include <esp_log.h>
#include <sys/param.h>
#include "esp_log.h"
#include "sys/param.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_event.h"

View File

@@ -5,22 +5,18 @@
#ifndef COMMUNICATIONROUTER_H
#define COMMUNICATIONROUTER_H
#include <ConfigManager.h>
#include <functional>
#include <memory>
#include <chrono>
#include <OrientationDetection.h>
#include <WifiManager.h>
#include "ConfigManager.h"
#include "OrientationDetection.h"
#include "WifiManager.h"
#include "freertos/FreeRTOS.h"
#include "TCPServer.h"
#include "DataLinkManager.h"
#include "constants/tcp.h"
#include "constants/module.h"
#include "flatbuffers_generated/TopologyMessage_generated.h"
#include "PtrQueue.h"
class CommunicationRouter {

View File

@@ -7,8 +7,8 @@
#include <memory>
#include <unordered_map>
#include <constants/app_comms.h>
#include "constants/app_comms.h"
#include "CommunicationRouter.h"
class MessagingInterface {

View File

@@ -4,7 +4,8 @@
#ifndef ORIENTATIONDETECTION_H
#define ORIENTATIONDETECTION_H
#include <flatbuffers_generated/RobotModule_generated.h>
#include "flatbuffers_generated/RobotModule_generated.h"
#include "driver/gpio.h"
class OrientationDetection {

View File

@@ -10,16 +10,14 @@
#include <unordered_set>
#include "freertos/FreeRTOS.h"
#include "IRPCServer.h"
#include "PtrQueue.h"
class TCPServer : IRPCServer {
class TCPServer final : IRPCServer {
public:
TCPServer(int port, const std::shared_ptr<PtrQueue<std::vector<uint8_t>>>& rx_queue);
~TCPServer();
int send_msg(char* buffer, uint32_t length) const;
~TCPServer() override;
int send_msg(char* buffer, uint32_t length) const override;
private:
bool authenticate_client(int client_sock);

View File

@@ -1,13 +1,12 @@
#ifndef NETWORKMANAGER_H
#define NETWORKMANAGER_H
#include <esp_netif_types.h>
#include <esp_event.h>
#include <esp_netif.h>
#include <esp_wifi.h>
#include <freertos/FreeRTOS.h>
#include <freertos/semphr.h>
#include "esp_netif_types.h"
#include "esp_event.h"
#include "esp_netif.h"
#include "esp_wifi.h"
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "ConfigManager.h"
#include "IWifiManager.h"

View File

@@ -2,20 +2,16 @@
// Created by Johnathon Slightham on 2025-05-25.
//
#include "mdns.h"
#include "ConfigManager.h"
#include "mDNSDiscoveryService.h"
#include "constants/tcp.h"
#include <string>
#include <format>
#include <iostream>
#include <sstream>
// todo: clean this up (strange to be a constructor) also need to add more details, need to add to routing table
#include "mdns.h"
#include "ConfigManager.h"
#include "mDNSDiscoveryService.h"
#include "constants/tcp.h"
void mDNSDiscoveryService::setup() {
mdns_init();

View File

@@ -2,13 +2,14 @@
// Created by Johnathon Slightham on 2025-07-05.
//
#include "LoopManager.h"
#include <iostream>
#include <memory>
#include <MessagingInterface.h>
#include <TopologyMessageBuilder.h>
#include "LoopManager.h"
#include "MessagingInterface.h"
#include "TopologyMessageBuilder.h"
#include "control/ActuatorFactory.h"
#include "esp_log.h"
#define ACTUATOR_CMD_TAG 5

View File

@@ -5,10 +5,8 @@
#include <memory>
#include "control/ActuatorFactory.h"
#include "control/DCMotorActuator.h"
#include "control/Servo1Actuator.h"
#include "flatbuffers_generated/RobotModule_generated.h"
std::unique_ptr<IActuator> ActuatorFactory::create_actuator(const ModuleType type) {

View File

@@ -1,13 +1,8 @@
#include "control/DCMotorActuator.h"
#include <esp_attr.h>
#include "esp_attr.h"
#include "util/number_utils.h"
#include "driver/ledc.h"
#include "constants/module.h"
#include "AngleControlMessageBuilder.h"
#define LOW_DUTY 200

View File

@@ -3,14 +3,9 @@
//
#include "control/Servo1Actuator.h"
#include <esp_attr.h>
#include "util/number_utils.h"
#include "driver/ledc.h"
#include "constants/module.h"
#include "AngleControlMessageBuilder.h"
#define LOW_DUTY 200

View File

@@ -7,10 +7,7 @@
#include <memory>
#include <MessagingInterface.h>
#include "control/IActuator.h"
#include "control/ActuatorFactory.h"
#include "MessagingInterface.h"
class LoopManager {
public:

View File

@@ -4,9 +4,7 @@
#define DCMOTORACTUATOR_H
#include "freertos/FreeRTOS.h"
#include <freertos/task.h>
#include "freertos/task.h"
#include "IActuator.h"
class DCMotorActuator final : public IActuator {

View File

@@ -4,7 +4,6 @@
#ifndef IACTUATOR_H
#define IACTUATOR_H
#include <cstdint>
class IActuator {
public:

View File

@@ -7,12 +7,13 @@
#ifndef SERVO1ACTUATOR_H
#define SERVO1ACTUATOR_H
#include <cstdint>
#include "IActuator.h"
class Servo1Actuator final : public IActuator {
public:
Servo1Actuator();
void actuate(uint8_t *cmd) override;
void actuate(std::uint8_t *cmd) override;
};
#endif //SERVO1ACTUATOR_H

View File

@@ -3,13 +3,11 @@
#include "freertos/FreeRTOS.h"
#include "sdkconfig.h"
#include "ConfigManager.h"
#include "LoopManager.h"
#include "TCPServer.h"
#include "WifiManager.h"
#include "esp_log.h"
#include "mDNSDiscoveryService.h"
extern "C" [[noreturn]] void app_main(void) {
ESP_LOGI("MEM", "Free internal RAM: %d",