nspsck / RM67162_Micropython_QSPI

This is a C driver as a user module for the T-AMOLED-S3 using QSPI-protocol.
MIT License
6 stars 4 forks source link

Backgroung color wor write function #8

Closed dobodu closed 4 months ago

dobodu commented 4 months ago

I think backgound color for the write function does not work

Here is the code I wrote to illustrate, coming for the hello.py example.

import random from utime import sleep_ms import rm67162 import tft_config import fonts.large as font_var import fonts.vga2_bold_16x32 as font_mono

tft = tft_config.config()

def main(): text = "Hello!" tft.reset() tft.init() tft.rotation(1) tft.fill(rm67162.RED) #Ok filled in red tft.write(font_var, text, (tft.width() - tft.write_len(font_var,text)) // 2, (tft.height() - font_var.HEIGHT ) // 2, rm67162.WHITE, rm67162.RED) #KO background is black sleep_ms(2000) tft.fill_rect(0,0,tft.width(),tft.height(),rm67162.BLUE) #Ok filled in blue tft.text(font_mono, text, (tft.width() - len(text) * font_mono.WIDTH) // 2, (tft.height() - font_mono.HEIGHT ) // 2, rm67162.WHITE, rm67162.BLUE) #OK background is blue sleep_ms(2000)

Can you try and confirm, I send below an appropriate variable bitmap font I used.

large.zip

nspsck commented 4 months ago

Hi,

I just implemented the fill_color_buffer_slow() correctly. (at least to be my believes). This uses at max 536 x 8 x 2 bytes for buffering. fill_rect() and fill() can now be used like usual.

Your program runs perfectly on my device. The v1 one. So.. I hope the update could fixe your issue, otherwise it also might just be hardware related.

Best Regards.

dobodu commented 4 months ago

And I've also tried the solution you provide... Guess what: It works !

bug_solution_test.zip

We made a serious progress !

Moreover, if I check the frame per second, I reaches now the same results as on a Pico. It went from 8/9 FPS to 13/14 FPS. That's not why we expected...

nspsck commented 4 months ago

It went from 8/9 FPS to 13/14 FPS. That's not why we expected...

:O wow, that s actually not what I was expecting! nice!

nspsck commented 4 months ago

Also, am going to close this issue, but you can still comment on this!

dobodu commented 4 months ago

Well, I pulled the latest code in order to be shure I got the latest code. It still works ! But FPS has gone down to 7 FPS ! Nevermind, I now have both lilygo / pico working on the same code !

I've rarely seen someone giving such time for supporting a maker ! Thank you so much !

nspsck commented 3 months ago

Ugh... Which bug? Haven't we already got it fixed?

dobodu commented 3 months ago

Sorry I was not readable in the last post : I updraded ESP32 IDF chaintool to 5.2.2 to see if there was differences : The use_frame_buffer=False bugfix initialisation method works fine (and provides 14.5 FPS to my program) The use_frame_buffer=True initialisation method still have the bug (and provides 17.5 FPS to my program) Thus, 5.2.2 IDF doesn't change anything.

nspsck commented 3 months ago

It's alright! I was just a little bit confused. And thank you for reaching out!