kamiyaowl/wfh_monitor

設定ファイルから色々できるといいなぁ...

Closed this issue · 1 comments

設定ファイルから色々できるといいなぁ...

static constexpr BrightnessSetting brightnessSetting[N] = { // TODO: 設定ファイルから色々できるといいなぁ...

        void setup(void) override {
            // configure
            static constexpr BrightnessSetting brightnessSetting[N] = { // TODO: 設定ファイルから色々できるといいなぁ...
                { .visibleLux =  50.0f , .brightness = 20 },
                { .visibleLux = 120.0f , .brightness = 100 },
                { .visibleLux = 180.0f , .brightness = 200 },
                { .visibleLux = FLT_MAX, .brightness = 255 },
            };
            this->resource.config.operate([&](GlobalConfig<FixedConfig::ConfigAllocateSize>& config){
                // fps
                auto fps = GlobalConfigDefaultValues::UiTaskFps;
                config.read(GlobalConfigKeys::UiTaskFps, fps);
                this->setFps(fps);
                // auto brightness
                auto holdMs = GlobalConfigDefaultValues::BrightnessHoldMs;
                auto transitionMs = GlobalConfigDefaultValues::BrightnessTransitionMs;
                config.read(GlobalConfigKeys::UiTaskFps, holdMs);
                config.read(GlobalConfigKeys::UiTaskFps, transitionMs);

                this->brightness.configure(true, holdMs, transitionMs, brightnessSetting);
            });

            // initialize lcd
            this->lcd.setTextSize(1);

5874979dbc4ee830782d541d6690d2b511926274