mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 02:58:36 -07:00
*POWER*
- serice:
renamed function and variable
- settings:
add test value 5 sec for auto_power_off timer
*DESKTOP*
- settings|service
add USB_inhibit for desktop_auto_lock
(dont autolock desktop with different condition)
PS. RPC condition now working now.
This commit is contained in:
@@ -13,8 +13,15 @@
|
||||
#include "scenes/desktop_scene.h"
|
||||
#include "scenes/desktop_scene_locked.h"
|
||||
|
||||
#include "furi_hal_power.h"
|
||||
|
||||
#define TAG "Desktop"
|
||||
|
||||
// dublicate constants from desktop_setting_scene_start.c
|
||||
#define USB_INHIBIT_AUTOLOCK_OFF 0
|
||||
#define USB_INHIBIT_AUTOLOCK_ON 1
|
||||
#define USB_INHIBIT_AUTOLOCK_RPC 2
|
||||
|
||||
static void desktop_auto_lock_arm(Desktop*);
|
||||
static void desktop_auto_lock_inhibit(Desktop*);
|
||||
static void desktop_start_auto_lock_timer(Desktop*);
|
||||
@@ -143,6 +150,14 @@ static bool desktop_custom_event_callback(void* context, uint32_t event) {
|
||||
|
||||
} else if(event == DesktopGlobalAutoLock) {
|
||||
if(!desktop->app_running && !desktop->locked) {
|
||||
// if usb_inhibit_autolock enabled and device charging or device charged but still connected to USB then break desktop locking.
|
||||
if ((desktop->settings.usb_inhibit_auto_lock == USB_INHIBIT_AUTOLOCK_ON) && ((furi_hal_power_is_charging()) || (furi_hal_power_is_charging_done()))){
|
||||
return(0);
|
||||
}
|
||||
// if usb_inhibit_autolock set to RPC and we have F0 connected to phone or PC app then break desktop locking.
|
||||
if (desktop->settings.usb_inhibit_auto_lock == USB_INHIBIT_AUTOLOCK_RPC){
|
||||
return(0);
|
||||
}
|
||||
desktop_lock(desktop);
|
||||
}
|
||||
} else if(event == DesktopGlobalSaveSettings) {
|
||||
|
||||
Reference in New Issue
Block a user