replace macros with DEBUG_LEVEL aware timestamp function

This commit is contained in:
Conor Patrick
2019-02-12 20:28:48 -05:00
parent e7e83820a9
commit 831976f3a2
6 changed files with 30 additions and 61 deletions

View File

@@ -9,6 +9,7 @@
#include <stdarg.h>
#include "log.h"
#include "util.h"
#include "device.h"
#if DEBUG_LEVEL > 0
@@ -99,4 +100,14 @@ void LOG_HEX(uint32_t tag, uint8_t * data, int length)
set_logging_tag(tag);
dump_hex(data,length);
}
uint32_t timestamp()
{
static uint32_t t1 = 0;
uint32_t t2 = millis();
uint32_t diff = t2 - t1;
t1 = t2;
return t2;
}
#endif