androdlang / TFTShape

2D graphics library for ESP8266/ESP32
MIT License
68 stars 14 forks source link

[FIXED] Does not work on M5Stack Grey. ( M5Stack-Core-ESP32 ) #5

Closed CelliesProjects closed 4 years ago

CelliesProjects commented 4 years ago

I am impressed by this library but have an issue with the library on a M5Stack-Core-ESP32. It just does not work. No error, no beep.

I made a working clock from the example clock in the demo app. It works beautifully on an M5Stack Fire, but as the title suggests not on the M5Stack Grey.

Anybody else notice this?

Just run the TFTShape example on a Grey to see it not working 8).

EDIT: Add the working clock from the example Working on a Fire but not a Grey, like the example.

tobozo commented 4 years ago

Fixed by forcing color depth to 8 bits colors when no psram is available

if( ! psramInit() ) {
  sprite->setColorDepth( 8 )
}

@androdlang your library rocks!

Could you consider producing a release so it can be added to the Arduino Library Manager ?

CelliesProjects commented 4 years ago

Thanks (again) Tobozo.

androdlang commented 4 years ago

@tobozo thanks for evaluating this issue. Sure, I can update the library, but can you tell me on which file and position you included the fixing code?

tobozo commented 4 years ago

@androdlang

The psram fix wasn't applied to your library but to @CelliesProjects's M5AnalogClock sketch, the screen would stay blank without this.

Reason: due to memory limitations when no psram is available, the maximum 16 bit sprite size is 238*238 .

Since this limit is much smaller when using 8 bit sprites, I'd suggest using 8 bits color in any example sketch where the screen size can exceed 238*238.