mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-19 04:44:47 -07:00
Merge remote-tracking branch 'ul/dev' into mntm-dev
This commit is contained in:
@@ -501,7 +501,10 @@ void submenu_process_ok(Submenu* submenu, InputType input_type) {
|
||||
},
|
||||
true);
|
||||
|
||||
if(!item || item->locked) return;
|
||||
if(!item) return;
|
||||
if(item->locked) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!item->has_extended_events && input_type == InputTypeShort && item->callback) {
|
||||
item->callback(item->callback_context, item->index);
|
||||
|
||||
@@ -54,22 +54,6 @@ void submenu_add_item(
|
||||
SubmenuItemCallback callback,
|
||||
void* callback_context);
|
||||
|
||||
/** Add item to submenu with extended press events
|
||||
*
|
||||
* @param submenu Submenu instance
|
||||
* @param label menu item label
|
||||
* @param index menu item index, used for callback, may be
|
||||
* the same with other items
|
||||
* @param callback menu item extended callback
|
||||
* @param callback_context menu item callback context
|
||||
*/
|
||||
void submenu_add_item_ex(
|
||||
Submenu* submenu,
|
||||
const char* label,
|
||||
uint32_t index,
|
||||
SubmenuItemCallbackEx callback,
|
||||
void* callback_context);
|
||||
|
||||
/** Add lockable item to submenu
|
||||
*
|
||||
* @param submenu Submenu instance
|
||||
@@ -90,6 +74,22 @@ void submenu_add_lockable_item(
|
||||
bool locked,
|
||||
const char* locked_message);
|
||||
|
||||
/** Add item to submenu with extended press events
|
||||
*
|
||||
* @param submenu Submenu instance
|
||||
* @param label menu item label
|
||||
* @param index menu item index, used for callback, may be
|
||||
* the same with other items
|
||||
* @param callback menu item extended callback
|
||||
* @param callback_context menu item callback context
|
||||
*/
|
||||
void submenu_add_item_ex(
|
||||
Submenu* submenu,
|
||||
const char* label,
|
||||
uint32_t index,
|
||||
SubmenuItemCallbackEx callback,
|
||||
void* callback_context);
|
||||
|
||||
/** Change label of an existing item
|
||||
*
|
||||
* @param submenu Submenu instance
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
#include <stdio.h>
|
||||
#include <furi.h>
|
||||
#include <furi_hal_gpio.h>
|
||||
#include <furi_hal_vibro.h>
|
||||
#include <toolbox/cli/cli_command.h>
|
||||
#include <cli/cli_main_commands.h>
|
||||
#include <toolbox/pipe.h>
|
||||
#include <furi_hal_vibro.h>
|
||||
|
||||
#define INPUT_DEBOUNCE_TICKS_HALF (INPUT_DEBOUNCE_TICKS / 2)
|
||||
#define INPUT_PRESS_TICKS 150
|
||||
@@ -155,8 +155,10 @@ int32_t input_srv(void* p) {
|
||||
// Send Press/Release event
|
||||
event.type = pin_states[i].state ? InputTypePress : InputTypeRelease;
|
||||
furi_pubsub_publish(event_pubsub, &event);
|
||||
// do vibro if user setup vibro touch level in Settings-Input.
|
||||
// vibro signal if user setup vibro touch level in Settings-Input.
|
||||
if(settings->vibro_touch_level) {
|
||||
//delay 1 ticks for compatibility with rgb_backlight_mod
|
||||
furi_delay_tick(1);
|
||||
furi_hal_vibro_on(true);
|
||||
furi_delay_tick(settings->vibro_touch_level);
|
||||
furi_hal_vibro_on(false);
|
||||
|
||||
@@ -29,7 +29,6 @@ void input_settings_load(InputSettings* settings) {
|
||||
sizeof(InputSettings),
|
||||
INPUT_SETTINGS_MAGIC,
|
||||
INPUT_SETTINGS_VER);
|
||||
// if config previous version - load it and inicialize new settings
|
||||
}
|
||||
// in case of another config version we exit from useless cycle to next step
|
||||
} while(false);
|
||||
|
||||
@@ -388,13 +388,18 @@ static void power_handle_reboot(PowerBootMode mode) {
|
||||
|
||||
//start furi timer for autopoweroff
|
||||
static void power_start_auto_poweroff_timer(Power* power) {
|
||||
if(furi_timer_is_running(power->auto_poweroff_timer)) {
|
||||
furi_timer_stop(power->auto_poweroff_timer);
|
||||
}
|
||||
furi_timer_start(
|
||||
power->auto_poweroff_timer, furi_ms_to_ticks(power->settings.auto_poweroff_delay_ms));
|
||||
}
|
||||
|
||||
//stop furi timer for autopoweroff
|
||||
static void power_stop_auto_poweroff_timer(Power* power) {
|
||||
furi_timer_stop(power->auto_poweroff_timer);
|
||||
if(furi_timer_is_running(power->auto_poweroff_timer)) {
|
||||
furi_timer_stop(power->auto_poweroff_timer);
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t power_is_running_auto_poweroff_timer(Power* power) {
|
||||
|
||||
Reference in New Issue
Block a user