diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 4fc84fa78..080e70d08 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -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" + ] } diff --git a/protobufs b/protobufs index 19d49ec52..fef42ee67 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 19d49ec5280b6904f8c4cd1182ba4250d4122dbe +Subproject commit fef42ee673658bdcd34b821233558406615e8ddd diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index f9d99ab7e..dec7336cb 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -41,7 +41,7 @@ GxEPD2_BW *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); diff --git a/src/graphics/EInkDisplay2.h b/src/graphics/EInkDisplay2.h index 7d56c8022..adc139c8e 100644 --- a/src/graphics/EInkDisplay2.h +++ b/src/graphics/EInkDisplay2.h @@ -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; diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 12d08cd17..ec07d0283 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -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; diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index 0bd1d3a99..0fac01c3d 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -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); diff --git a/src/graphics/TFTDisplay.h b/src/graphics/TFTDisplay.h index c18dc03c6..9feab3bdc 100644 --- a/src/graphics/TFTDisplay.h +++ b/src/graphics/TFTDisplay.h @@ -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; diff --git a/src/main.cpp b/src/main.cpp index c1afb5c18..e3f7fe274 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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) diff --git a/src/main.h b/src/main.h index 62c022b2b..3e6251581 100644 --- a/src/main.h +++ b/src/main.h @@ -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; diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 9e5b63c51..ee59364cc 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -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 diff --git a/src/modules/esp32/AudioModule.cpp b/src/modules/esp32/AudioModule.cpp index 072ee75e4..662591b88 100644 --- a/src/modules/esp32/AudioModule.cpp +++ b/src/modules/esp32/AudioModule.cpp @@ -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 diff --git a/variants/nano-g1-explorer/variant.h b/variants/nano-g1-explorer/variant.h index df8a0aad9..ad8957a51 100644 --- a/variants/nano-g1-explorer/variant.h +++ b/variants/nano-g1-explorer/variant.h @@ -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 \ No newline at end of file +#define USE_SH1107_128_64