diff --git a/src/shared/logger/Logger.cpp b/src/shared/logger/Logger.cpp index 2709fbcc2f7d3a6e9bf860f180f7036200b4a433..e7c882215521ee88980574661c6a23e634bf7137 100644 --- a/src/shared/logger/Logger.cpp +++ b/src/shared/logger/Logger.cpp @@ -301,7 +301,7 @@ LoggerResult Logger::logImpl(const char* name, const void* data, { if (started == false) { - TRACE("Attempting to log %s but the Logger is not started!\n", name); + // TRACE("Attempting to log %s but the Logger is not started!\n", name); stats.droppedSamples++; // Signal that we are trying to write to a closed log diff --git a/src/shared/sensors/BME280/BME280.cpp b/src/shared/sensors/BME280/BME280.cpp index fe621101c837e69e7bee8ad661de96ad1116a03e..60b9b4f1aafdf5fa6a16f1dc4d32e331eb7efe22 100644 --- a/src/shared/sensors/BME280/BME280.cpp +++ b/src/shared/sensors/BME280/BME280.cpp @@ -115,6 +115,8 @@ bool BME280::init() return false; } + LOG_DEBUG(logger, "Device configurated correctly!"); + return true; } diff --git a/src/shared/sensors/UBXGPS/UBXGPSSerial.cpp b/src/shared/sensors/UBXGPS/UBXGPSSerial.cpp index 41006faf446caf88da6c4fba667ac11e1d8be2a5..c5dabc4be7d29661625b8b47bfd9e2263bcf30f9 100644 --- a/src/shared/sensors/UBXGPS/UBXGPSSerial.cpp +++ b/src/shared/sensors/UBXGPS/UBXGPSSerial.cpp @@ -100,6 +100,8 @@ bool UBXGPSSerial::init() return false; } + this->start(); + return true; } @@ -311,7 +313,8 @@ bool UBXGPSSerial::readUBXFrame(UBXFrame& frame) else { i = 0; - LOG_DEBUG(logger, "Received unexpected byte: {:02x} {:#c}", c, c); + // LOG_DEBUG(logger, "Received unexpected byte: {:02x} {:#c}", c, + // c); } } @@ -405,6 +408,8 @@ void UBXGPSSerial::run() UBXPvtFrame::Payload& pvtP = pvt.getPayload(); + // Lock the mutex + Lock<FastMutex> l(mutex); threadSample.gpsTimestamp = TimestampTimer::getInstance().getTimestamp(); threadSample.latitude = (float)pvtP.lat / 1e7; diff --git a/src/tests/sensors/test-ubxgps-serial.cpp b/src/tests/sensors/test-ubxgps-serial.cpp index 316b049f574822b53390dc663b83b226511ed990..e05dc463200ba45f776416632d35228c45a9c121 100644 --- a/src/tests/sensors/test-ubxgps-serial.cpp +++ b/src/tests/sensors/test-ubxgps-serial.cpp @@ -30,7 +30,7 @@ using namespace Boardcore; using namespace miosix; -#define RATE 4 +#define RATE 10 int main() { @@ -43,7 +43,7 @@ int main() tx.alternateFunction(7); // Keep GPS baud rate at default for easier testing - UBXGPSSerial gps(38400, RATE, 2, "gps", 9600); + UBXGPSSerial gps(256000, RATE, 2, "gps", 9600); UBXGPSData dataGPS; printf("Gps allocated\n"); @@ -68,7 +68,7 @@ int main() } // Start the gps thread - gps.start(); + // gps.start(); printf("Gps started\n"); while (true)