minor cleanup proposal (#4169)

* MESHTASTIC_EXCLUDE_WIFI and HAS_WIFI cleanup...
Our code was checking HAS_WIFI and the new MESHTASTIC_EXCLUDE_WIFI
flags in various places (even though EXCLUDE_WIFI forces HAS_WIFI
to 0).  Instead just check HAS_WIFI, only use EXCLUDE_WIFI inside
configuration.h

* cleanup: use HAS_NETWORKING instead of HAS_WIFI || HAS_ETHERNET
We already had HAS_NETWORKING as flag in MQTT to mean 'we have
tcpip'.  Generallize that and move it into configuration.h so that
we can use it elsewhere.

* Use #pragma once, because supported by gcc and all modern compilers
instead of #ifdef DOTHFILE_H etc...

---------

Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
This commit is contained in:
geeksville
2024-07-03 15:39:09 -07:00
committed by GitHub
parent 9c46bdad1a
commit 8785adf6e4
13 changed files with 47 additions and 48 deletions

View File

@@ -16,7 +16,7 @@
#include "platform/portduino/PortduinoGlue.h"
#endif
#if HAS_WIFI || HAS_ETHERNET
#if HAS_NETWORKING
extern Syslog syslog;
#endif
void RedirectablePrint::rpInit()
@@ -138,7 +138,7 @@ void RedirectablePrint::log_to_serial(const char *logLevel, const char *format,
void RedirectablePrint::log_to_syslog(const char *logLevel, const char *format, va_list arg)
{
#if (HAS_WIFI || HAS_ETHERNET) && !defined(ARCH_PORTDUINO)
#if HAS_NETWORKING && !defined(ARCH_PORTDUINO)
// if syslog is in use, collect the log messages and send them to syslog
if (syslog.isEnabled()) {
int ll = 0;