🪄 Formats display service
This commit is contained in:
@@ -8,15 +8,13 @@
|
|||||||
#define SCREEN_WIDTH 128
|
#define SCREEN_WIDTH 128
|
||||||
#define SCREEN_HEIGHT 64
|
#define SCREEN_HEIGHT 64
|
||||||
|
|
||||||
class DisplayService
|
class DisplayService {
|
||||||
{
|
public:
|
||||||
public:
|
|
||||||
DisplayService() : display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1) {};
|
DisplayService() : display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1) {};
|
||||||
|
|
||||||
bool begin()
|
bool begin() {
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> guard(displayMutex);
|
std::lock_guard<std::mutex> guard(displayMutex);
|
||||||
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
|
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
display.clearDisplay();
|
display.clearDisplay();
|
||||||
@@ -41,7 +39,7 @@ public:
|
|||||||
display.display();
|
display.display();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Adafruit_SSD1306 display;
|
Adafruit_SSD1306 display;
|
||||||
std::mutex displayMutex;
|
std::mutex displayMutex;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user