-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readRect() function not working properly #506
Comments
hi, have you tried |
Thanks. It seems the function cannot be overloaded with readRectRGB() and uint16_t. When I set the array to uint8_t it only briefly shows me a black display and doesn't even draw the section at the top right. |
that's because a rgb pixel is composed of 3x uint8_t, so you need to change the data type and the data size in your buffer: uint8_t * my_buffer = (uint8_t *) malloc( width * height * 3 ); also you'll need to use the relevant method with a hint to the color type: tft.pushImage( x, y, width, height, (lgfx:: rgb888_t*)my_buffer ); |
|
that's an odd result indeed, looks worse than the first test with the wrong colors. I don't have the exact same display model so I can't verify. I did some research and found out that TFT_eSPI's ST7789 read frequency is 20MHz, however your setup uses 7MHz, is there any reason this particular value was picked? cfg.freq_read = 7000000; sometimes a wrong btw I wonder why you use |
I also assume that it has to do with the SPI frequency for read. 7 MHz was the maximum in order not to produce errors with tft_eSPI, which is why I chose that, that was before my display output. With LovyanGFX the errors only increase from 11 MHz. Nothing changes underneath. I tried all the settings in combination, which unfortunately didn't result in any improvement. Various SPI hosts, speeds (down to 10 kHz and up to 20 MHz) and SPI modes. It looks like I can't use LovyanGFX for read functions with my display, so I'll have to resort to tft_eSPI or use another method for output, because of limitation of SPI capability.
|
it's unfair to blame LovyanGFX just because I failed to find the problem in your code let's do a last test:
// cfg.spi_host = SPI2_HOST;
// cfg.freq_write = 80000000;
// cfg.freq_read = 7000000; |
読出し周波数に依存して以下のパラメータを適切に変更する必要があります。 |
LovyanGFXが使えないと思うなら、あなたは別のドライバを使えばいいと思います。 |
I'm sorry, but there has been a big misunderstanding here. I didn't mean LovyanGFX or even blamed it, but rather my hardware, the display and its SPI capability. LovyanGFX is a great library, otherwise I wouldn't use it. Unfortunately, your last suggestion didn't bring about any change. That doesn't matter, I'll think of a solution. Thanks again for your time. I also have to say that I am new to this topic.
For these two, I thought it was just for demonstration purposes or examples, so I commented it out. However, the default setting for the ST7789 is still used, which is the following:
This was also used in another project with the ST7789. Unfortunately it didn't work for me. As I said, I'll think of another solution and thank you. |
|
Carefully written Issues are more likely to be given priority.
丁寧に記述された報告は優先して対応される可能性が高くなります。
Environment ( 実行環境 )
Problem Description ( 問題の内容 )
readRect() function not working properly under LovyanGFX. However, if you use the tft_eSPI library it works.
I cut out a piece of the bottom left 8 and pasted it back into the top right. The colors are not correct.
I've already tried a lot of different SPI settings and speeds for read and write and different color settings.
The read test also shows some errors, but it is successful under tft_eSPI.
Expected Behavior ( 期待される動作 )
Correct representation of the colors/pixels top right (cut/taken from bottom left) with tft_eSPI
Pixel value written = 1
Pixel value read = 1
PASS
Pixel value written = 2
Pixel value read = 2
PASS
Pixel value written = 4
Pixel value read = 4
PASS
Pixel value written = 8
Pixel value read = 8
PASS
Pixel value written = 10
Pixel value read = 10
PASS
Pixel value written = 20
Pixel value read = 20
PASS
Pixel value written = 40
Pixel value read = 40
PASS
Pixel value written = 400
Pixel value read = 400
PASS
Pixel value written = 100
Pixel value read = 100
PASS
Pixel value written = 200
Pixel value read = 200
PASS
Pixel value written = 400
Pixel value read = 400
PASS
Pixel value written = 800
Pixel value read = 800
PASS
Pixel value written = 1000
Pixel value read = 1000
PASS
Pixel value written = 2000
Pixel value read = 2000
PASS
Pixel value written = 4000
Pixel value read = 4000
PASS
Pixel value written = 8000
Pixel value read = 8000
PASS
Actual Behavior ( 実際の動作 )
Wrong colors top right (cut/taken from bottom left) and ERROR output on read example with LovyanGFX
Pixel value written = 1
Pixel value read = 0
ERROR ^^^^
Pixel value written = 2
Pixel value read = 0
ERROR ^^^^
Pixel value written = 4
Pixel value read = 0
ERROR ^^^^
Pixel value written = 8
Pixel value read = 40
ERROR ^^^^
Pixel value written = 10
Pixel value read = 80
ERROR ^^^^
Pixel value written = 20
Pixel value read = 100
ERROR ^^^^
Pixel value written = 40
Pixel value read = 200
ERROR ^^^^
Pixel value written = 80
Pixel value read = 400
ERROR ^^^^
Pixel value written = 100
Pixel value read = 0
ERROR ^^^^
Pixel value written = 200
Pixel value read = 0
ERROR ^^^^
Pixel value written = 400
Pixel value read = 0
ERROR ^^^^
Pixel value written = 800
Pixel value read = 800
PASS
Pixel value written = 1000
Pixel value read = 1000
PASS
Pixel value written = 2000
Pixel value read = 2000
PASS
Pixel value written = 4000
Pixel value read = 4000
PASS
Pixel value written = 8000
Pixel value read = 8000
PASS
Steps to reproduce ( 再現のための前提条件 )
Code to reproduce this issue ( 再現させるためのコード )
The text was updated successfully, but these errors were encountered: