debugMsg
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
#include "LiveData.h"
|
||||
#include "menu.h"
|
||||
|
||||
/**
|
||||
* Debug level
|
||||
*/
|
||||
void debug(String msg, uint8_t debugLevel) {
|
||||
Serial.println(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
Init params with default values
|
||||
*/
|
||||
|
||||
12
LiveData.h
12
LiveData.h
@@ -20,7 +20,7 @@
|
||||
#define CAR_BMW_I3_2014 7
|
||||
#define CAR_DEBUG_OBD2_KIA 999
|
||||
|
||||
//
|
||||
// COMM TYPE
|
||||
#define COMM_TYPE_OBD2BLE4 0
|
||||
#define COMM_TYPE_OBD2CAN 1
|
||||
#define COMM_TYPE_OBD2BT3 2
|
||||
@@ -34,6 +34,12 @@
|
||||
#define SCREEN_CHARGING 5
|
||||
#define SCREEN_SOC10 6
|
||||
|
||||
// DEBUG LEVEL
|
||||
#define DEBUG_INFO 0
|
||||
#define DEBUG_COMM 1
|
||||
#define DEBUG_GPS 2
|
||||
#define DEBUG_SDCARD 3
|
||||
|
||||
//
|
||||
#define MONTH_SEC 2678400
|
||||
|
||||
@@ -209,8 +215,10 @@ typedef struct {
|
||||
//
|
||||
} SETTINGS_STRUC;
|
||||
|
||||
// Debug functions
|
||||
void debug(String msg, uint8_t debugLevel = DEBUG_INFO);
|
||||
|
||||
//
|
||||
// LiveData class
|
||||
class LiveData {
|
||||
protected:
|
||||
public:
|
||||
|
||||
@@ -65,8 +65,7 @@ void setup(void) {
|
||||
|
||||
// Serial console, init structures
|
||||
Serial.begin(115200);
|
||||
Serial.println("");
|
||||
Serial.println("Booting device...");
|
||||
debug("\nBooting device...");
|
||||
|
||||
// Init settings/params
|
||||
liveData = new LiveData();
|
||||
@@ -74,7 +73,7 @@ void setup(void) {
|
||||
|
||||
// Turn off serial console
|
||||
if (liveData->settings.serialConsolePort = 255) {
|
||||
Serial.println("Serial console disabled...");
|
||||
debug("Serial console disabled...");
|
||||
Serial.flush();
|
||||
Serial.end();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user