Skip to content

Commit

Permalink
only acquire screen when paxcounter is active, i.e. enabled and wifi …
Browse files Browse the repository at this point in the history
…and ble are both off
  • Loading branch information
thoherr authored and caveman99 committed Feb 25, 2024
1 parent ca98fd0 commit 571cc7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/modules/esp32/PaxcounterModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion src/modules/esp32/PaxcounterModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit 571cc7c

Please sign in to comment.