Skip to content

Commit

Permalink
protect screen specific code with #if HAS_SCREEN
Browse files Browse the repository at this point in the history
  • Loading branch information
thoherr authored and caveman99 committed Feb 25, 2024
1 parent 4cf6622 commit 40ba55e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/modules/esp32/PaxcounterModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 2 additions & 0 deletions src/modules/esp32/PaxcounterModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 40ba55e

Please sign in to comment.