Fix #endif issues in fdrs_functions.h

This commit is contained in:
Jeff Lehman 2022-07-27 11:15:51 -05:00
parent 9780e54b69
commit d8bb39c02b

View File

@ -39,13 +39,13 @@ enum {
#define DBG(a) (Serial.println(a)) #define DBG(a) (Serial.println(a))
#else #else
#define DBG(a) #define DBG(a)
#endif #endif // FDRS_DEBUG
#if defined (ESP32) #if defined (ESP32)
#define UART_IF Serial1 #define UART_IF Serial1
#else #else
#define UART_IF Serial #define UART_IF Serial
#endif #endif // ESP32
// enable to get detailed info from where single configuration macros have been taken // enable to get detailed info from where single configuration macros have been taken
#define DEBUG_NODE_CONFIG #define DEBUG_NODE_CONFIG
@ -190,13 +190,13 @@ char logBuffer[512];
uint16_t logBufferPos = 0; // datatype depends on size of sdBuffer uint16_t logBufferPos = 0; // datatype depends on size of sdBuffer
uint32_t timeLOGBUF = 0; uint32_t timeLOGBUF = 0;
#endif #endif
SystemPacket theCmd; SystemPacket theCmd;
DataReading theData[256]; DataReading theData[256];
uint8_t ln; uint8_t ln;
uint8_t newData = event_clear; uint8_t newData = event_clear;
uint8_t newCmd = cmd_clear; uint8_t newCmd = cmd_clear;
#ifdef USE_ESPNOW #ifdef USE_ESPNOW
DataReading ESPNOW1buffer[256]; DataReading ESPNOW1buffer[256];
uint8_t lenESPNOW1 = 0; uint8_t lenESPNOW1 = 0;
@ -324,7 +324,7 @@ void releaseLogBuffer()
memset(&(logBuffer[0]), 0, sizeof(logBuffer) / sizeof(char)); memset(&(logBuffer[0]), 0, sizeof(logBuffer) / sizeof(char));
logBufferPos = 0; logBufferPos = 0;
} }
#endif #endif // USE_XX_LOG
void sendLog() void sendLog()
{ {
@ -493,7 +493,7 @@ void getLoRa() {
DBG("Incoming LoRa packet of " + String(packetSize) + "bytes not processed."); DBG("Incoming LoRa packet of " + String(packetSize) + "bytes not processed.");
} }
} }
#endif #endif //USE_LORA
} }
#ifdef USE_LORA #ifdef USE_LORA
@ -519,10 +519,8 @@ void transmitLoRa(uint16_t* destMac, DataReading * packet, uint8_t len) {
LoRa.write((uint8_t*)&pkt, sizeof(pkt)); LoRa.write((uint8_t*)&pkt, sizeof(pkt));
LoRa.endPacket(); LoRa.endPacket();
} }
#endif //USE_LORA
} }
#endif #endif // USE_LORA
void sendESPNOW(uint8_t address) { void sendESPNOW(uint8_t address) {
#ifdef USE_ESPNOW #ifdef USE_ESPNOW
@ -538,7 +536,7 @@ void sendESPNOW(uint8_t address) {
DBG("Failed to add peer"); DBG("Failed to add peer");
return; return;
} }
#endif #endif //ESP32
DataReading thePacket[ln]; DataReading thePacket[ln];
int j = 0; int j = 0;
@ -554,7 +552,7 @@ void sendESPNOW(uint8_t address) {
esp_now_send(temp_peer, (uint8_t *) &thePacket, j * sizeof(DataReading)); esp_now_send(temp_peer, (uint8_t *) &thePacket, j * sizeof(DataReading));
esp_now_del_peer(temp_peer); esp_now_del_peer(temp_peer);
#endif // USE_ESPNOW
} }
void sendSerial() { void sendSerial() {
@ -613,7 +611,7 @@ void bufferESPNOW(uint8_t interface) {
lenESPNOW2 += ln; lenESPNOW2 += ln;
break; break;
} }
#endif USE_ESPNOW #endif // USE_ESPNOW
} }
void bufferSerial() { void bufferSerial() {
@ -719,7 +717,7 @@ void releaseESPNOW(uint8_t interface) {
break; break;
} }
} }
#endif USE_ESPNOW #endif // USE_ESPNOW
} }