- G1 Explorer use correct display controller

- adhere UA font in modules
This commit is contained in:
Thomas Göttgens 2023-03-08 14:49:30 +01:00
parent 20bcf310d1
commit 267db05d69
12 changed files with 36 additions and 14 deletions

View File

@ -2,8 +2,9 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"ms-vscode.cpptools",
"platformio.platformio-ide",
"trunk.io"
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

@ -1 +1 @@
Subproject commit 19d49ec5280b6904f8c4cd1182ba4250d4122dbe
Subproject commit fef42ee673658bdcd34b821233558406615e8ddd

View File

@ -41,7 +41,7 @@
GxEPD2_BW<TECHO_DISPLAY_MODEL, TECHO_DISPLAY_MODEL::HEIGHT> *adafruitDisplay;
EInkDisplay::EInkDisplay(uint8_t address, int sda, int scl, uint8_t screen_model)
EInkDisplay::EInkDisplay(uint8_t address, int sda, int scl, OLEDDISPLAY_GEOMETRY screen_geometry)
{
#if defined(TTGO_T_ECHO)
setGeometry(GEOMETRY_RAWMODE, TECHO_DISPLAY_MODEL::WIDTH, TECHO_DISPLAY_MODEL::HEIGHT);

View File

@ -22,7 +22,7 @@ class EInkDisplay : public OLEDDisplay
/* constructor
FIXME - the parameters are not used, just a temporary hack to keep working like the old displays
*/
EInkDisplay(uint8_t address, int sda, int scl, uint8_t screen_model);
EInkDisplay(uint8_t address, int sda, int scl, OLEDDISPLAY_GEOMETRY screen_geometry);
// Write the buffer to the display memory (for eink we only do this occasionally)
virtual void display(void) override;

View File

@ -888,8 +888,7 @@ static void drawNodeInfo(OLEDDisplay *display, OLEDDisplayUiState *state, int16_
// #else
Screen::Screen(uint8_t address, int sda, int scl)
: OSThread("Screen"), cmdQueue(32),
dispdev(address, sda, scl,
screen_model == meshtastic_Config_DisplayConfig_OledType_OLED_SH1107 ? GEOMETRY_128_128 : GEOMETRY_128_64),
dispdev(address, sda, scl, screen_geometry),
ui(&dispdev)
{
address_found = address;

View File

@ -8,7 +8,7 @@
static TFT_eSPI tft = TFT_eSPI(); // Invoke library, pins defined in User_Setup.h
TFTDisplay::TFTDisplay(uint8_t address, int sda, int scl, uint8_t screen_model)
TFTDisplay::TFTDisplay(uint8_t address, int sda, int scl, OLEDDISPLAY_GEOMETRY screen_geometry)
{
#ifdef SCREEN_ROTATE
setGeometry(GEOMETRY_RAWMODE, TFT_HEIGHT, TFT_WIDTH);

View File

@ -18,7 +18,7 @@ class TFTDisplay : public OLEDDisplay
/* constructor
FIXME - the parameters are not used, just a temporary hack to keep working like the old displays
*/
TFTDisplay(uint8_t address, int sda, int scl, uint8_t screen_model);
TFTDisplay(uint8_t address, int sda, int scl, OLEDDISPLAY_GEOMETRY screen_geometry);
// Write the buffer to the display memory
virtual void display(void) override;

View File

@ -82,6 +82,7 @@ meshtastic::NodeStatus *nodeStatus = new meshtastic::NodeStatus();
/// The I2C address of our display (if found)
uint8_t screen_found;
uint8_t screen_model;
OLEDDISPLAY_GEOMETRY screen_geometry = GEOMETRY_128_64;
// The I2C address of the cardkb or RAK14004 (if found)
uint8_t cardkb_found;
@ -326,7 +327,12 @@ void setup()
screen_model = config.display.oled;
#if defined(USE_SH1107)
screen_model = Config_DisplayConfig_OledType_OLED_SH1107; // set dimension of 128x128
screen_model = meshtastic_Config_DisplayConfig_OledType_OLED_SH1107; // set dimension of 128x128
display_geometry = GEOMETRY_128_128;
#endif
#if defined(USE_SH1107_128_64)
screen_model = meshtastic_Config_DisplayConfig_OledType_OLED_SH1107; // keep dimension of 128x64
#endif
// Init our SPI controller (must be before screen and lora)

View File

@ -20,6 +20,7 @@ extern NRF52Bluetooth *nrf52Bluetooth;
extern uint8_t screen_found;
extern uint8_t screen_model;
extern OLEDDISPLAY_GEOMETRY screen_geometry;
extern uint8_t cardkb_found;
extern uint8_t kb_model;
extern uint8_t rtc_found;

View File

@ -8,7 +8,11 @@
#include "mesh/generated/meshtastic/cannedmessages.pb.h"
#ifdef OLED_RU
#include "graphics/fonts/OLEDDisplayFontsRU.h"
#include "grahics/pfonts/OLEDDisplayFontsRU.h"
#endif
#ifdef OLED_UA
#include "grahics/fonts/OLEDDisplayFontsUA.h"
#endif
#if defined(USE_EINK) || defined(ILI9341_DRIVER) || defined(ST7735_CS)
@ -20,8 +24,12 @@
#ifdef OLED_RU
#define FONT_SMALL ArialMT_Plain_10_RU
#else
#ifdef OLED_UA
#define FONT_SMALL ArialMT_Plain_10_UA
#else
#define FONT_SMALL ArialMT_Plain_10
#endif
#endif
#define FONT_MEDIUM ArialMT_Plain_16
#define FONT_LARGE ArialMT_Plain_24
#endif

View File

@ -12,6 +12,10 @@
#include "graphics/fonts/OLEDDisplayFontsRU.h"
#endif
#ifdef OLED_UA
#include "grahics/fonts/OLEDDisplayFontsUA.h"
#endif
/*
AudioModule
A interface to send raw codec2 audio data over the mesh network. Based on the example code from the ESP32_codec2 project.
@ -53,8 +57,12 @@ AudioModule *audioModule;
#ifdef OLED_RU
#define FONT_SMALL ArialMT_Plain_10_RU
#else
#ifdef OLED_UA
#define FONT_SMALL ArialMT_Plain_10_UA
#else
#define FONT_SMALL ArialMT_Plain_10
#endif
#endif
#define FONT_MEDIUM ArialMT_Plain_16
#define FONT_LARGE ArialMT_Plain_24
#endif

View File

@ -33,5 +33,4 @@
#define BATTERY_SENSE_SAMPLES 15 // Set the number of samples, It has an effect of increasing sensitivity.
#define ADC_MULTIPLIER 2
//#define USE_SH1107 // Finally we will use SH1107 128x64 resolution driver, because SH1106 will shift the screen by 2 lines.
#define USE_SH1106
#define USE_SH1107_128_64