If display is on on the @BigCorvus board and we xmit the board browns out?

This commit is contained in:
geeksville
2020-08-28 17:38:23 -07:00
parent 7f214ffbb0
commit dffb6c2f06
9 changed files with 110 additions and 16 deletions

View File

@@ -1,12 +1,13 @@
#include "configuration.h"
#ifdef ST7735_CS
#include "SPILock.h"
#include "TFT.h"
#include "graphics/configs.h"
#include <SPI.h>
#include <TFT_eSPI.h> // Graphics and font library for ST7735 driver chip
TFT_eSPI tft = TFT_eSPI(); // Invoke library, pins defined in User_Setup.h
static TFT_eSPI tft = TFT_eSPI(); // Invoke library, pins defined in User_Setup.h
TFTDisplay::TFTDisplay(uint8_t address, int sda, int scl)
{
@@ -17,6 +18,9 @@ TFTDisplay::TFTDisplay(uint8_t address, int sda, int scl)
// Write the buffer to the display memory
void TFTDisplay::display(void)
{
concurrency::LockGuard g(spiLock);
#if 1
// FIXME - only draw bits have changed (use backbuf similar to the other displays)
// tft.drawBitmap(0, 0, buffer, 128, 64, TFT_YELLOW, TFT_BLACK);
for (uint8_t y = 0; y < SCREEN_HEIGHT; y++) {
@@ -28,6 +32,7 @@ void TFTDisplay::display(void)
tft.drawPixel(x, y, isset ? TFT_WHITE : TFT_BLACK);
}
}
#endif
}
// Send a command to the display (low level function)
@@ -47,10 +52,12 @@ bool TFTDisplay::connect()
pinMode(ST7735_BACKLIGHT_EN, OUTPUT);
#endif
#if 1
tft.init();
tft.setRotation(3); // Orient horizontal and wide underneath the silkscreen name label
// tft.fillScreen(TFT_BLUE);
tft.fillScreen(TFT_BLACK);
// tft.drawRect(0, 0, 40, 10, TFT_PURPLE); // wide rectangle in upper left
#endif
return true;
}