Force delay after display state change
So that we backoff if OLED is busy Update OLED.hpp
This commit is contained in:
@@ -10,10 +10,12 @@
|
|||||||
#ifndef OLED_HPP_
|
#ifndef OLED_HPP_
|
||||||
#define OLED_HPP_
|
#define OLED_HPP_
|
||||||
#include "Font.h"
|
#include "Font.h"
|
||||||
|
#include "cmsis_os.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include <BSP.h>
|
#include <BSP.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -63,8 +65,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void setDisplayState(DisplayState state) {
|
static void setDisplayState(DisplayState state) {
|
||||||
|
if (state != displayState) {
|
||||||
displayState = state;
|
displayState = state;
|
||||||
screenBuffer[1] = (state == ON) ? 0xAF : 0xAE;
|
screenBuffer[1] = (state == ON) ? 0xAF : 0xAE;
|
||||||
|
// Dump the screen state change out _now_
|
||||||
|
I2C_CLASS::Transmit(DEVICEADDR_OLED, screenBuffer, FRAMEBUFFER_START - 1);
|
||||||
|
osDelay(TICKS_10MS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setRotation(bool leftHanded); // Set the rotation for the screen
|
static void setRotation(bool leftHanded); // Set the rotation for the screen
|
||||||
|
|||||||
Reference in New Issue
Block a user