mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-10 15:36:38 +02:00
* fixed debug messages
This commit is contained in:
parent
425ffdfc58
commit
7e2df351d9
6 changed files with 26 additions and 59 deletions
|
@ -12,9 +12,7 @@
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
app::app() : Main() {
|
app::app() : Main() {
|
||||||
#ifdef DEBUG_APP
|
DBGAPP(F("app::app():Main"));
|
||||||
DPRINTLN(F("app::app():Main"));
|
|
||||||
#endif
|
|
||||||
mSendTicker = 0xffff;
|
mSendTicker = 0xffff;
|
||||||
mSendInterval = 0;
|
mSendInterval = 0;
|
||||||
mMqttTicker = 0xffff;
|
mMqttTicker = 0xffff;
|
||||||
|
@ -51,9 +49,7 @@ app::~app(void) {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void app::setup(uint32_t timeout) {
|
void app::setup(uint32_t timeout) {
|
||||||
#ifdef DEBUG_APP
|
DBGAPP(F("app::setup"));
|
||||||
DPRINTLN(F("app::setup"));
|
|
||||||
#endif
|
|
||||||
Main::setup(timeout);
|
Main::setup(timeout);
|
||||||
|
|
||||||
mWeb->on("/", std::bind(&app::showIndex, this));
|
mWeb->on("/", std::bind(&app::showIndex, this));
|
||||||
|
@ -197,11 +193,7 @@ void app::setup(uint32_t timeout) {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void app::loop(void) {
|
void app::loop(void) {
|
||||||
#ifdef DEBUG_APP
|
//DBGAPP(F("app::loop"))
|
||||||
//DPRINT(F("a"));
|
|
||||||
//DPRINTLN(F("a"));
|
|
||||||
//app_loops++;
|
|
||||||
#ifdef DEBUG_APP
|
|
||||||
Main::loop();
|
Main::loop();
|
||||||
|
|
||||||
mSys->Radio.loop();
|
mSys->Radio.loop();
|
||||||
|
@ -363,18 +355,14 @@ void app::loop(void) {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void app::handleIntr(void) {
|
void app::handleIntr(void) {
|
||||||
#ifdef DEBUG_APP
|
DBGAPP(F("app::handleIntr"));
|
||||||
//DPRINTLN(F("app::handleIntr"));
|
|
||||||
#endif
|
|
||||||
mSys->Radio.handleIntr();
|
mSys->Radio.handleIntr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool app::buildPayload(uint8_t id) {
|
bool app::buildPayload(uint8_t id) {
|
||||||
#ifdef DEBUG_APP
|
//DBGAPP(F("app::buildPayload"));
|
||||||
//DPRINTLN(F("app::buildPayload"));
|
|
||||||
#endif
|
|
||||||
uint16_t crc = 0xffff, crcRcv;
|
uint16_t crc = 0xffff, crcRcv;
|
||||||
if(mPayload[id].maxPackId > MAX_PAYLOAD_ENTRIES)
|
if(mPayload[id].maxPackId > MAX_PAYLOAD_ENTRIES)
|
||||||
mPayload[id].maxPackId = MAX_PAYLOAD_ENTRIES;
|
mPayload[id].maxPackId = MAX_PAYLOAD_ENTRIES;
|
||||||
|
@ -399,10 +387,7 @@ bool app::buildPayload(uint8_t id) {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void app::processPayload(bool retransmit) {
|
void app::processPayload(bool retransmit) {
|
||||||
#ifdef DEBUG_APP
|
//DBGAPP(F("app::processPayload"));
|
||||||
//DPRINTLN(F("app::processPayload"));
|
|
||||||
//DPRINT(F("p"));
|
|
||||||
#endif
|
|
||||||
for(uint8_t id = 0; id < mSys->getNumInverters(); id++) {
|
for(uint8_t id = 0; id < mSys->getNumInverters(); id++) {
|
||||||
Inverter<> *iv = mSys->getInverterByPos(id);
|
Inverter<> *iv = mSys->getInverterByPos(id);
|
||||||
if(NULL != iv) {
|
if(NULL != iv) {
|
||||||
|
@ -468,9 +453,7 @@ void app::processPayload(bool retransmit) {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void app::showIndex(void) {
|
void app::showIndex(void) {
|
||||||
#ifdef DEBUG_APP
|
//DBGAPP(F("app::showIndex"));
|
||||||
DPRINTLN(F("app::showIndex"));
|
|
||||||
#endif
|
|
||||||
String html = FPSTR(index_html);
|
String html = FPSTR(index_html);
|
||||||
html.replace(F("{DEVICE}"), mDeviceName);
|
html.replace(F("{DEVICE}"), mDeviceName);
|
||||||
html.replace(F("{VERSION}"), mVersion);
|
html.replace(F("{VERSION}"), mVersion);
|
||||||
|
@ -482,9 +465,7 @@ void app::showIndex(void) {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void app::showSetup(void) {
|
void app::showSetup(void) {
|
||||||
#ifdef DEBUG_APP
|
DBGAPP(F("app::showSetup"));
|
||||||
DPRINTLN(F("app::showSetup"));
|
|
||||||
#endif
|
|
||||||
// overrides same method in main.cpp
|
// overrides same method in main.cpp
|
||||||
|
|
||||||
uint16_t interval;
|
uint16_t interval;
|
||||||
|
@ -604,18 +585,14 @@ void app::showSetup(void) {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void app::showSave(void) {
|
void app::showSave(void) {
|
||||||
#ifdef DEBUG_APP
|
DBGAPP(F("app::showSave"));
|
||||||
DPRINTLN(F("app::showSave"));
|
|
||||||
#endif
|
|
||||||
saveValues(true);
|
saveValues(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void app::showErase() {
|
void app::showErase() {
|
||||||
#ifdef DEBUG_APP
|
DBGAPP(F("app::showErase"));
|
||||||
DPRINTLN(F("app::showErase"));
|
|
||||||
#endif
|
|
||||||
eraseSettings();
|
eraseSettings();
|
||||||
showReboot();
|
showReboot();
|
||||||
}
|
}
|
||||||
|
@ -623,9 +600,7 @@ void app::showErase() {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void app::showStatistics(void) {
|
void app::showStatistics(void) {
|
||||||
#ifdef DEBUG_APP
|
//DBGAPP(F("app::showStatistics"));
|
||||||
//DPRINTLN(F("app::showStatistics"));
|
|
||||||
#endif
|
|
||||||
String content = F("Receive success: ") + String(mRxSuccess) + "\n";
|
String content = F("Receive success: ") + String(mRxSuccess) + "\n";
|
||||||
content += F("Receive fail: ") + String(mRxFailed) + "\n";
|
content += F("Receive fail: ") + String(mRxFailed) + "\n";
|
||||||
content += F("Frames received: ") + String(mFrameCnt) + "\n";
|
content += F("Frames received: ") + String(mFrameCnt) + "\n";
|
||||||
|
@ -673,9 +648,7 @@ void app::showStatistics(void) {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void app::showHoymiles(void) {
|
void app::showHoymiles(void) {
|
||||||
#ifdef DEBUG_APP
|
DBGAPP(F("app::showHoymiles"));
|
||||||
DPRINTLN(F("app::showHoymiles"));
|
|
||||||
#endif
|
|
||||||
String html = FPSTR(hoymiles_html);
|
String html = FPSTR(hoymiles_html);
|
||||||
html.replace(F("{DEVICE}"), mDeviceName);
|
html.replace(F("{DEVICE}"), mDeviceName);
|
||||||
html.replace(F("{VERSION}"), mVersion);
|
html.replace(F("{VERSION}"), mVersion);
|
||||||
|
@ -687,9 +660,7 @@ void app::showHoymiles(void) {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void app::showLiveData(void) {
|
void app::showLiveData(void) {
|
||||||
#ifdef DEBUG_APP
|
//DBGAPP(F("app::showLiveData"));
|
||||||
//DPRINTLN(F("app::showLiveData"));
|
|
||||||
#endif
|
|
||||||
String modHtml;
|
String modHtml;
|
||||||
for(uint8_t id = 0; id < mSys->getNumInverters(); id++) {
|
for(uint8_t id = 0; id < mSys->getNumInverters(); id++) {
|
||||||
Inverter<> *iv = mSys->getInverterByPos(id);
|
Inverter<> *iv = mSys->getInverterByPos(id);
|
||||||
|
@ -767,9 +738,7 @@ void app::showLiveData(void) {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void app::saveValues(bool webSend = true) {
|
void app::saveValues(bool webSend = true) {
|
||||||
#ifdef DEBUG_APP
|
DBGAPP(F("app::saveValues"));
|
||||||
DPRINTLN(F("app::saveValues"));
|
|
||||||
#endif
|
|
||||||
Main::saveValues(false); // general configuration
|
Main::saveValues(false); // general configuration
|
||||||
|
|
||||||
if(mWeb->args() > 0) {
|
if(mWeb->args() > 0) {
|
||||||
|
@ -878,9 +847,7 @@ void app::saveValues(bool webSend = true) {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void app::updateCrc(void) {
|
void app::updateCrc(void) {
|
||||||
#ifdef DEBUG_APP
|
DBGAPP(F("app::updateCrc"));
|
||||||
DPRINTLN(F("app::updateCrc"));
|
|
||||||
#endif
|
|
||||||
Main::updateCrc();
|
Main::updateCrc();
|
||||||
|
|
||||||
uint16_t crc;
|
uint16_t crc;
|
||||||
|
|
|
@ -17,9 +17,9 @@
|
||||||
#include "mqtt.h"
|
#include "mqtt.h"
|
||||||
|
|
||||||
#ifdef DEBUG_APP
|
#ifdef DEBUG_APP
|
||||||
#define DBGAPP(f,...) do { Serial.printf(PSTR(f), ##__VA_ARGS__); } while (0)
|
#define DBGAPP(f) (DPRINTLN(f))
|
||||||
#else
|
#else
|
||||||
#define DBGAPP(x...) do { (void)0; } while (0)
|
#define DBGAPP(f)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef CircularBuffer<packet_t, PACKET_BUFFER_SIZE> BufferType;
|
typedef CircularBuffer<packet_t, PACKET_BUFFER_SIZE> BufferType;
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
#include "hmDefines.h"
|
#include "hmDefines.h"
|
||||||
|
|
||||||
#ifdef DEBUG_HMINVERTER
|
#ifdef DEBUG_HMINVERTER
|
||||||
#define DBGINV(f,...) do { Serial.printf(PSTR(f), ##__VA_ARGS__); } while (0)
|
#define DBGINV(f) (DPRINTLN(f))
|
||||||
#else
|
#else
|
||||||
#define DBGINV(x...) do { (void)0; } while (0)
|
#define DBGINV(f)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG_HMRADIO
|
#ifdef DEBUG_HMRADIO
|
||||||
#define DBGHMR(f,...) do { Serial.printf(PSTR(f), ##__VA_ARGS__); } while (0)
|
#define DBGHMR(f) (DPRINTLN(f))
|
||||||
#else
|
#else
|
||||||
#define DBGHMR(x...) do { (void)0; } while (0)
|
#define DBGHMR(f)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char* const rf24AmpPower[] = {"MIN", "LOW", "HIGH", "MAX"};
|
const char* const rf24AmpPower[] = {"MIN", "LOW", "HIGH", "MAX"};
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_HMSYSTEM
|
#ifdef DEBUG_HMSYSTEM
|
||||||
#define DBGHMS(f,...) do { Serial.printf(PSTR(f), ##__VA_ARGS__); } while (0)
|
#define DBGHMS(f) (DPRINTLN(f))
|
||||||
#else
|
#else
|
||||||
#define DBGHMS(x...) do { (void)0; } while (0)
|
#define DBGHMS(f)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <class RADIO, class BUFFER, uint8_t MAX_INVERTER=3, class INVERTERTYPE=Inverter<float>>
|
template <class RADIO, class BUFFER, uint8_t MAX_INVERTER=3, class INVERTERTYPE=Inverter<float>>
|
||||||
|
|
|
@ -23,10 +23,10 @@
|
||||||
#include "crc.h"
|
#include "crc.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
#ifdef DEBUG_HMMAIN
|
#ifdef DEBUG_MAIN
|
||||||
#define DBGMAIN(f,...) do { Serial.printf(PSTR(f), ##__VA_ARGS__); } while (0)
|
#define DBGMAIN(f) (DPRINTLN(f))
|
||||||
#else
|
#else
|
||||||
#define DBGMAIN(x...) do { (void)0; } while (0)
|
#define DBGMAIN(f)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const byte mDnsPort = 53;
|
const byte mDnsPort = 53;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue