Unclever first attempt at display sleep.

This commit is contained in:
Jared Boone 2016-01-27 20:33:54 -08:00
parent 1caf6952d8
commit 894d4b955c
6 changed files with 48 additions and 12 deletions

View file

@ -27,6 +27,8 @@
#include "ui_widget.hpp"
#include "ui_painter.hpp"
#include "portapack.hpp"
#include "message.hpp"
#include "touch.hpp"
@ -53,6 +55,11 @@ public:
void run();
void request_stop();
void set_display_sleep(bool new_value) {
portapack::io.lcd_backlight(false);
display_sleep = new_value;
};
static inline void events_flag(const eventmask_t events) {
if( thread_event_loop ) {
chEvtSignal(thread_event_loop, events);
@ -80,6 +87,7 @@ private:
uint32_t encoder_last = 0;
bool is_running = true;
bool sd_card_present = false;
bool display_sleep = false;
eventmask_t wait();
void dispatch(const eventmask_t events);