Skip to content

Commit

Permalink
fix: declare class only if USE_EINK, init all members
Browse files Browse the repository at this point in the history
  • Loading branch information
todd-herbert committed Feb 28, 2024
1 parent 440a79e commit 1e3db57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/graphics/EInkDisplay2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#ifdef USE_EINK
#include "EInkDisplay2.h"
#include "GxEPD2_BW.h"
#include "SPILock.h"
#include "main.h"
#include <SPI.h>
Expand Down
8 changes: 6 additions & 2 deletions src/graphics/EInkDisplay2.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#ifdef USE_EINK

#include "GxEPD2_BW.h"
#include <OLEDDisplay.h>

Expand Down Expand Up @@ -58,7 +60,7 @@ class EInkDisplay : public OLEDDisplay
virtual bool connect() override;

// AdafruitGFX display object - instantiated in connect(), variant specific
GxEPD2_BW<EINK_DISPLAY_MODEL, EINK_DISPLAY_MODEL::HEIGHT> *adafruitDisplay;
GxEPD2_BW<EINK_DISPLAY_MODEL, EINK_DISPLAY_MODEL::HEIGHT> *adafruitDisplay = NULL;

// If display uses HSPI
#if defined(HELTEC_WIRELESS_PAPER) || defined(HELTEC_WIRELESS_PAPER_V1_0)
Expand All @@ -67,5 +69,7 @@ class EInkDisplay : public OLEDDisplay

private:
// FIXME quick hack to limit drawing to a very slow rate
uint32_t lastDrawMsec;
uint32_t lastDrawMsec = 0;
};

#endif

0 comments on commit 1e3db57

Please sign in to comment.