protect screen specific code with #if HAS_SCREEN

pull/3285/head
Thomas Herrmann 2024-02-24 11:53:11 +01:00 zatwierdzone przez Thomas Göttgens
rodzic 9430a98f1d
commit d729dd952e
2 zmienionych plików z 5 dodań i 0 usunięć

Wyświetl plik

@ -87,6 +87,8 @@ int32_t PaxcounterModule::runOnce()
}
}
#if HAS_SCREEN
// TODO / FIXME: This code is copied from src/graphics/Screen.cpp
// It appears (in slightly variants) also in other modules like
// src/modules/Telemetry/PowerTelemetry.cpp, src/modules/Telemetry/EnvironmentTelemetry.cpp
@ -127,5 +129,6 @@ void PaxcounterModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state
buffer, "WiFi: %d\nBLE: %d\nuptime: %ds",
count_from_libpax.wifi_count, count_from_libpax.ble_count, millis() / 1000);
}
#endif // HAS_SCREEN
#endif

Wyświetl plik

@ -25,8 +25,10 @@ class PaxcounterModule : private concurrency::OSThread, public ProtobufModule<me
virtual meshtastic_MeshPacket *allocReply() override;
bool isActive() { return moduleConfig.paxcounter.enabled &&
!config.bluetooth.enabled && !config.network.wifi_enabled; }
#if HAS_SCREEN
virtual bool wantUIFrame() override { return isActive(); }
virtual void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) override;
#endif
};
extern PaxcounterModule *paxcounterModule;