olikraus / u8g2

U8glib library for monochrome displays, version 2
Other
5.17k stars 1.05k forks source link

Screen issues after platformio espressif core update. #2167

Open 7ensation opened 1 year ago

7ensation commented 1 year ago

I love u8g2 and have been using for years on my i2c screens of choice (generic 128x64) for the modules i create. I recently upgraded computers and installed vscode and platformio back to the system with the new espresif 6 core. I uploaded my long time code package i built a couple of years ago on espressif core 3.5 and programmed an esp32 module and noticed that there was significant lag time in updating the screen. im reading live analog values so it needs to be a quick screen refresh. i did some digging and realized whatever espressif did in its 4.3 release seems to have broken the functionality somehow. 4.2 works perfect still but 4.3 and up theres the lag introduced. I read the change log for 4.3 and it doesnt seem to mention any libraries but i might have missed something. for testing i uploaded a simple bitmap amage to display and i can watch the image sort of refreshj from the top of the screen down in 4.3 vs just immediately being on screen in espressif 4.2 and lower. I really need to have the current release of 6.x espressif for other code im working on. i only use the 1106 generic screen driver call. any help with what changed is appreciated.

heres a snippet of the code im having issues with.

#include "header.h"

// -------------------------------------------initialize screen --------------------------
U8G2_SH1106_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE);

void logo()
{

    u8g2.clearBuffer();
    u8g2.setBitmapMode(false /* solid */);
    u8g2.setDrawColor(1);
    u8g2.drawXBM( 0, 0, 128, 64, logo_bits);
    u8g2.sendBuffer();
}

void setup() {

  u8g2.begin();
  logo();
  delayMicroseconds(2000000);

}

void loop() {

}
olikraus commented 1 year ago

I have never used espressif 6 core, but maybe hw i2c works better:

U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ SCL, /* data=*/ SDA);

Note the different argument sequence!