Encapsulate brightness controll into the class BrightnessController.

Add a new app to configure the brightness.
This commit is contained in:
JF
2020-03-15 18:03:11 +01:00
parent eabb54f15d
commit 2ed76ac556
9 changed files with 232 additions and 21 deletions

View File

@@ -16,7 +16,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) {
screen->OnObjectEvent(obj, event, eventData);
}
static const char * btnm_map1[] = {"Meter", "Gauge", "Clock", "\n", "Soft\nversion", "App2", "App3", ""};
static const char * btnm_map1[] = {"Meter", "Gauge", "Clock", "\n", "Soft\nversion", "App2", "Brightness", ""};
Tile::Tile(DisplayApp* app) : Screen(app) {
modal.reset(new Modal(app));
@@ -126,8 +126,10 @@ void Tile::OnObjectEvent(lv_obj_t *obj, lv_event_t event, uint32_t buttonId) {
modal->Show();
break;
case 4:
case 5:
tile->StartTestApp();
break;
case 5:
tile->StartBrightnessApp();
break;
}
@@ -151,6 +153,11 @@ void Tile::StartTestApp() {
running = false;
}
void Tile::StartBrightnessApp() {
app->StartApp(DisplayApp::Apps::Brightness);
running = false;
}
void Tile::StartMeterApp() {
app->StartApp(DisplayApp::Apps::Meter);
running = false;