This commit is contained in:
Klaus K Wilting 2018-08-11 19:31:42 +02:00
parent fcd9357116
commit 5880b7e9ff
3 changed files with 17 additions and 19 deletions

View File

@ -43,10 +43,18 @@ build_flags =
; ---> NOTE: For production run set DEBUG_LEVEL level to NONE! <--- ; ---> NOTE: For production run set DEBUG_LEVEL level to NONE! <---
; otherwise device may leak RAM ; otherwise device may leak RAM
; ;
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE ; None
-DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_INFO ; -DCORE_DEBUG_LEVEL=0
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG ; Error
; -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_VERBOSE ; -DCORE_DEBUG_LEVEL=1
; Warn
-DCORE_DEBUG_LEVEL=2
; Info
; -DCORE_DEBUG_LEVEL=3
; Debug
; -DCORE_DEBUG_LEVEL=4
; Verbose
; -DCORE_DEBUG_LEVEL=5
; ;
; override lora settings from LMiC library in lmic/config.h and use main.h instead ; override lora settings from LMiC library in lmic/config.h and use main.h instead
-D_lmic_config_h_ -D_lmic_config_h_

View File

@ -4,11 +4,8 @@
// The mother of all embedded development... // The mother of all embedded development...
#include <Arduino.h> #include <Arduino.h>
// needed for ESP_LOGx on arduino framework
#include <esp32-hal-log.h>
// attn: increment version after modifications to configData_t truct! // attn: increment version after modifications to configData_t truct!
#define PROGVERSION "1.4.22" // use max 10 chars here! #define PROGVERSION "1.4.23" // use max 10 chars here!
#define PROGNAME "PAXCNT" #define PROGNAME "PAXCNT"
// std::set for unified array functions // std::set for unified array functions

View File

@ -8,8 +8,8 @@ void SendData(uint8_t port) {
SendBuffer.MessageSize = payload.getSize(); SendBuffer.MessageSize = payload.getSize();
SendBuffer.MessagePort = PAYLOAD_ENCODER <= 2 SendBuffer.MessagePort = PAYLOAD_ENCODER <= 2
? port ? port
: (PAYLOAD_ENCODER == 4 ? LPP2PORT : LPP1PORT); : (PAYLOAD_ENCODER == 4 ? LPP2PORT : LPP1PORT);
memcpy(SendBuffer.Message, payload.getBuffer(), payload.getSize()); memcpy(SendBuffer.Message, payload.getBuffer(), payload.getSize());
// enqueue message in LoRa send queue // enqueue message in LoRa send queue
@ -79,9 +79,6 @@ void IRAM_ATTR SendCycleIRQ() {
// cyclic called function to eat data from RTos send queues and transmit it // cyclic called function to eat data from RTos send queues and transmit it
void processSendBuffer() { void processSendBuffer() {
int m1 = 0, m2 = 0;
m1 = ESP.getFreeHeap();
MessageBuffer_t SendBuffer; MessageBuffer_t SendBuffer;
#ifdef HAS_LORA #ifdef HAS_LORA
@ -93,7 +90,7 @@ void processSendBuffer() {
// SendBuffer gets struct MessageBuffer with next payload from queue // SendBuffer gets struct MessageBuffer with next payload from queue
LMIC_setTxData2(SendBuffer.MessagePort, SendBuffer.Message, LMIC_setTxData2(SendBuffer.MessagePort, SendBuffer.Message,
SendBuffer.MessageSize, (cfg.countermode & 0x02)); SendBuffer.MessageSize, (cfg.countermode & 0x02));
//ESP_LOGI(TAG, "%d bytes sent to LoRa", SendBuffer.MessageSize); ESP_LOGI(TAG, "%d bytes sent to LoRa", SendBuffer.MessageSize);
sprintf(display_line7, "PACKET QUEUED"); sprintf(display_line7, "PACKET QUEUED");
} }
} }
@ -101,14 +98,10 @@ void processSendBuffer() {
#ifdef HAS_SPI #ifdef HAS_SPI
if (xQueueReceive(SPISendQueue, &SendBuffer, (TickType_t)0) == pdTRUE) { if (xQueueReceive(SPISendQueue, &SendBuffer, (TickType_t)0) == pdTRUE) {
//ESP_LOGI(TAG, "%d bytes sent to SPI", SendBuffer.MessageSize); ESP_LOGI(TAG, "%d bytes sent to SPI", SendBuffer.MessageSize);
} }
#endif #endif
m2 = ESP.getFreeHeap();
if (m2 - m1)
ESP_LOGI(TAG, "processSendBuffer consumed %d bytes", m2 - m1);
} // processSendBuffer } // processSendBuffer
void flushQueues() { void flushQueues() {