Make #define NO_SCREEN work again

pull/1440/head
Thomas Göttgens 2022-05-06 15:41:37 +02:00
rodzic 1812843363
commit b5cc304336
8 zmienionych plików z 20 dodań i 1 usunięć

Wyświetl plik

@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "configuration.h" #include "configuration.h"
#ifndef NO_SCREEN
#include <OLEDDisplay.h> #include <OLEDDisplay.h>
#include "GPS.h" #include "GPS.h"
@ -1652,3 +1653,4 @@ int Screen::handleUIFrameEvent(const UIFrameEvent *event)
} }
} // namespace graphics } // namespace graphics
#endif // NO_SCREEN

Wyświetl plik

@ -1,6 +1,7 @@
#pragma once #pragma once
#ifdef NO_SCREEN #ifdef NO_SCREEN
#include "power.h"
namespace graphics namespace graphics
{ {
// Noop class for boards without screen. // Noop class for boards without screen.
@ -15,6 +16,8 @@ class Screen
void adjustBrightness(){} void adjustBrightness(){}
void doDeepSleep() {} void doDeepSleep() {}
void forceDisplay() {} void forceDisplay() {}
void startBluetoothPinScreen(uint32_t pin) {}
void stopBluetoothPinScreen() {}
}; };
} }

Wyświetl plik

@ -798,7 +798,9 @@ void handleBlinkLED(HTTPRequest *req, HTTPResponse *res)
count = count - 1; count = count - 1;
} }
} else { } else {
#ifndef NO_SCREEN
screen->blink(); screen->blink();
#endif
} }
Json jsonObjOuter = Json::object{{"status", "ok"}}; Json jsonObjOuter = Json::object{{"status", "ok"}};

Wyświetl plik

@ -152,10 +152,11 @@ void createSSLCert()
yield(); yield();
esp_task_wdt_reset(); esp_task_wdt_reset();
#ifndef NO_SCREEN
if (millis() / 1000 >= 3) { if (millis() / 1000 >= 3) {
screen->setSSLFrames(); screen->setSSLFrames();
} }
#endif
} }
runLoop = false; runLoop = false;
} else { } else {

Wyświetl plik

@ -1,4 +1,5 @@
#include "configuration.h" #include "configuration.h"
#ifndef NO_SCREEN
#include "CannedMessageModule.h" #include "CannedMessageModule.h"
#include "PowerFSM.h" // neede for button bypass #include "PowerFSM.h" // neede for button bypass
#include "MeshService.h" #include "MeshService.h"
@ -548,3 +549,4 @@ void CannedMessageModule::handleSetCannedMessageModulePart4(const char *from_msg
this->saveProtoForModule(); this->saveProtoForModule();
} }
} }
#endif

Wyświetl plik

@ -1,4 +1,6 @@
#pragma once #pragma once
#ifdef NO_SCREEN
#else
#include "ProtobufModule.h" #include "ProtobufModule.h"
#include "input/InputBroker.h" #include "input/InputBroker.h"
@ -84,3 +86,4 @@ class CannedMessageModule :
}; };
extern CannedMessageModule *cannedMessageModule; extern CannedMessageModule *cannedMessageModule;
#endif

Wyświetl plik

@ -47,7 +47,9 @@ void setupModules()
cardKbI2cImpl->init(); cardKbI2cImpl->init();
facesKbI2cImpl = new FacesKbI2cImpl(); facesKbI2cImpl = new FacesKbI2cImpl();
facesKbI2cImpl->init(); facesKbI2cImpl->init();
#ifndef NO_SCREEN
cannedMessageModule = new CannedMessageModule(); cannedMessageModule = new CannedMessageModule();
#endif
#ifndef PORTDUINO #ifndef PORTDUINO
new DeviceTelemetryModule(); new DeviceTelemetryModule();
new EnvironmentTelemetryModule(); new EnvironmentTelemetryModule();

Wyświetl plik

@ -15,7 +15,11 @@ class EnvironmentTelemetryModule : private concurrency::OSThread, public Protobu
lastMeasurementPacket = nullptr; lastMeasurementPacket = nullptr;
} }
virtual bool wantUIFrame() override; virtual bool wantUIFrame() override;
#ifdef NO_SCREEN
void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
#else
virtual void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) override; virtual void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) override;
#endif
protected: protected:
/** Called to handle a particular incoming message /** Called to handle a particular incoming message