first try working module - fail

This commit is contained in:
2023-04-06 16:27:00 +02:00
parent f20f4938e4
commit ede68db3df
8 changed files with 85 additions and 30 deletions
+2 -3
View File
@@ -15,12 +15,11 @@ Modi& operator++(Modi& m, int) {
return m = (m == Modi::TestMode) ? Modi::Off : static_cast<Modi>(static_cast<int>(m)+1);
}
DriveManager::DriveManager(MoveControl *moveControl, const ControlPadInput *input, bool wifi) {
DriveManager::DriveManager(MoveControl *moveControl, SPIClass *spiPort, const ControlPadInput *input, bool wifi) {
this->moveControl = moveControl;
this->input = input;
this->spiPort = new SPIClass(HSPI);
spiPort->begin(UBLOX_GNSS_SPI_SCK, UBLOX_GNSS_SPI_CIPO, UBLOX_GNSS_SPI_COPI, UBLOX_GNSS_SPI_CS);
this->spiPort = spiPort;
this->navigation = new Navigation(spiPort, UBLOX_GNSS_SPI_CS);
if (wifi)
this->navigation->initNtrip(NTRIP_HOST, NTRIP_PORT, NTRIP_MOUNT_POINT, NTRIP_USER, NTRIP_PASSWORD);
+1 -1
View File
@@ -52,7 +52,7 @@ class DriveManager {
*
* @param moveControl
*/
DriveManager(MoveControl *moveControl, const ControlPadInput *input, bool wifi = false);
DriveManager(MoveControl *moveControl, SPIClass *spiPort, const ControlPadInput *input, bool wifi = false);
/**
* @brief Destroy the Drive Manager object
+7 -2
View File
@@ -20,6 +20,7 @@
#include <iostream>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SPI.h>
#include "driveModi/driveManager.h"
#include "OutputBuf/outputBuf.h"
@@ -50,6 +51,7 @@ LcdWrapper* lcdWrapper;
OutputBuf* outputBuf;
DebugMqtt* debugMqtt = nullptr;
Battery* mainBattery;
SPIClass* spiPort;
ControlPad* controlPad;
bool wifiIsActive;
@@ -65,8 +67,11 @@ void setup() {
DebugTimes setupTime;
char wifiIndicator = 'X';
spiPort = new SPIClass(HSPI);
spiPort->begin(UBLOX_GNSS_SPI_SCK, UBLOX_GNSS_SPI_CIPO, UBLOX_GNSS_SPI_COPI, UBLOX_GNSS_SPI_CS);
mainBattery = new Battery(35, 692000, 218500);
controlPad = new ControlPad();
controlPad = new ControlPad(spiPort, RF24_CE_PIN, RF24_CSN_PIN);
controlPad->setMenuControl(main_m);
Wire.begin(21, 19);
@@ -97,7 +102,7 @@ void setup() {
std::cout << "Welcome to Kleiax-Rover" << std::endl;
std::cout << "All actions from the main program run on Core -> " << xPortGetCoreID() << std::endl;
driveManager = new DriveManager(&moveController, controlPad->getControlPadDataPtr(), wifiIsActive);
driveManager = new DriveManager(&moveController, spiPort, controlPad->getControlPadDataPtr(), wifiIsActive);
outputBuf->activateMqtt(false);