gps now over spi

This commit is contained in:
2022-12-09 14:10:57 +01:00
parent 599f176622
commit f14992c040
26 changed files with 974 additions and 225 deletions
+14 -5
View File
@@ -10,14 +10,15 @@
*/
#include "debugTimes.h"
bool DebugTimes::print = false;
bool DebugTimes::printWarning = true;
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;
if (!DebugTimes::printWarning) {
std::cout << std::endl << "Warning: DebugTimes is muuted, no times are be shown." << std::endl << std::endl;
DebugTimes::printWarning = false;
}
}
@@ -35,3 +36,11 @@ uint16_t DebugTimes::stopConsol(const char* name, uint16_t minTime) {
std::cout << name << " needs " << time << " ms" << std::endl;
return time;
}
void DebugTimes::setConsolOutput(bool enable) {
if (enable == DebugTimes::print)
return;
DebugTimes::print = enable;
DebugTimes::printWarning = !enable;
}
+4 -1
View File
@@ -59,10 +59,13 @@ class DebugTimes {
*/
uint16_t stopConsol(const char* name, uint16_t minTime = 0);
static void setConsolOutput(bool enable);
private:
uint64_t startTime;
static const bool print = false;
static bool print;
static bool printWarning;
};
#endif //DEBUG_TIMES_H