PPR1 fix screen mirroring on LCD

1.2-legacy
Kevin Hester 2020-10-24 08:16:15 +08:00
rodzic 18bbf3523e
commit 0767c8be03
7 zmienionych plików z 34 dodań i 9 usunięć

Wyświetl plik

@ -7,12 +7,18 @@
### PPR1 TODO
* fix usb
* fix bluetooth
* Test GPS
* make ST7567Wire driver less ugly
* make ST7567Wire driver less ugly, move OLED stuff into a common class treee
* add power save mode for lcd per page 31 of datasheet
* add power off sequence per datasheet to lcd driver
* leave LCD screen on most of the time (because it needs little power)
### general nrf52 TODO:
- turn off transitions on eink screens
- change update interval on eink from 1/sec frames to one frame every 5 mins
- enter SDS state at correct time (to protect battery or loss of phone contact)
- show screen on eink when we enter SDS state (with app info and say sleeping)
- require button press to pair

Wyświetl plik

@ -147,7 +147,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Flip the screen upside down by default as it makes more sense on T-BEAM
// devices. Comment this out to not rotate screen 180 degrees.
#define FLIP_SCREEN_VERTICALLY
#define SCREEN_FLIP_VERTICALLY
// Define if screen should be mirrored left to right
// #define SCREEN_MIRROR
// -----------------------------------------------------------------------------
// GPS

Wyświetl plik

@ -627,7 +627,8 @@ void Screen::setup()
// is never found when probing i2c and therefore we don't call setup and never want to do (invalid) accesses to this device.
useDisplay = true;
dispdev.resetOrientation();
// I think this is not needed - redundant with ui.init
// dispdev.resetOrientation();
// Initialising the UI will init the display too.
ui.init();
@ -635,7 +636,12 @@ void Screen::setup()
displayWidth = dispdev.width();
displayHeight = dispdev.height();
ui.setTimePerTransition(300); // msecs
uint16_t transitionTime = 300; // msecs
#ifdef HAS_EINK
transitionTime = 0;
#endif
ui.setTimePerTransition(transitionTime);
ui.setIndicatorPosition(BOTTOM);
// Defines where the first frame is located in the bar.
ui.setIndicatorDirection(LEFT_RIGHT);
@ -661,7 +667,9 @@ void Screen::setup()
// Set up a log buffer with 3 lines, 32 chars each.
dispdev.setLogBuffer(3, 32);
#ifdef FLIP_SCREEN_VERTICALLY
#ifdef SCREEN_MIRROR
dispdev.mirrorScreen();
#elif defined(SCREEN_FLIP_VERTICALLY)
dispdev.flipScreenVertically();
#endif

Wyświetl plik

@ -21,6 +21,11 @@
#include "power.h"
#include <string>
// 0 to 255, though particular variants might define different defaults
#ifndef BRIGHTNESS_DEFAULT
#define BRIGHTNESS_DEFAULT 150
#endif
namespace graphics
{
@ -99,7 +104,7 @@ class Screen : public concurrency::OSThread
// Implementation to Adjust Brightness
void adjustBrightness();
uint8_t brightness = 150;
uint8_t brightness = BRIGHTNESS_DEFAULT;
/// Starts showing the Bluetooth PIN screen.
//

Wyświetl plik

@ -256,9 +256,9 @@ void setup()
// FIXME - move this someplace better, LCD is at address 0x3F
pinMode(PIN_LCD_RESET, OUTPUT);
digitalWrite(PIN_LCD_RESET, 0);
delay(20);
delay(1);
digitalWrite(PIN_LCD_RESET, 1);
delay(20);
delay(1);
#endif
scanI2Cdevice();

Wyświetl plik

@ -138,7 +138,7 @@ bool NodeDB::resetRadioConfig()
crypto->setKey(channelSettings.psk.size, channelSettings.psk.bytes);
// temp hack for quicker testing
devicestate.no_save = true;
// devicestate.no_save = true;
if (devicestate.no_save) {
DEBUG_MSG("***** DEVELOPMENT MODE - DO NOT RELEASE *****\n");

Wyświetl plik

@ -119,6 +119,9 @@ static const uint8_t AREF = PIN_AREF;
#define PIN_LCD_RESET 23 // active low, pulse low for 20ms at boot
#define USE_ST7567
// Define if screen should be mirrored left to right
#define SCREEN_MIRROR
/*
* SPI Interfaces
*/