sforkowany z mirror/meshtastic-firmware
@mrvdb added support for SH1106 displays!
Add support for SH1106 controller1.2-legacy
commit
075ff26499
|
@ -104,6 +104,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#define SSD1306_ADDRESS 0x3C
|
#define SSD1306_ADDRESS 0x3C
|
||||||
|
|
||||||
|
// The SH1106 controller is almost, but not quite, the same as SSD1306
|
||||||
|
// Define this if you know you have that controller or your "SSD1306" misbehaves.
|
||||||
|
//#define USE_SH1106
|
||||||
|
|
||||||
// Flip the screen upside down by default as it makes more sense on T-BEAM
|
// Flip the screen upside down by default as it makes more sense on T-BEAM
|
||||||
// devices. Comment this out to not rotate screen 180 degrees.
|
// devices. Comment this out to not rotate screen 180 degrees.
|
||||||
#define FLIP_SCREEN_VERTICALLY
|
#define FLIP_SCREEN_VERTICALLY
|
||||||
|
|
|
@ -34,7 +34,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#define FONT_HEIGHT 14 // actually 13 for "ariel 10" but want a little extra space
|
#define FONT_HEIGHT 14 // actually 13 for "ariel 10" but want a little extra space
|
||||||
#define FONT_HEIGHT_16 (ArialMT_Plain_16[1] + 1)
|
#define FONT_HEIGHT_16 (ArialMT_Plain_16[1] + 1)
|
||||||
|
#ifdef USE_SH1106
|
||||||
|
#define SCREEN_WIDTH 132
|
||||||
|
#else
|
||||||
#define SCREEN_WIDTH 128
|
#define SCREEN_WIDTH 128
|
||||||
|
#endif
|
||||||
#define SCREEN_HEIGHT 64
|
#define SCREEN_HEIGHT 64
|
||||||
#define TRANSITION_FRAMERATE 30 // fps
|
#define TRANSITION_FRAMERATE 30 // fps
|
||||||
#define IDLE_FRAMERATE 10 // in fps
|
#define IDLE_FRAMERATE 10 // in fps
|
||||||
|
|
|
@ -3,7 +3,12 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include <OLEDDisplayUi.h>
|
#include <OLEDDisplayUi.h>
|
||||||
|
|
||||||
|
#ifdef USE_SH1106
|
||||||
|
#include <SH1106Wire.h>
|
||||||
|
#else
|
||||||
#include <SSD1306Wire.h>
|
#include <SSD1306Wire.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "PeriodicTask.h"
|
#include "PeriodicTask.h"
|
||||||
#include "TypedQueue.h"
|
#include "TypedQueue.h"
|
||||||
|
@ -211,7 +216,11 @@ class Screen : public PeriodicTask
|
||||||
/// Holds state for debug information
|
/// Holds state for debug information
|
||||||
DebugInfo debugInfo;
|
DebugInfo debugInfo;
|
||||||
/// Display device
|
/// Display device
|
||||||
|
#ifdef USE_SH1106
|
||||||
|
SH1106Wire dispdev;
|
||||||
|
#else
|
||||||
SSD1306Wire dispdev;
|
SSD1306Wire dispdev;
|
||||||
|
#endif
|
||||||
/// UI helper for rendering to frames and switching between them
|
/// UI helper for rendering to frames and switching between them
|
||||||
OLEDDisplayUi ui;
|
OLEDDisplayUi ui;
|
||||||
};
|
};
|
||||||
|
|
Ładowanie…
Reference in New Issue