try to work ntrip client

This commit is contained in:
2022-10-24 22:08:19 +02:00
parent ee5bc9129a
commit e01127e3e3
12 changed files with 108 additions and 44 deletions
+12 -4
View File
@@ -12,6 +12,13 @@
DebugTimes::DebugTimes() {
this->startTime = millis();
static bool firstInstance = true;
if (firstInstance) {
firstInstance = false;
if (!DebugTimes::print)
std::cout << std::endl << "Warning: DebugTimes is muuted, no times are be shown." << std::endl << std::endl;
}
}
void DebugTimes::restart() {
@@ -22,8 +29,9 @@ uint16_t DebugTimes::stop() {
return millis() - this->startTime;
}
void DebugTimes::stopConsol(const char* name, uint16_t minTime) {
uint16_t DebugTimes::stopConsol(const char* name, uint16_t minTime) {
uint64_t time = millis() - this->startTime;
if (time > minTime)
Serial.printf("%s needs %llu ms\n", name, time);
}
if (time > minTime && DebugTimes::print)
std::cout << name << " needs " << time << " ms" << std::endl;
return time;
}
+7 -2
View File
@@ -14,6 +14,7 @@
#include <list>
#include <cstdint>
#include <iostream>
#include <Arduino.h>
@@ -53,11 +54,15 @@ class DebugTimes {
*
* @param name Functionname to print
* @param minTime A minimum time before printing
*
* @return uint16_t elapsed milliseconds
*/
void stopConsol(const char* name, uint16_t minTime = 0);
uint16_t stopConsol(const char* name, uint16_t minTime = 0);
private:
uint64_t startTime;
static const bool print = false;
};
#endif //DEBUG_TIMES_H
#endif //DEBUG_TIMES_H