Skip to content

Commit

Permalink
upd air mouse
Browse files Browse the repository at this point in the history
temp fix is removed for now here
  • Loading branch information
xMasterX committed Feb 12, 2024
1 parent b5b85fb commit a55a6b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
15 changes: 3 additions & 12 deletions non_catalog_apps/air_mouse_ofw/air_mouse_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
#include "views/air_mouse_view.h"
#include <furi_hal_usb_hid.h>
#include <storage/storage.h>
#include <expansion/expansion.h>

#define TAG "SensorModule"

#define AIRMOUSE_BT_KEYS_STORAGE_NAME ".airm_bt_hid.keys"
#define BLE_HID_KEYS_PATH "/ext/apps_data/hid_ble/.bt_hid.keys"

typedef struct {
Gui* gui;
Expand Down Expand Up @@ -63,7 +62,7 @@ static void ble_hid_remove_pairing(void) {
// Wait 2nd core to update nvm storage
furi_delay_ms(200);

bt_keys_storage_set_storage_path(bt, APP_DATA_PATH(AIRMOUSE_BT_KEYS_STORAGE_NAME));
bt_keys_storage_set_storage_path(bt, BLE_HID_KEYS_PATH);
bt_forget_bonded_devices(bt);

// Wait 2nd core to update nvm storage
Expand All @@ -88,7 +87,7 @@ static Bt* ble_hid_init(AirMouseApp* app) {
// Wait 2nd core to update nvm storage
furi_delay_ms(200);

bt_keys_storage_set_storage_path(bt, APP_DATA_PATH(AIRMOUSE_BT_KEYS_STORAGE_NAME));
bt_keys_storage_set_storage_path(bt, BLE_HID_KEYS_PATH);

furi_check(bt_set_profile(bt, BtProfileHidKeyboard));

Expand Down Expand Up @@ -212,10 +211,6 @@ static void air_mouse_free(AirMouseApp* app) {

int32_t air_mouse_app(void* arg) {
UNUSED(arg);

Expansion* expansion = furi_record_open(RECORD_EXPANSION);
expansion_disable(expansion);

AirMouseApp* app = air_mouse_alloc();

app->icm42688p_device = malloc(sizeof(FuriHalSpiBusHandle));
Expand All @@ -241,9 +236,5 @@ int32_t air_mouse_app(void* arg) {
free(app->icm42688p_device);

air_mouse_free(app);

expansion_enable(expansion);
furi_record_close(RECORD_EXPANSION);

return 0;
}
5 changes: 3 additions & 2 deletions non_catalog_apps/air_mouse_ofw/application.fam
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
App(
appid="air_mouse_ofw",
name="[ICM42688] Air Mouse",
appid="vgm_air_mouse",
name="[VGM] Air Mouse",
fap_description="Video Game Module Air Mouse",
apptype=FlipperAppType.EXTERNAL,
entry_point="air_mouse_app",
stack_size=4 * 1024,
Expand Down
2 changes: 1 addition & 1 deletion non_catalog_apps/air_mouse_ofw/views/air_mouse_view.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "air_mouse_view.h"
#include <gui/elements.h>
#include "../imu_mouse.h"
#include "air_mouse_ofw_icons.h"
#include "vgm_air_mouse_icons.h"

struct AirMouseView {
View* view;
Expand Down

0 comments on commit a55a6b6

Please sign in to comment.