gps now over spi
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user