Public Access
31 lines
679 B
C++
31 lines
679 B
C++
#include "display/status_screen.h"
|
|||
|
|
|
||
|
|
#include <Arduino.h>
|
||
|
|
|
||
|
|
#include "config.h"
|
||
|
|
#include "display/text.h"
|
||
|
|
|
||
|
|
StatusScreen::StatusScreen(BROSE9323 &display, NanoLink &nano) : _display(display), _nano(nano)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
void StatusScreen::show(const char *line1, const char *line2, bool keep_on)
|
||
|
|
{
|
||
|
|
Serial.printf("Display: %s / %s\n", line1, line2 ? line2 : "");
|
||
|
|
_nano.on();
|
||
|
|
if (!_started)
|
||
|
|
{
|
||
|
|
_display.begin(&_nano.stream());
|
||
|
|
_display.setTiming(FLIP_TIME);
|
||
|
|
_started = true;
|
||
|
|
}
|
||
|
|
drawTextLines(_display, line1, line2);
|
||
|
|
_display.display();
|
||
|
|
|
||
|
|
if (!keep_on)
|
||
|
|
{
|
||
|
|
// The first frame after power on flips every dot, give the Nano time for that
|
||
|
|
delay(STATUS_FLIP_TIME);
|
||
|
|
_nano.off();
|
||
|
|
}
|
||
|
|
}
|