diff --git a/docs/software/nrf52-TODO.md b/docs/software/nrf52-TODO.md index 4fc5d3b70..2d268e028 100644 --- a/docs/software/nrf52-TODO.md +++ b/docs/software/nrf52-TODO.md @@ -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 diff --git a/src/configuration.h b/src/configuration.h index a810aff1b..179c49466 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -147,7 +147,10 @@ along with this program. If not, see . // 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 diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 7773cdc32..adfe15e90 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -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 diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index 056798544..5539dcc76 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -21,6 +21,11 @@ #include "power.h" #include +// 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. // diff --git a/src/main.cpp b/src/main.cpp index 960d42828..9830c8232 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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(); diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 135a7cb61..1febc0ae1 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -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"); diff --git a/variants/ppr1/variant.h b/variants/ppr1/variant.h index b3a3e1b8e..2733d6529 100644 --- a/variants/ppr1/variant.h +++ b/variants/ppr1/variant.h @@ -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 */