1
0
Fork 0

Added OLED fade out support (#12086)

This commit is contained in:
Barabas 2021-05-08 11:27:13 +01:00 committed by GitHub
parent 992b146bc4
commit fca7cc1747
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 2 deletions

View file

@ -73,6 +73,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PRE_CHARGE_PERIOD 0xD9
#define VCOM_DETECT 0xDB
// Advance Graphic Commands
#define FADE_BLINK 0x23
#define ENABLE_FADE 0x20
#define ENABLE_BLINK 0x30
// Charge Pump Commands
#define CHARGE_PUMP 0x8D
@ -547,7 +552,13 @@ bool oled_on(void) {
oled_timeout = timer_read32() + OLED_TIMEOUT;
#endif
static const uint8_t PROGMEM display_on[] = {I2C_CMD, DISPLAY_ON};
static const uint8_t PROGMEM display_on[] =
#ifdef OLED_FADE_OUT
{I2C_CMD, FADE_BLINK, 0x00};
#else
{I2C_CMD, DISPLAY_ON};
#endif
if (!oled_active) {
if (I2C_TRANSMIT_P(display_on) != I2C_STATUS_SUCCESS) {
print("oled_on cmd failed\n");
@ -563,7 +574,13 @@ bool oled_off(void) {
return !oled_active;
}
static const uint8_t PROGMEM display_off[] = {I2C_CMD, DISPLAY_OFF};
static const uint8_t PROGMEM display_off[] =
#ifdef OLED_FADE_OUT
{I2C_CMD, FADE_BLINK, ENABLE_FADE | OLED_FADE_OUT_INTERVAL};
#else
{I2C_CMD, DISPLAY_OFF};
#endif
if (oled_active) {
if (I2C_TRANSMIT_P(display_off) != I2C_STATUS_SUCCESS) {
print("oled_off cmd failed\n");