Replace most remaining ESP_ debug macros (#2305)
In ported libraries there were still some remaining DEBUG_ESP_PORT references. Moved to their RP2040 equivalents.
This commit is contained in:
parent
34f386a21b
commit
4f4e638aee
9 changed files with 37 additions and 43 deletions
|
|
@ -22,23 +22,22 @@
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <WiFiUdp.h>
|
#include <WiFiUdp.h>
|
||||||
#include "ArduinoOTA.h"
|
#include "ArduinoOTA.h"
|
||||||
#include "MD5Builder.h"
|
#include <MD5Builder.h>
|
||||||
#include <PicoOTA.h>
|
#include <PicoOTA.h>
|
||||||
#include <StreamString.h>
|
#include <StreamString.h>
|
||||||
|
|
||||||
#include "lwip/udp.h"
|
#include <lwip/udp.h>
|
||||||
#include "include/UdpContext.h"
|
#include <include/UdpContext.h>
|
||||||
|
|
||||||
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_MDNS)
|
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_MDNS)
|
||||||
#include <LEAmDNS.h>
|
#include <LEAmDNS.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#ifdef DEBUG_ESP_OTA
|
#ifdef DEBUG_RP2040_CORE
|
||||||
//#ifdef DEBUG_ESP_PORT
|
#ifdef DEBUG_RP2040_PORT
|
||||||
//#define OTA_DEBUG DEBUG_ESP_PORT
|
#define OTA_DEBUG DEBUG_RP2040_PORT
|
||||||
//#endif
|
#endif
|
||||||
//#endif
|
#endif
|
||||||
#define OTA_DEBUG Serial
|
|
||||||
|
|
||||||
ArduinoOTAClass::ArduinoOTAClass() {
|
ArduinoOTAClass::ArduinoOTAClass() {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@
|
||||||
#include <lwip/def.h>
|
#include <lwip/def.h>
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
#ifdef DEBUG_ESP_PORT
|
#ifdef DEBUG_RP2040_PORT
|
||||||
#define CONSOLE DEBUG_ESP_PORT
|
#define CONSOLE DEBUG_RP2040_PORT
|
||||||
#else
|
#else
|
||||||
#define CONSOLE Serial
|
#define CONSOLE Serial
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@
|
||||||
#include <WiFiUdp.h>
|
#include <WiFiUdp.h>
|
||||||
#include <HTTPClient.h>
|
#include <HTTPClient.h>
|
||||||
|
|
||||||
#ifdef DEBUG_ESP_HTTP_UPDATE
|
#ifdef DEBUG_RP2040_CORE
|
||||||
#ifdef DEBUG_ESP_PORT
|
#ifdef DEBUG_RP2040_PORT
|
||||||
#define DEBUG_HTTP_UPDATE(fmt, ...) DEBUG_ESP_PORT.printf_P( (PGM_P)PSTR(fmt), ## __VA_ARGS__ )
|
#define DEBUG_HTTP_UPDATE(fmt, ...) DEBUG_RP2040_PORT.printf_P( (PGM_P)PSTR(fmt), ## __VA_ARGS__ )
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
SD.h - A thin shim for Arduino ESP8266 Filesystems
|
SD.h - A thin shim for Arduino RP2040 Filesystems
|
||||||
Copyright (c) 2019 Earle F. Philhower, III. All rights reserved.
|
Copyright (c) 2019 Earle F. Philhower, III. All rights reserved.
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
|
|
@ -139,9 +139,9 @@ public:
|
||||||
|
|
||||||
size_t size() {
|
size_t size() {
|
||||||
uint64_t sz = size64();
|
uint64_t sz = size64();
|
||||||
#ifdef DEBUG_ESP_PORT
|
#ifdef DEBUG_RP2040_PORT
|
||||||
if (sz > std::numeric_limits<uint32_t>::max()) {
|
if (sz > std::numeric_limits<uint32_t>::max()) {
|
||||||
DEBUG_ESP_PORT.printf_P(PSTR("WARNING: SD card size overflow (%lld >= 4GB). Please update source to use size64().\n"), (long long)sz);
|
DEBUG_RP2040_PORT.printf_P(PSTR("WARNING: SD card size overflow (%lld >= 4GB). Please update source to use size64().\n"), (long long)sz);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return (size_t)sz;
|
return (size_t)sz;
|
||||||
|
|
|
||||||
|
|
@ -115,10 +115,10 @@ public:
|
||||||
info.pageSize = i.pageSize;
|
info.pageSize = i.pageSize;
|
||||||
info.maxOpenFiles = i.maxOpenFiles;
|
info.maxOpenFiles = i.maxOpenFiles;
|
||||||
info.maxPathLength = i.maxPathLength;
|
info.maxPathLength = i.maxPathLength;
|
||||||
#ifdef DEBUG_ESP_PORT
|
#ifdef DEBUG_RP2040_PORT
|
||||||
if (i.totalBytes > std::numeric_limits<uint32_t>::max()) {
|
if (i.totalBytes > std::numeric_limits<uint32_t>::max()) {
|
||||||
// This catches both total and used cases, since used must always be < total.
|
// This catches both total and used cases, since used must always be < total.
|
||||||
DEBUG_ESP_PORT.printf_P(PSTR("WARNING: SD card size overflow (%lld >= 4GB). Please update source to use info64().\n"), (long long)i.totalBytes);
|
DEBUG_RP2040_PORT.printf_P(PSTR("WARNING: SD card size overflow (%lld >= 4GB). Please update source to use info64().\n"), (long long)i.totalBytes);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
info.totalBytes = (size_t)i.totalBytes;
|
info.totalBytes = (size_t)i.totalBytes;
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
#if defined(DEBUG_ESP_SSL) && defined(DEBUG_ESP_PORT)
|
#if defined(DEBUG_RP2040_CORE) && defined(DEBUG_RP2040_PORT)
|
||||||
#define DEBUG_BSSL(fmt, ...) DEBUG_ESP_PORT.printf_P((PGM_P)PSTR( "BSSL:" fmt), ## __VA_ARGS__)
|
#define DEBUG_BSSL(fmt, ...) DEBUG_RP2040_PORT.printf_P((PGM_P)PSTR( "BSSL:" fmt), ## __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define DEBUG_BSSL(...)
|
#define DEBUG_BSSL(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -29,18 +29,14 @@
|
||||||
#include "WiFiClientSecureBearSSL.h"
|
#include "WiFiClientSecureBearSSL.h"
|
||||||
#include "WiFiNTP.h"
|
#include "WiFiNTP.h"
|
||||||
#include "StackThunk.h"
|
#include "StackThunk.h"
|
||||||
#include "lwip/opt.h"
|
#include <lwip/opt.h>
|
||||||
#include "lwip/ip.h"
|
#include <lwip/ip.h>
|
||||||
#include "lwip/tcp.h"
|
#include <lwip/tcp.h>
|
||||||
#include "lwip/inet.h"
|
#include <lwip/inet.h>
|
||||||
#include "lwip/netif.h"
|
#include <lwip/netif.h>
|
||||||
#include <include/ClientContext.h>
|
#include <include/ClientContext.h>
|
||||||
//#include "c_types.h"
|
|
||||||
//#include <mmu_iram.h>
|
#if !defined(CORE_MOCK)
|
||||||
//#include <umm_malloc/umm_malloc.h>
|
|
||||||
//#include <umm_malloc/umm_heap_select.h>
|
|
||||||
#if 1
|
|
||||||
#if !CORE_MOCK
|
|
||||||
|
|
||||||
// The BearSSL thunks in use for now
|
// The BearSSL thunks in use for now
|
||||||
#define br_ssl_engine_recvapp_ack thunk_br_ssl_engine_recvapp_ack
|
#define br_ssl_engine_recvapp_ack thunk_br_ssl_engine_recvapp_ack
|
||||||
|
|
@ -52,11 +48,10 @@
|
||||||
#define br_ssl_engine_sendrec_ack thunk_br_ssl_engine_sendrec_ack
|
#define br_ssl_engine_sendrec_ack thunk_br_ssl_engine_sendrec_ack
|
||||||
#define br_ssl_engine_sendrec_buf thunk_br_ssl_engine_sendrec_buf
|
#define br_ssl_engine_sendrec_buf thunk_br_ssl_engine_sendrec_buf
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(DEBUG_ESP_SSL) && defined(DEBUG_ESP_PORT)
|
#if defined(DEBUG_RP2040_CORE) && defined(DEBUG_RP2040_PORT)
|
||||||
#define DEBUG_BSSL(fmt, ...) DEBUG_ESP_PORT.printf_P((PGM_P)PSTR( "BSSL:" fmt), ## __VA_ARGS__)
|
#define DEBUG_BSSL(fmt, ...) DEBUG_RP2040_PORT.printf_P((PGM_P)PSTR( "BSSL:" fmt), ## __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define DEBUG_BSSL(...)
|
#define DEBUG_BSSL(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -721,12 +716,12 @@ extern "C" {
|
||||||
if (!xc->done_cert) {
|
if (!xc->done_cert) {
|
||||||
br_sha1_update(&xc->sha1_cert, buf, len);
|
br_sha1_update(&xc->sha1_cert, buf, len);
|
||||||
br_x509_decoder_push(&xc->ctx, (const void*)buf, len);
|
br_x509_decoder_push(&xc->ctx, (const void*)buf, len);
|
||||||
#if defined(DEBUG_ESP_SSL) && defined(DEBUG_ESP_PORT)
|
#if defined(DEBUG_RP2040_CORE) && defined(DEBUG_RP2040_PORT)
|
||||||
DEBUG_BSSL("CERT: ");
|
DEBUG_BSSL("CERT: ");
|
||||||
for (size_t i = 0; i < len; i++) {
|
for (size_t i = 0; i < len; i++) {
|
||||||
DEBUG_ESP_PORT.printf_P(PSTR("%02x "), buf[i] & 0xff);
|
DEBUG_RP2040_PORT.printf_P(PSTR("%02x "), buf[i] & 0xff);
|
||||||
}
|
}
|
||||||
DEBUG_ESP_PORT.printf_P(PSTR("\n"));
|
DEBUG_RP2040_PORT.printf_P(PSTR("\n"));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -750,7 +745,7 @@ extern "C" {
|
||||||
char res[20];
|
char res[20];
|
||||||
br_sha1_out(&xc->sha1_cert, res);
|
br_sha1_out(&xc->sha1_cert, res);
|
||||||
if (xc->match_fingerprint && memcmp(res, xc->match_fingerprint, sizeof(res))) {
|
if (xc->match_fingerprint && memcmp(res, xc->match_fingerprint, sizeof(res))) {
|
||||||
#ifdef DEBUG_ESP_SSL
|
#if defined(DEBUG_RP2040_CORE) && defined(DEBUG_RP2040_PORT)
|
||||||
DEBUG_BSSL("insecure_end_chain: Received cert FP doesn't match\n");
|
DEBUG_BSSL("insecure_end_chain: Received cert FP doesn't match\n");
|
||||||
char buff[3 * sizeof(res) + 1]; // 3 chars per byte XX_, and null
|
char buff[3 * sizeof(res) + 1]; // 3 chars per byte XX_, and null
|
||||||
buff[0] = 0;
|
buff[0] = 0;
|
||||||
|
|
@ -1143,7 +1138,7 @@ bool WiFiClientSecureCtx::_connectSSL(const char* hostName) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_ESP_SSL
|
#if defined(DEBUG_RP2040_CORE) && defined(DEBUG_RP2040_PORT)
|
||||||
// BearSSL will reject all connections unless an authentication option is set, warn in DEBUG builds
|
// BearSSL will reject all connections unless an authentication option is set, warn in DEBUG builds
|
||||||
if (!_use_insecure && !_use_fingerprint && !_use_self_signed && !_knownkey && !_certStore && !_ta) {
|
if (!_use_insecure && !_use_fingerprint && !_use_self_signed && !_knownkey && !_certStore && !_ta) {
|
||||||
DEBUG_BSSL("Connection *will* fail, no authentication method is setup\n");
|
DEBUG_BSSL("Connection *will* fail, no authentication method is setup\n");
|
||||||
|
|
@ -1213,7 +1208,7 @@ bool WiFiClientSecureCtx::_connectSSL(const char* hostName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ret = _wait_for_handshake();
|
auto ret = _wait_for_handshake();
|
||||||
#ifdef DEBUG_ESP_SSL
|
#if defined(DEBUG_RP2040_CORE) && defined(DEBUG_RP2040_PORT)
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
char err[256];
|
char err[256];
|
||||||
getLastSSLError(err, sizeof(err));
|
getLastSSLError(err, sizeof(err));
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ public:
|
||||||
_on_rx = handler;
|
_on_rx = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_ESP_CORE
|
#ifdef DEBUG_RP2040_CORE
|
||||||
// this helper is ready to be used when debugging UDP
|
// this helper is ready to be used when debugging UDP
|
||||||
void printChain(const pbuf* pb, const char* msg, size_t n) const {
|
void printChain(const pbuf* pb, const char* msg, size_t n) const {
|
||||||
// printf the pb pbuf chain, buffered and all at once
|
// printf the pb pbuf chain, buffered and all at once
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ extern "C" void netif_status_changed(struct netif* netif) {
|
||||||
|
|
||||||
bool LwipIntf::stateChangeSysCB(LwipIntf::CBType&& cb) {
|
bool LwipIntf::stateChangeSysCB(LwipIntf::CBType&& cb) {
|
||||||
if (netifStatusChangeListLength >= NETIF_STATUS_CB_SIZE) {
|
if (netifStatusChangeListLength >= NETIF_STATUS_CB_SIZE) {
|
||||||
#if defined(DEBUG_ESP_CORE)
|
#if defined(DEBUG_RP2040_CORE)
|
||||||
DEBUGV("NETIF_STATUS_CB_SIZE is too low\n");
|
DEBUGV("NETIF_STATUS_CB_SIZE is too low\n");
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue