refactore
This commit is contained in:
+10
-1
@@ -31,6 +31,8 @@
|
||||
#include "network.h"
|
||||
#include "debugMqtt.h"
|
||||
#include "battery.h"
|
||||
#include "sensors.h"
|
||||
#include "sensorData.h"
|
||||
#include "debugTimes.h"
|
||||
#include "controlPad.h"
|
||||
|
||||
@@ -55,6 +57,8 @@ OutputBuf* outputBuf;
|
||||
DebugMqtt* debugMqtt = nullptr;
|
||||
Battery* mainBattery;
|
||||
SPIClass* spiPort;
|
||||
Sensors* sensors;
|
||||
SensorData* sensorData;
|
||||
ControlPad* controlPad;
|
||||
|
||||
bool wifiIsActive;
|
||||
@@ -115,7 +119,11 @@ void setup() {
|
||||
std::cout << "Build timestamp: " << BUILD_TIMESTAMP << std::endl;
|
||||
std::cout << "All actions from the main program run on Core -> " << xPortGetCoreID() << std::endl;
|
||||
|
||||
driveManager = new DriveManager(&moveController, spiPort, controlPad->getControlPadDataPtr(), wifiIsActive);
|
||||
sensors = new Sensors();
|
||||
sensors->enableGnss(spiPort, PinNumbers::gnssSpiCs);
|
||||
sensors->enableCompass();
|
||||
sensorData = sensors->getSensorData();
|
||||
driveManager = new DriveManager(&moveController, sensorData, controlPad->getControlPadDataPtr(), wifiIsActive);
|
||||
|
||||
outputBuf->activateMqtt(true);
|
||||
|
||||
@@ -142,6 +150,7 @@ void loop() {
|
||||
#endif //MQTT
|
||||
wifiTime.stopConsol("WiFi-Time", 10);
|
||||
}
|
||||
sensors->loop();
|
||||
driveManager->loop();
|
||||
controlPad->loop();
|
||||
main_m->update();
|
||||
|
||||
Reference in New Issue
Block a user