You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library only sets the SPI settings once, when it's initialized.
This is a problem when using multiple SPI devices with different settings. Because then the other library's settings overwrite the settings of this one and the display doesn't work properly.
I noticed this bug because drawing on the display was very slow (until restarting the Arduino) after doing anything with a SD-card because the SD library used a way slower SPI speed.
P.S: I hope you understand what I mean and please be patient with me, I'm still new to Git and GitHub. And your library saved me! Thank you so much :) The library from the vendor of the LCD wasn't compatible with AdafruitGFX. Could I have made only the Pull Request without opening an Issue?
The text was updated successfully, but these errors were encountered:
Yes, it is wise to use SPI transactions especially when devices use different modes and speeds.
SD (and FatFS) has always set its own SPI mode. The transactions are fairly lengthy. e.g. transferring a 512 byte sector.
Something like tft.drawPixel() is only a few SPI bytes. It is expensive to beginTransaction() for every pixel.
If you are drawing an image from SD it is more efficient to only beginTransaction(tftSetting) after an SD call.
You can either treat each SPI device as equal i.e. beginTransaction(eachSetting) with every CS_ACTIVE
Or choose one SPI device as "preferred" i.e. restore to beginTransaction(preferredSetting) after using other SPI devices.
beginTransaction(eachSetting) is the safest way to do things. I will investigate the performance cost.
It should make little difference to fillRect(), pushColors() but print(), drawPixel() will be slower.
This library only sets the SPI settings once, when it's initialized.
This is a problem when using multiple SPI devices with different settings. Because then the other library's settings overwrite the settings of this one and the display doesn't work properly.
I noticed this bug because drawing on the display was very slow (until restarting the Arduino) after doing anything with a SD-card because the SD library used a way slower SPI speed.
P.S: I hope you understand what I mean and please be patient with me, I'm still new to Git and GitHub. And your library saved me! Thank you so much :) The library from the vendor of the LCD wasn't compatible with AdafruitGFX. Could I have made only the Pull Request without opening an Issue?
The text was updated successfully, but these errors were encountered: