mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-08 23:08:10 -07:00
Remember bad kb connection mode
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <furi_hal.h>
|
||||
#include <storage/storage.h>
|
||||
#include <lib/toolbox/path.h>
|
||||
#include <xtreme/settings.h>
|
||||
|
||||
#include <bt/bt_service/bt_i.h>
|
||||
#include <bt/bt_service/bt.h>
|
||||
@@ -97,6 +98,7 @@ BadKbApp* bad_kb_app_alloc(char* arg) {
|
||||
|
||||
Bt* bt = furi_record_open(RECORD_BT);
|
||||
app->bt = bt;
|
||||
app->is_bt = XTREME_SETTINGS()->bad_bt;
|
||||
const char* adv_name = bt_get_profile_adv_name(bt);
|
||||
memcpy(app->name, adv_name, BAD_KB_ADV_NAME_MAX_LEN);
|
||||
memcpy(app->bt_old_config.name, adv_name, BAD_KB_ADV_NAME_MAX_LEN);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "../bad_kb_app_i.h"
|
||||
#include "furi_hal_power.h"
|
||||
#include "furi_hal_usb.h"
|
||||
#include <xtreme/settings.h>
|
||||
|
||||
enum VarItemListIndex {
|
||||
VarItemListIndexConnection,
|
||||
@@ -12,6 +13,8 @@ enum VarItemListIndex {
|
||||
void bad_kb_scene_config_bt_connection_callback(VariableItem* item) {
|
||||
BadKbApp* bad_kb = variable_item_get_context(item);
|
||||
bad_kb->is_bt = variable_item_get_current_value_index(item);
|
||||
XTREME_SETTINGS()->bad_bt = bad_kb->is_bt;
|
||||
XTREME_SETTINGS_SAVE();
|
||||
variable_item_set_current_value_text(item, bad_kb->is_bt ? "BT" : "USB");
|
||||
view_dispatcher_send_custom_event(bad_kb->view_dispatcher, VarItemListIndexConnection);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "../bad_kb_app_i.h"
|
||||
#include "furi_hal_power.h"
|
||||
#include "furi_hal_usb.h"
|
||||
#include <xtreme/settings.h>
|
||||
|
||||
enum VarItemListIndex {
|
||||
VarItemListIndexConnection,
|
||||
@@ -10,6 +11,8 @@ enum VarItemListIndex {
|
||||
void bad_kb_scene_config_usb_connection_callback(VariableItem* item) {
|
||||
BadKbApp* bad_kb = variable_item_get_context(item);
|
||||
bad_kb->is_bt = variable_item_get_current_value_index(item);
|
||||
XTREME_SETTINGS()->bad_bt = bad_kb->is_bt;
|
||||
XTREME_SETTINGS_SAVE();
|
||||
variable_item_set_current_value_text(item, bad_kb->is_bt ? "BT" : "USB");
|
||||
view_dispatcher_send_custom_event(bad_kb->view_dispatcher, VarItemListIndexConnection);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ typedef struct {
|
||||
uint16_t anim_speed;
|
||||
bool sort_ignore_dirs;
|
||||
bool status_bar;
|
||||
bool bad_bt;
|
||||
} XtremeSettings;
|
||||
|
||||
XtremeSettings* XTREME_SETTINGS();
|
||||
|
||||
Reference in New Issue
Block a user