diff --git a/applications/system/hid_app/hid.c b/applications/system/hid_app/hid.c index 55c27bf3c..586d198a9 100644 --- a/applications/system/hid_app/hid.c +++ b/applications/system/hid_app/hid.c @@ -4,7 +4,6 @@ #include "views.h" #include #include -#include "hid_icons.h" #define TAG "HidApp" @@ -59,7 +58,7 @@ static uint32_t hid_ptt_menu_view(void* context) { return HidViewPushToTalkMenu; } -Hid* hid_alloc(void) { +Hid* hid_alloc() { Hid* app = malloc(sizeof(Hid)); // Gui diff --git a/applications/system/hid_app/hid.h b/applications/system/hid_app/hid.h index b15ab58ff..ac565217a 100644 --- a/applications/system/hid_app/hid.h +++ b/applications/system/hid_app/hid.h @@ -62,6 +62,7 @@ struct Hid { HidPushToTalk* hid_ptt; HidPushToTalkMenu* hid_ptt_menu; }; + void bt_hid_remove_pairing(Hid* app); void hid_hal_keyboard_press(Hid* instance, uint16_t event); @@ -76,4 +77,4 @@ void hid_hal_mouse_move(Hid* instance, int8_t dx, int8_t dy); void hid_hal_mouse_scroll(Hid* instance, int8_t delta); void hid_hal_mouse_press(Hid* instance, uint16_t event); void hid_hal_mouse_release(Hid* instance, uint16_t event); -void hid_hal_mouse_release_all(Hid* instance); \ No newline at end of file +void hid_hal_mouse_release_all(Hid* instance); diff --git a/applications/system/hid_app/scenes/hid_scene_main.c b/applications/system/hid_app/scenes/hid_scene_main.c index cd1051ac7..1d0ca5ef4 100644 --- a/applications/system/hid_app/scenes/hid_scene_main.c +++ b/applications/system/hid_app/scenes/hid_scene_main.c @@ -3,7 +3,6 @@ void hid_scene_main_on_enter(void* context) { Hid* app = context; - view_dispatcher_switch_to_view( app->view_dispatcher, scene_manager_get_scene_state(app->scene_manager, HidSceneMain)); } diff --git a/applications/system/hid_app/views/hid_keyboard.c b/applications/system/hid_app/views/hid_keyboard.c index 9c62650f3..9dd2ad655 100644 --- a/applications/system/hid_app/views/hid_keyboard.c +++ b/applications/system/hid_app/views/hid_keyboard.c @@ -228,9 +228,9 @@ static void hid_keyboard_draw_callback(Canvas* canvas, void* context) { furi_assert(context); HidKeyboardModel* model = context; -// Header + // Header #ifdef HID_TRANSPORT_BLE - if((!model->connected)) { + if(!model->connected) { canvas_draw_icon(canvas, 0, 0, &I_Ble_disconnected_15x15); canvas_set_font(canvas, FontPrimary); elements_multiline_text_aligned(canvas, 17, 3, AlignLeft, AlignTop, "Keyboard"); diff --git a/applications/system/hid_app/views/hid_keynote.c b/applications/system/hid_app/views/hid_keynote.c index 3c966e20c..793f6e5d3 100644 --- a/applications/system/hid_app/views/hid_keynote.c +++ b/applications/system/hid_app/views/hid_keynote.c @@ -38,7 +38,7 @@ static void hid_keynote_draw_callback(Canvas* canvas, void* context) { furi_assert(context); HidKeynoteModel* model = context; -// Header + // Header #ifdef HID_TRANSPORT_BLE if(model->connected) { canvas_draw_icon(canvas, 0, 0, &I_Ble_connected_15x15); @@ -114,7 +114,7 @@ static void hid_keynote_draw_vertical_callback(Canvas* canvas, void* context) { furi_assert(context); HidKeynoteModel* model = context; -// Header + // Header #ifdef HID_TRANSPORT_BLE if(model->connected) { canvas_draw_icon(canvas, 0, 0, &I_Ble_connected_15x15); @@ -273,7 +273,6 @@ HidKeynote* hid_keynote_alloc(Hid* hid) { view_allocate_model(hid_keynote->view, ViewModelTypeLocking, sizeof(HidKeynoteModel)); view_set_draw_callback(hid_keynote->view, hid_keynote_draw_callback); view_set_input_callback(hid_keynote->view, hid_keynote_input_callback); - return hid_keynote; } diff --git a/applications/system/hid_app/views/hid_media.c b/applications/system/hid_app/views/hid_media.c index 104e8a6c6..10109b3a3 100644 --- a/applications/system/hid_app/views/hid_media.c +++ b/applications/system/hid_app/views/hid_media.c @@ -41,7 +41,7 @@ static void hid_media_draw_callback(Canvas* canvas, void* context) { furi_assert(context); HidMediaModel* model = context; -// Header + // Header #ifdef HID_TRANSPORT_BLE if(model->connected) { canvas_draw_icon(canvas, 0, 0, &I_Ble_connected_15x15); @@ -197,6 +197,7 @@ static bool hid_media_input_callback(InputEvent* event, void* context) { hid_media_process_release(hid_media, event); } } + return consumed; } @@ -208,7 +209,6 @@ HidMedia* hid_media_alloc(Hid* hid) { view_allocate_model(hid_media->view, ViewModelTypeLocking, sizeof(HidMediaModel)); view_set_draw_callback(hid_media->view, hid_media_draw_callback); view_set_input_callback(hid_media->view, hid_media_input_callback); - return hid_media; } diff --git a/applications/system/hid_app/views/hid_media.h b/applications/system/hid_app/views/hid_media.h index 2356734b3..faf88301f 100644 --- a/applications/system/hid_app/views/hid_media.h +++ b/applications/system/hid_app/views/hid_media.h @@ -3,7 +3,6 @@ #include typedef struct Hid Hid; - typedef struct HidMedia HidMedia; HidMedia* hid_media_alloc(Hid* hid); diff --git a/applications/system/hid_app/views/hid_mouse.c b/applications/system/hid_app/views/hid_mouse.c index 1816a48b4..c4024f10e 100644 --- a/applications/system/hid_app/views/hid_mouse.c +++ b/applications/system/hid_app/views/hid_mouse.c @@ -27,7 +27,7 @@ static void hid_mouse_draw_callback(Canvas* canvas, void* context) { furi_assert(context); HidMouseModel* model = context; -// Header + // Header #ifdef HID_TRANSPORT_BLE if(model->connected) { canvas_draw_icon(canvas, 0, 0, &I_Ble_connected_15x15); @@ -53,9 +53,9 @@ static void hid_mouse_draw_callback(Canvas* canvas, void* context) { // Up if(model->up_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 68, 6, &I_S_UP_31x15); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 80, 8, &I_Pin_arrow_up_7x9); @@ -63,9 +63,9 @@ static void hid_mouse_draw_callback(Canvas* canvas, void* context) { // Down if(model->down_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 68, 36, &I_S_DOWN_31x15); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 80, 40, &I_Pin_arrow_down_7x9); @@ -73,9 +73,9 @@ static void hid_mouse_draw_callback(Canvas* canvas, void* context) { // Left if(model->left_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 61, 13, &I_S_LEFT_15x31); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 63, 25, &I_Pin_arrow_left_9x7); @@ -83,9 +83,9 @@ static void hid_mouse_draw_callback(Canvas* canvas, void* context) { // Right if(model->right_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 91, 13, &I_S_RIGHT_15x31); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 95, 25, &I_Pin_arrow_right_9x7); @@ -93,9 +93,9 @@ static void hid_mouse_draw_callback(Canvas* canvas, void* context) { // Ok if(model->left_mouse_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 74, 19, &I_Pressed_Button_19x19); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 79, 24, &I_Left_mouse_icon_9x9); @@ -103,9 +103,9 @@ static void hid_mouse_draw_callback(Canvas* canvas, void* context) { // Back if(model->right_mouse_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 107, 33, &I_Pressed_Button_19x19); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 112, 38, &I_Right_mouse_icon_9x9); @@ -217,7 +217,6 @@ HidMouse* hid_mouse_alloc(Hid* hid) { view_allocate_model(hid_mouse->view, ViewModelTypeLocking, sizeof(HidMouseModel)); view_set_draw_callback(hid_mouse->view, hid_mouse_draw_callback); view_set_input_callback(hid_mouse->view, hid_mouse_input_callback); - return hid_mouse; } diff --git a/applications/system/hid_app/views/hid_mouse_clicker.c b/applications/system/hid_app/views/hid_mouse_clicker.c index 79922d05f..bc0abe56f 100644 --- a/applications/system/hid_app/views/hid_mouse_clicker.c +++ b/applications/system/hid_app/views/hid_mouse_clicker.c @@ -42,7 +42,7 @@ static void hid_mouse_clicker_draw_callback(Canvas* canvas, void* context) { furi_assert(context); HidMouseClickerModel* model = context; -// Header + // Header #ifdef HID_TRANSPORT_BLE if(model->connected) { canvas_draw_icon(canvas, 0, 0, &I_Ble_connected_15x15); diff --git a/applications/system/hid_app/views/hid_mouse_jiggler.c b/applications/system/hid_app/views/hid_mouse_jiggler.c index 3040753b6..41743b043 100644 --- a/applications/system/hid_app/views/hid_mouse_jiggler.c +++ b/applications/system/hid_app/views/hid_mouse_jiggler.c @@ -25,7 +25,7 @@ static void hid_mouse_jiggler_draw_callback(Canvas* canvas, void* context) { furi_assert(context); HidMouseJigglerModel* model = context; -// Header + // Header #ifdef HID_TRANSPORT_BLE if(model->connected) { canvas_draw_icon(canvas, 0, 0, &I_Ble_connected_15x15); diff --git a/applications/system/hid_app/views/hid_movie.c b/applications/system/hid_app/views/hid_movie.c index 90af5d690..2ee7b0838 100644 --- a/applications/system/hid_app/views/hid_movie.c +++ b/applications/system/hid_app/views/hid_movie.c @@ -59,9 +59,9 @@ static void hid_movie_draw_callback(Canvas* canvas, void* context) { // Up if(model->up_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 68, 6, &I_S_UP_31x15); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 79, 9, &I_Volup_8x6); @@ -69,9 +69,9 @@ static void hid_movie_draw_callback(Canvas* canvas, void* context) { // Down if(model->down_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 68, 36, &I_S_DOWN_31x15); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 80, 41, &I_Voldwn_6x6); @@ -79,9 +79,9 @@ static void hid_movie_draw_callback(Canvas* canvas, void* context) { // Left if(model->left_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 61, 13, &I_S_LEFT_15x31); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } hid_movie_draw_arrow(canvas, 65, 28, CanvasDirectionRightToLeft); @@ -90,9 +90,9 @@ static void hid_movie_draw_callback(Canvas* canvas, void* context) { // Right if(model->right_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 91, 13, &I_S_RIGHT_15x31); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } hid_movie_draw_arrow(canvas, 96, 28, CanvasDirectionLeftToRight); @@ -101,9 +101,9 @@ static void hid_movie_draw_callback(Canvas* canvas, void* context) { // Ok if(model->ok_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 74, 19, &I_Pressed_Button_19x19); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } hid_movie_draw_arrow(canvas, 80, 28, CanvasDirectionLeftToRight); @@ -113,9 +113,9 @@ static void hid_movie_draw_callback(Canvas* canvas, void* context) { // Exit if(model->back_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 107, 33, &I_Pressed_Button_19x19); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 111, 38, &I_Pin_back_arrow_10x10); diff --git a/applications/system/hid_app/views/hid_music_macos.c b/applications/system/hid_app/views/hid_music_macos.c index 637e6850b..1675b6dd5 100644 --- a/applications/system/hid_app/views/hid_music_macos.c +++ b/applications/system/hid_app/views/hid_music_macos.c @@ -59,9 +59,9 @@ static void hid_music_macos_draw_callback(Canvas* canvas, void* context) { // Up if(model->up_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 68, 6, &I_S_UP_31x15); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 79, 9, &I_Volup_8x6); @@ -69,9 +69,9 @@ static void hid_music_macos_draw_callback(Canvas* canvas, void* context) { // Down if(model->down_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 68, 36, &I_S_DOWN_31x15); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 80, 41, &I_Voldwn_6x6); @@ -79,9 +79,9 @@ static void hid_music_macos_draw_callback(Canvas* canvas, void* context) { // Left if(model->left_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 61, 13, &I_S_LEFT_15x31); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } hid_music_macos_draw_arrow(canvas, 67, 28, CanvasDirectionRightToLeft); @@ -91,9 +91,9 @@ static void hid_music_macos_draw_callback(Canvas* canvas, void* context) { // Right if(model->right_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 91, 13, &I_S_RIGHT_15x31); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } hid_music_macos_draw_arrow(canvas, 96, 28, CanvasDirectionLeftToRight); @@ -103,9 +103,9 @@ static void hid_music_macos_draw_callback(Canvas* canvas, void* context) { // Ok if(model->ok_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 74, 19, &I_Pressed_Button_19x19); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } hid_music_macos_draw_arrow(canvas, 80, 28, CanvasDirectionLeftToRight); @@ -115,9 +115,9 @@ static void hid_music_macos_draw_callback(Canvas* canvas, void* context) { // Exit if(model->back_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 107, 33, &I_Pressed_Button_19x19); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 111, 38, &I_Pin_back_arrow_10x10); diff --git a/applications/system/hid_app/views/hid_tiktok.c b/applications/system/hid_app/views/hid_tiktok.c index 5f4e8057d..7e8e28722 100644 --- a/applications/system/hid_app/views/hid_tiktok.c +++ b/applications/system/hid_app/views/hid_tiktok.c @@ -45,9 +45,9 @@ static void hid_tiktok_draw_callback(Canvas* canvas, void* context) { // Pause if(model->back_mouse_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 107, 33, &I_Pressed_Button_19x19); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 113, 37, &I_Pause_icon_9x9); @@ -55,9 +55,9 @@ static void hid_tiktok_draw_callback(Canvas* canvas, void* context) { // Up if(model->up_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 68, 6, &I_S_UP_31x15); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 80, 8, &I_Arr_up_7x9); @@ -65,9 +65,9 @@ static void hid_tiktok_draw_callback(Canvas* canvas, void* context) { // Down if(model->down_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 68, 36, &I_S_DOWN_31x15); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 80, 40, &I_Arr_dwn_7x9); @@ -75,9 +75,9 @@ static void hid_tiktok_draw_callback(Canvas* canvas, void* context) { // Left if(model->left_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 61, 13, &I_S_LEFT_15x31); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 64, 25, &I_Voldwn_6x6); @@ -85,9 +85,9 @@ static void hid_tiktok_draw_callback(Canvas* canvas, void* context) { // Right if(model->right_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 91, 13, &I_S_RIGHT_15x31); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 95, 25, &I_Volup_8x6); @@ -95,9 +95,9 @@ static void hid_tiktok_draw_callback(Canvas* canvas, void* context) { // Ok if(model->ok_pressed) { - canvas_set_bitmap_mode(canvas, 1); + canvas_set_bitmap_mode(canvas, true); canvas_draw_icon(canvas, 74, 19, &I_Pressed_Button_19x19); - canvas_set_bitmap_mode(canvas, 0); + canvas_set_bitmap_mode(canvas, false); canvas_set_color(canvas, ColorWhite); } canvas_draw_icon(canvas, 78, 25, &I_Like_def_11x9);