switched red flash light off night default
Some checks failed
Code formatting / test-format (pull_request) Failing after 20s
Code formatting / test-clang-tidy (pull_request) Successful in 7m31s
CI / build-firmware (pull_request) Successful in 5m39s
CI / build-simulator (pull_request) Failing after 5s
CI / get-base-ref-size (pull_request) Successful in 15m27s
CI / Compare build size (pull_request) Successful in 5s
PR comment / comment (pull_request) Failing after 17s
Some checks failed
Code formatting / test-format (pull_request) Failing after 20s
Code formatting / test-clang-tidy (pull_request) Successful in 7m31s
CI / build-firmware (pull_request) Successful in 5m39s
CI / build-simulator (pull_request) Failing after 5s
CI / get-base-ref-size (pull_request) Successful in 15m27s
CI / Compare build size (pull_request) Successful in 5s
PR comment / comment (pull_request) Failing after 17s
This commit is contained in:
parent
bf8c4dfef8
commit
270d15a8ea
@ -556,7 +556,7 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio
|
||||
touchPanel);
|
||||
break;
|
||||
case Apps::FlashLight:
|
||||
currentScreen = std::make_unique<Screens::FlashLight>(*systemTask, brightnessController, dateTimeController);
|
||||
currentScreen = std::make_unique<Screens::FlashLight>(*systemTask, brightnessController);
|
||||
break;
|
||||
case Apps::StopWatch:
|
||||
currentScreen = std::make_unique<Screens::StopWatch>(*systemTask);
|
||||
|
@ -15,24 +15,11 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
FlashLight::FlashLight(System::SystemTask& systemTask, Controllers::BrightnessController& brightnessController, Controllers::DateTime& dateTimeController)
|
||||
: systemTask {systemTask}, brightnessController {brightnessController}, dateTimeController {dateTimeController} {
|
||||
FlashLight::FlashLight(System::SystemTask& systemTask, Controllers::BrightnessController& brightnessController)
|
||||
: systemTask {systemTask}, brightnessController {brightnessController} {
|
||||
|
||||
brightnessController.Set(Controllers::BrightnessController::Levels::Low);
|
||||
|
||||
|
||||
|
||||
|
||||
int time_var = dateTimeController.Hours();
|
||||
if(time_var > 21 || time_var < 6){
|
||||
State_l = 1;
|
||||
NRF_LOG_INFO("Loop Hour Red: %d", time_var);
|
||||
}
|
||||
else {
|
||||
State_l = 0;
|
||||
NRF_LOG_INFO("Loop Hour White: %d", time_var);
|
||||
}
|
||||
|
||||
flashLight = lv_label_create(lv_scr_act(), nullptr);
|
||||
lv_obj_set_style_local_text_font(flashLight, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_sys_48);
|
||||
lv_label_set_text_static(flashLight, Symbols::flashlight);
|
||||
@ -152,16 +139,4 @@ bool FlashLight::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
time_var = dateTimeController.Minutes();
|
||||
if (time_var == 30){
|
||||
NRF_LOG_INFO("Short: %d", time_var);
|
||||
motorController.RunForDuration(25);
|
||||
}
|
||||
else
|
||||
{
|
||||
NRF_LOG_INFO("Long: %d", time_var);
|
||||
motorController.RunForDuration(200);
|
||||
}
|
||||
*/
|
||||
}
|
@ -2,7 +2,6 @@
|
||||
|
||||
#include "displayapp/screens/Screen.h"
|
||||
#include "components/brightness/BrightnessController.h"
|
||||
#include "components/datetime/DateTimeController.h"
|
||||
#include "systemtask/SystemTask.h"
|
||||
#include <cstdint>
|
||||
#include <lvgl/lvgl.h>
|
||||
@ -14,7 +13,7 @@ namespace Pinetime {
|
||||
|
||||
class FlashLight : public Screen {
|
||||
public:
|
||||
FlashLight(System::SystemTask& systemTask, Controllers::BrightnessController& brightness, Controllers::DateTime& dateTimeController);
|
||||
FlashLight(System::SystemTask& systemTask, Controllers::BrightnessController& brightness);
|
||||
~FlashLight() override;
|
||||
|
||||
bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override;
|
||||
@ -26,14 +25,14 @@ namespace Pinetime {
|
||||
|
||||
Pinetime::System::SystemTask& systemTask;
|
||||
Controllers::BrightnessController& brightnessController;
|
||||
Controllers::DateTime& dateTimeController;
|
||||
|
||||
|
||||
Controllers::BrightnessController::Levels brightnessLevel = Controllers::BrightnessController::Levels::High;
|
||||
|
||||
lv_obj_t* flashLight;
|
||||
lv_obj_t* backgroundAction;
|
||||
lv_obj_t* indicators[3];
|
||||
int State_l = 1;
|
||||
int State_l = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user