refactore

This commit is contained in:
2023-09-03 12:36:16 +02:00
parent faaa3603a7
commit 5f650982a7
30 changed files with 578 additions and 430 deletions
+15 -11
View File
@@ -11,17 +11,8 @@
#include "sensors.h"
void Sensors::run() {
this->compass->read();
this->realAzimuth = this->compass->getAzimuth();
}
void Sensors::runAsChild() {
this->gnss->checkUblox();
this->gnss->checkCallbacks();
if (Sensors::newData)
Sensors::newData = false;
Sensors::Sensors() {
this->sensorData = new SensorData(this);
}
void Sensors::enableGnss(SPIClass* spiPort, uint8_t csPin) {
@@ -59,6 +50,19 @@ void Sensors::setOutputStatusPrintPVTdata(bool status) {
Sensors::outputStatusPrintPVTdata = status;
}
void Sensors::run() {
this->compass->read();
this->realAzimuth = this->compass->getAzimuth();
}
void Sensors::runAsChild() {
this->gnss->checkUblox();
this->gnss->checkCallbacks();
if (Sensors::newData)
Sensors::newData = false;
}
void Sensors::initGnss() {
uint8_t versionHigh = this->gnss->getProtocolVersionHigh();
uint8_t versionLow = this->gnss->getProtocolVersionLow();