mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-06 03:50:13 +02:00
Move logging of version/data/time to setup()
Move logging of version/data/time to setup() to ensure it is also printed to serial.
This commit is contained in:
parent
fd76959a21
commit
f47f5ca9d3
2 changed files with 5 additions and 8 deletions
|
@ -97,6 +97,10 @@ Logging logging;
|
|||
void setup() {
|
||||
init_serial();
|
||||
|
||||
// We print this after setting up serial, such that is also printed to serial with DEBUG_VIA_USB set.
|
||||
logging.printf("Battery emulator %s build " __DATE__
|
||||
" " __TIME__ "\n", version_number);
|
||||
|
||||
init_stored_settings();
|
||||
|
||||
#ifdef WIFI
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
#include <inttypes.h>
|
||||
#include "Print.h"
|
||||
|
||||
extern const char* version_number; // The current software version, shown on webserver
|
||||
|
||||
class Logging : public Print {
|
||||
void add_timestamp(size_t size);
|
||||
|
||||
|
@ -13,12 +11,7 @@ class Logging : public Print {
|
|||
virtual size_t write(const uint8_t* buffer, size_t size);
|
||||
virtual size_t write(uint8_t) { return 0; }
|
||||
void printf(const char* fmt, ...);
|
||||
Logging() {
|
||||
printf(
|
||||
"Battery emulator %s build "__DATE__
|
||||
" " __TIME__ "\n",
|
||||
version_number);
|
||||
}
|
||||
Logging() {}
|
||||
};
|
||||
|
||||
extern Logging logging;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue