refactor: reorganize project structure with modern C++ namespace organization
- Restructure include/ and src/ directories with logical grouping - Move core components to spore/core/ (NodeContext, NetworkManager, TaskManager, ClusterManager, ApiServer) - Move services to spore/services/ (NodeService, NetworkService, ClusterService, TaskService) - Move types to spore/types/ (NodeInfo, ApiTypes, Config) - Move internal components to spore/internal/ (Globals) - Update all #include statements to use new namespace paths - Update platformio.ini build filters for all environments - Update all example files to use new include paths - Maintain backward compatibility for public API - Improve code organization, maintainability, and scalability This reorganization follows modern C++ project structure patterns and provides clear separation between public API, internal implementation, and utilities. All examples compile successfully with the new structure.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include <Arduino.h>
|
||||
#include "Spore.h"
|
||||
#include "spore/Spore.h"
|
||||
|
||||
// Create Spore instance with custom labels
|
||||
Spore spore({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "NeoPatternService.h"
|
||||
#include "ApiServer.h"
|
||||
#include "spore/core/ApiServer.h"
|
||||
|
||||
NeoPatternService::NeoPatternService(TaskManager& taskMgr, uint16_t numPixels, uint8_t pin, uint8_t type)
|
||||
: taskManager(taskMgr),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include "services/Service.h"
|
||||
#include "TaskManager.h"
|
||||
#include "spore/Service.h"
|
||||
#include "spore/core/TaskManager.h"
|
||||
#include "NeoPattern.cpp"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <Arduino.h>
|
||||
#include "Spore.h"
|
||||
#include "spore/Spore.h"
|
||||
#include "NeoPatternService.h"
|
||||
|
||||
#ifndef LED_STRIP_PIN
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "NeoPixelService.h"
|
||||
#include "ApiServer.h"
|
||||
#include "spore/core/ApiServer.h"
|
||||
|
||||
// Wheel helper: map 0-255 to RGB rainbow
|
||||
static uint32_t colorWheel(Adafruit_NeoPixel& strip, uint8_t pos) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include "services/Service.h"
|
||||
#include "TaskManager.h"
|
||||
#include "spore/Service.h"
|
||||
#include "spore/core/TaskManager.h"
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <Arduino.h>
|
||||
#include "Spore.h"
|
||||
#include "spore/Spore.h"
|
||||
#include "NeoPixelService.h"
|
||||
|
||||
#ifndef NEOPIXEL_PIN
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "RelayService.h"
|
||||
#include "ApiServer.h"
|
||||
#include "spore/core/ApiServer.h"
|
||||
|
||||
RelayService::RelayService(TaskManager& taskMgr, int pin)
|
||||
: taskManager(taskMgr), relayPin(pin), relayOn(false) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include "services/Service.h"
|
||||
#include "TaskManager.h"
|
||||
#include "spore/Service.h"
|
||||
#include "spore/core/TaskManager.h"
|
||||
#include <ArduinoJson.h>
|
||||
|
||||
class RelayService : public Service {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <Arduino.h>
|
||||
#include "Spore.h"
|
||||
#include "spore/Spore.h"
|
||||
#include "RelayService.h"
|
||||
|
||||
// Choose a default relay pin. For ESP-01 this is GPIO0. Adjust as needed for your board.
|
||||
|
||||
Reference in New Issue
Block a user