forked from flipperdevices/flipperzero-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-candidate' into release
- Loading branch information
Showing
140 changed files
with
3,893 additions
and
4,006 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
applications/bt/bt_settings_app/scenes/bt_settings_scene_config.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
ADD_SCENE(bt_settings, start, Start) | ||
ADD_SCENE(bt_settings, disable_dialog, DisableDialog) |
44 changes: 0 additions & 44 deletions
44
applications/bt/bt_settings_app/scenes/bt_settings_scene_disable_dialog.c
This file was deleted.
Oops, something went wrong.
67 changes: 38 additions & 29 deletions
67
applications/bt/bt_settings_app/scenes/bt_settings_scene_start.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,65 @@ | ||
#include "../bt_settings_app.h" | ||
#include "furi-hal-bt.h" | ||
|
||
enum BtSettingsAppStartSubmenuIndex { | ||
BtSettingsAppStartSubmenuIndexEnable, | ||
enum BtSetting { | ||
BtSettingOff, | ||
BtSettingOn, | ||
BtSettingNum, | ||
}; | ||
|
||
static void bt_settings_scene_start_submenu_callback(void* context, uint32_t index) { | ||
BtSettingsApp* app = context; | ||
const char* const bt_settings_text[BtSettingNum] = { | ||
"Off", | ||
"On", | ||
}; | ||
|
||
static void bt_settings_scene_start_var_list_change_callback(VariableItem* item) { | ||
BtSettingsApp* app = variable_item_get_context(item); | ||
uint8_t index = variable_item_get_current_value_index(item); | ||
|
||
variable_item_set_current_value_text(item, bt_settings_text[index]); | ||
view_dispatcher_send_custom_event(app->view_dispatcher, index); | ||
} | ||
|
||
void bt_settings_scene_start_on_enter(void* context) { | ||
BtSettingsApp* app = context; | ||
Submenu* submenu = app->submenu; | ||
|
||
const char* submenu_label = app->settings.enabled ? "Disable" : "Enable"; | ||
submenu_add_item( | ||
submenu, | ||
submenu_label, | ||
BtSettingsAppStartSubmenuIndexEnable, | ||
bt_settings_scene_start_submenu_callback, | ||
VariableItemList* var_item_list = app->var_item_list; | ||
|
||
VariableItem* item; | ||
item = variable_item_list_add( | ||
var_item_list, | ||
"Bluetooth", | ||
BtSettingNum, | ||
bt_settings_scene_start_var_list_change_callback, | ||
app); | ||
if(app->settings.enabled) { | ||
variable_item_set_current_value_index(item, BtSettingOn); | ||
variable_item_set_current_value_text(item, bt_settings_text[BtSettingOn]); | ||
} else { | ||
variable_item_set_current_value_index(item, BtSettingOff); | ||
variable_item_set_current_value_text(item, bt_settings_text[BtSettingOff]); | ||
} | ||
|
||
view_dispatcher_switch_to_view(app->view_dispatcher, BtSettingsAppViewSubmenu); | ||
view_dispatcher_switch_to_view(app->view_dispatcher, BtSettingsAppViewVarItemList); | ||
} | ||
|
||
bool bt_settings_scene_start_on_event(void* context, SceneManagerEvent event) { | ||
BtSettingsApp* app = context; | ||
bool consumed = false; | ||
|
||
if(event.type == SceneManagerEventTypeCustom) { | ||
if(event.event == BtSettingsAppStartSubmenuIndexEnable) { | ||
if(!app->settings.enabled) { | ||
app->settings.enabled = true; | ||
furi_hal_bt_start_app(); | ||
submenu_clean(app->submenu); | ||
submenu_add_item( | ||
app->submenu, | ||
"Disable", | ||
BtSettingsAppStartSubmenuIndexEnable, | ||
bt_settings_scene_start_submenu_callback, | ||
app); | ||
} else { | ||
scene_manager_next_scene(app->scene_manager, BtSettingsAppSceneDisableDialog); | ||
} | ||
consumed = true; | ||
if(event.event == BtSettingOn) { | ||
furi_hal_bt_start_advertising(); | ||
app->settings.enabled = true; | ||
} else if(event.event == BtSettingOff) { | ||
app->settings.enabled = false; | ||
furi_hal_bt_stop_advertising(); | ||
} | ||
consumed = true; | ||
} | ||
return consumed; | ||
} | ||
|
||
void bt_settings_scene_start_on_exit(void* context) { | ||
BtSettingsApp* app = context; | ||
submenu_clean(app->submenu); | ||
variable_item_list_clean(app->var_item_list); | ||
} |
Oops, something went wrong.