Merge pull request #14728 from gemu2015/display_fix

some display fixes
This commit is contained in:
Theo Arends 2022-02-05 09:17:54 +01:00 committed by GitHub
commit 6de807e094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 6 deletions

View File

@ -31,6 +31,10 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef ESP32
#define USE_UFILESYS
#endif
#include "Adafruit_GFX.h"
#include "glcdfont.c"
#ifdef __AVR__

View File

@ -104,7 +104,7 @@ uint8_t *Renderer::allocate_framebuffer(uint32_t size) {
void Renderer::setTextSize(uint8_t sf) {
if (sf < 1) sf = 1;
if (sf > 4) sf = 4;
if (sf > 16) sf = 16;
tsize = sf;
Adafruit_GFX::setTextSize(sf);
}

View File

@ -483,6 +483,11 @@ Renderer *uDisplay::Init(void) {
}
#endif // ESP32
spiSettings = SPISettings((uint32_t)spi_speed*1000000, MSBFIRST, SPI_MODE3);
SPI_BEGIN_TRANSACTION
if (reset >= 0) {
pinMode(reset, OUTPUT);
digitalWrite(reset, HIGH);
@ -493,11 +498,7 @@ Renderer *uDisplay::Init(void) {
delay(200);
}
spiSettings = SPISettings((uint32_t)spi_speed*1000000, MSBFIRST, SPI_MODE3);
uint16_t index = 0;
SPI_BEGIN_TRANSACTION
while (1) {
uint8_t iob;
SPI_CS_LOW
@ -1213,7 +1214,8 @@ void uDisplay::pushColors(uint16_t *data, uint16_t len, boolean not_swapped) {
// special version 8 bit spi I or II
#ifdef ESP8266
while (len--) {
uspi->write(*data++);
//uspi->write(*data++);
WriteColor(*data++);
}
#else
uspi->writePixels(data, len * 2);