Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usages de DEBUG_SERIAL remplacés par les bonnes fonctions de Debug #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void showConfig()
DebugF("key :"); Debugln(config.jeedom.apikey);
DebugF("finger :");
for (int i=0; i < CFG_JDOM_FINGER_PRINT_SIZE; i++) {
DEBUG_SERIAL.print(config.jeedom.fingerprint[i], HEX);
DebugIntFormat(config.jeedom.fingerprint[i], HEX);
DebugF(" ");
}
Debugln();
Expand Down
2 changes: 1 addition & 1 deletion i2c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ uint8_t i2c_scan()
DebugF("I2C device found at address 0x");
if (address<16)
DebugF("0");
DEBUG_SERIAL.print(address, HEX);
DebugIntFormat(address, HEX);

if (address>=0x20 && address<=0x27)
Debugln("-> MCP23017 !");
Expand Down
6 changes: 3 additions & 3 deletions linked_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ uint8_t ll_Dump(NodeList * me, unsigned long sec)

index++;
Debug(index); DebugF(") ") ;
DebugF("Group:"); DEBUG_SERIAL.print(me->groupid, DEC) ;
DebugF(" Node:"); DEBUG_SERIAL.print(me->nodeid, DEC) ;
DebugF(" RSSI:"); DEBUG_SERIAL.print(me->rssi, DEC) ;
DebugF("Group:"); DebugIntFormat(me->groupid, DEC) ;
DebugF(" Node:"); DebugIntFormat(me->nodeid, DEC) ;
DebugF(" RSSI:"); DebugIntFormat(me->rssi, DEC) ;
DebugF(" seen:"); Debug(sec-me->lastseen) ;
DebuglnF("") ;
}
Expand Down
6 changes: 6 additions & 0 deletions remora.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,19 @@ extern "C" {
#define DebuglnF(x) DEBUG_SERIAL.println(F(x))
#define Debugf(...) DEBUG_SERIAL.printf(__VA_ARGS__)
#define Debugflush DEBUG_SERIAL.flush
#define DebugWiFi() WiFi.printDiag(DEBUG_SERIAL)
#define DebugIntFormat(x,format) DEBUG_SERIAL.print(x, format)
#define DebugUpdateError() Update.printError(DEBUG_SERIAL)
#else
#define Debug(x)
#define Debugln(x)
#define DebugF(x)
#define DebuglnF(x)
#define Debugf(...)
#define Debugflush()
#define DebugWiFi()
#define DebugIntFormat(x,format)
#define DebugUpdateError()
#endif

#ifdef ESP8266
Expand Down
2 changes: 1 addition & 1 deletion remora_soft.ino
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ int WifiHandleConn(boolean setup = false)
_wdt_feed();

DebugF("========== SDK Saved parameters Start");
WiFi.printDiag(DEBUG_SERIAL);
DebugWiFi();
DebuglnF("========== SDK Saved parameters End");

#if defined (DEFAULT_WIFI_SSID) && defined (DEFAULT_WIFI_PASS)
Expand Down
12 changes: 6 additions & 6 deletions rfm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,11 @@ void rfm_loop(void)
DebugF(" ACKED");


DebugF(" <- node:"); DEBUG_SERIAL.print(rfData.nodeid,DEC);
DebugF(" <- node:"); DebugIntFormat(rfData.nodeid,DEC);
DebugF(" size:"); Debug(rfData.size);
DebugF(" type:"); DEBUG_SERIAL.print(decode_frame_type(cmd));
DebugF(" (0x"); DEBUG_SERIAL.print(cmd,HEX);
DebugF(") RSSI:"); DEBUG_SERIAL.print(rfData.rssi,DEC);
DebugF(" type:"); Debug(decode_frame_type(cmd));
DebugF(" (0x"); DebugIntFormat(cmd,HEX);
DebugF(") RSSI:"); DebugIntFormat(rfData.rssi,DEC);
DebugF("dB seen :");
Debug(timeAgo(seen));

Expand Down Expand Up @@ -284,9 +284,9 @@ void rfm_loop(void)
// Start line with a # (comment)
// indicate external parser that it's just debug information
DebugF("\r\n# -> ");
DEBUG_SERIAL.print(rfData.nodeid,DEC);
DebugIntFormat(rfData.nodeid,DEC);
DebugF(" PINGBACK (");
DEBUG_SERIAL.print(ppl->rssi,DEC);
DebugIntFormat(ppl->rssi,DEC);
DebuglnF("dB)");
}

Expand Down
2 changes: 1 addition & 1 deletion tinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void DataCallback(ValueList * me, uint8_t flags)
Debug(me->value);

//Debug(" Flags=0x");
//DEBUG_SERIAL.print(flags, HEX);
//DebugIntFormat(flags, HEX);

if ( flags & TINFO_FLAGS_NOTHING ) DebugF(" Nothing");
if ( flags & TINFO_FLAGS_ADDED ) DebugF(" Added");
Expand Down
6 changes: 3 additions & 3 deletions webserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -988,14 +988,14 @@ void handle_fw_upload(AsyncWebServerRequest *request, String filename, size_t in
//DebuglnF("Command U_SPIFFS");
}
if (!Update.begin((ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000, command)) {
Update.printError(DEBUG_SERIAL);
DebugUpdateError();
}
}

if (!Update.hasError()) {
if (Update.write(data, len) != len) {
DebugF("*** UPDATE ERROR: ");
Update.printError(DEBUG_SERIAL);
DebugUpdateError();
if (ota_blink) {
LedRGBON(COLOR_RED);
} else {
Expand All @@ -1018,7 +1018,7 @@ void handle_fw_upload(AsyncWebServerRequest *request, String filename, size_t in
if (Update.end(true)) {
Debugf("Update Success: %uB\n", index+len);
} else {
Update.printError(DEBUG_SERIAL);
DebugUpdateError();
}
LedRGBOFF();
}
Expand Down