Autodetect OLED Controller 1306/1106 (#1317)
* Autodetect OLED Controller 1306/1106 and make #define NO_SCREEN work again * fix epaper with autodetect * Try kicking CI - NFC
This commit is contained in:
co-authored by
GitHub
parent
47524d58d7
commit
cef1614770
@@ -131,6 +131,11 @@ void EInkDisplay::sendCommand(uint8_t com)
|
||||
// Drop all commands to device (we just update the buffer)
|
||||
}
|
||||
|
||||
void EInkDisplay::setDetected(uint8_t detected)
|
||||
{
|
||||
(void)detected;
|
||||
}
|
||||
|
||||
// Connect to the display
|
||||
bool EInkDisplay::connect()
|
||||
{
|
||||
|
||||
@@ -34,6 +34,12 @@ class EInkDisplay : public OLEDDisplay
|
||||
*/
|
||||
bool forceDisplay(uint32_t msecLimit = 1000);
|
||||
|
||||
/**
|
||||
* shim to make the abstraction happy
|
||||
*
|
||||
*/
|
||||
void setDetected(uint8_t detected);
|
||||
|
||||
protected:
|
||||
// the header size of the buffer used, e.g. for the SPI command header
|
||||
virtual int getBufferOffset(void) override { return 0; }
|
||||
|
||||
@@ -765,6 +765,10 @@ void Screen::setup()
|
||||
// is never found when probing i2c and therefore we don't call setup and never want to do (invalid) accesses to this device.
|
||||
useDisplay = true;
|
||||
|
||||
#ifdef AutoOLEDWire_h
|
||||
dispdev.setDetected(screen_model);
|
||||
#endif
|
||||
|
||||
// I think this is not needed - redundant with ui.init
|
||||
// dispdev.resetOrientation();
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ class Screen
|
||||
void print(const char*){}
|
||||
void adjustBrightness(){}
|
||||
void doDeepSleep() {}
|
||||
void forceDisplay() {}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -24,12 +25,11 @@ class Screen
|
||||
|
||||
#include "../configuration.h"
|
||||
|
||||
#ifdef USE_SH1106
|
||||
#include <SH1106Wire.h>
|
||||
#elif defined(USE_ST7567)
|
||||
#ifdef USE_ST7567
|
||||
#include <ST7567Wire.h>
|
||||
#else
|
||||
#include <SSD1306Wire.h>
|
||||
// the SH1106/SSD1306 variant is auto-detected
|
||||
#include <AutoOLEDWire.h>
|
||||
#endif
|
||||
|
||||
#include "EInkDisplay2.h"
|
||||
@@ -295,18 +295,16 @@ class Screen : public concurrency::OSThread
|
||||
/// Holds state for debug information
|
||||
DebugInfo debugInfo;
|
||||
|
||||
/// Display device
|
||||
/// Display device
|
||||
/** FIXME cleanup display abstraction */
|
||||
#ifdef ST7735_CS
|
||||
TFTDisplay dispdev;
|
||||
#elif defined(HAS_EINK)
|
||||
EInkDisplay dispdev;
|
||||
#elif defined(USE_SH1106)
|
||||
SH1106Wire dispdev;
|
||||
#elif defined(USE_ST7567)
|
||||
ST7567Wire dispdev;
|
||||
#else
|
||||
SSD1306Wire dispdev;
|
||||
AutoOLEDWire dispdev;
|
||||
#endif
|
||||
/// UI helper for rendering to frames and switching between them
|
||||
OLEDDisplayUi ui;
|
||||
|
||||
Reference in New Issue
Block a user