浏览代码

Merge nightstand_clock from https://github.com/xMasterX/all-the-plugins

WillyJL 7 月之前
父节点
当前提交
7c4188618a
共有 2 个文件被更改,包括 9 次插入2 次删除
  1. 1 1
      nightstand_clock/.gitsubtree
  2. 8 1
      nightstand_clock/clock_app.c

+ 1 - 1
nightstand_clock/.gitsubtree

@@ -1,2 +1,2 @@
-https://github.com/xMasterX/all-the-plugins dev non_catalog_apps/FlipperNightStand_clock 8581870011ec7f1f80fffa14dbd3b1d6b4ddb635
+https://github.com/xMasterX/all-the-plugins dev non_catalog_apps/FlipperNightStand_clock e8734b1713d6a0dff5e978ee4ea0ae1ac12b781f
 https://github.com/nymda/FlipperNightStand main /

+ 8 - 1
nightstand_clock/clock_app.c

@@ -122,7 +122,7 @@ static void clock_render_callback(Canvas* const canvas, void* ctx) {
     //canvas_set_color(canvas, ColorBlack);
 
     //avoids a bug with the brightness being reverted after the backlight-off period
-    set_backlight_brightness((float)(brightness / 100.f));
+    //set_backlight_brightness((float)(brightness / 100.f));
 
     if(dspBrightnessBarFrames > 0) {
         elements_progress_bar_vertical(canvas, 119, 1, 62, (float)(brightness / 100.f));
@@ -315,6 +315,10 @@ int32_t clock_app(void* p) {
     float tmpBrightness = notif->settings.display_brightness;
     brightness = tmpBrightness * 100; // Keep current brightness by default
 
+    //save current user settings to tmp, disable backlight delay and force dislay always on
+    uint32_t tmp_display_off_delay_ms = notif->settings.display_off_delay_ms;
+    notif->settings.display_off_delay_ms = 0;
+
     notification_message(notif, &sequence_display_backlight_enforce_on);
     notification_message(notif, &led_off);
 
@@ -394,6 +398,9 @@ int32_t clock_app(void* p) {
     furi_mutex_free(plugin_state->mutex);
     free(plugin_state);
 
+    //restore display backlight timer settings;
+    notif->settings.display_off_delay_ms = tmp_display_off_delay_ms;
+
     set_backlight_brightness(tmpBrightness);
     notification_message(notif, &sequence_display_backlight_enforce_auto);
     notification_message(notif, &led_reset);