only acquire screen when paxcounter is active, i.e. enabled and wifi and ble are both off

This commit is contained in:
Thomas Herrmann 2024-02-23 22:11:53 +01:00 committed by Thomas Göttgens
parent bbc76f884e
commit 93ba60da69
2 changed files with 4 additions and 2 deletions

View File

@ -57,7 +57,7 @@ meshtastic_MeshPacket *PaxcounterModule::allocReply()
int32_t PaxcounterModule::runOnce()
{
if (moduleConfig.paxcounter.enabled && !config.bluetooth.enabled && !config.network.wifi_enabled) {
if (isActive()) {
if (firstTime) {
firstTime = false;
LOG_DEBUG(

View File

@ -23,7 +23,9 @@ class PaxcounterModule : private concurrency::OSThread, public ProtobufModule<me
bool sendInfo(NodeNum dest = NODENUM_BROADCAST);
virtual bool handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Paxcount *p) override;
virtual meshtastic_MeshPacket *allocReply() override;
virtual bool wantUIFrame() override { return true; }
bool isActive() { return moduleConfig.paxcounter.enabled &&
!config.bluetooth.enabled && !config.network.wifi_enabled; }
virtual bool wantUIFrame() override { return isActive(); }
virtual void drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) override;
};