xuqiang 4 months ago
parent
commit
5aeabbc0da
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/mcumodule.cpp

+ 8 - 0
src/mcumodule.cpp

@@ -16,8 +16,16 @@ MCUModule::MCUModule(QObject *parent)
     settings.beginGroup("MCU");
     if(settings.contains("SCREEN_BRIGHTNESS"))
         m_screenBrightness = settings.value("SCREEN_BRIGHTNESS").toInt();
+    else
+        m_screenBrightness = 9;
     if(settings.contains("KEY_BRIGHTNESS"))
         m_keyBrightness = settings.value("KEY_BRIGHTNESS").toInt();
+    else
+        m_keyBrightness = 9;
+
+    settings.setValue("SCREEN_BRIGHTNESS", m_screenBrightness);
+    settings.setValue("KEY_BRIGHTNESS", m_keyBrightness);
+
     settings.endGroup();
 }