mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-11 23:38:11 -07:00
Merge remote-tracking branch 'mntm/dev' into js-app-internal
This commit is contained in:
+1
-1
Submodule applications/external updated: 1b8f9fcf6c...1163b58398
@@ -35,12 +35,12 @@ typedef enum {
|
||||
|
||||
WorkerEvtLineCfgSet = (1 << 6),
|
||||
WorkerEvtCtrlLineSet = (1 << 7),
|
||||
|
||||
WorkerEvtSendBreak = (1 << 8),
|
||||
} WorkerEvtFlags;
|
||||
|
||||
#define WORKER_ALL_RX_EVENTS \
|
||||
(WorkerEvtStop | WorkerEvtRxDone | WorkerEvtCfgChange | WorkerEvtLineCfgSet | \
|
||||
WorkerEvtCtrlLineSet | WorkerEvtCdcTxComplete)
|
||||
WorkerEvtCtrlLineSet | WorkerEvtCdcTxComplete | WorkerEvtSendBreak)
|
||||
#define WORKER_ALL_TX_EVENTS (WorkerEvtTxStop | WorkerEvtCdcRx)
|
||||
|
||||
struct UsbUartBridge {
|
||||
@@ -69,6 +69,7 @@ static void vcp_on_cdc_rx(void* context);
|
||||
static void vcp_state_callback(void* context, uint8_t state);
|
||||
static void vcp_on_cdc_control_line(void* context, uint8_t state);
|
||||
static void vcp_on_line_config(void* context, struct usb_cdc_line_coding* config);
|
||||
static void vcp_on_cdc_break(void* context, uint16_t duration);
|
||||
|
||||
static const CdcCallbacks cdc_cb = {
|
||||
vcp_on_cdc_tx_complete,
|
||||
@@ -76,6 +77,7 @@ static const CdcCallbacks cdc_cb = {
|
||||
vcp_state_callback,
|
||||
vcp_on_cdc_control_line,
|
||||
vcp_on_line_config,
|
||||
vcp_on_cdc_break,
|
||||
};
|
||||
|
||||
/* USB UART worker */
|
||||
@@ -287,6 +289,9 @@ static int32_t usb_uart_worker(void* context) {
|
||||
if(events & WorkerEvtCtrlLineSet) {
|
||||
usb_uart_update_ctrl_lines(usb_uart);
|
||||
}
|
||||
if(events & WorkerEvtSendBreak) {
|
||||
furi_hal_serial_send_break(usb_uart->serial_handle);
|
||||
}
|
||||
}
|
||||
usb_uart_vcp_deinit(usb_uart, usb_uart->cfg.vcp_ch);
|
||||
usb_uart_serial_deinit(usb_uart);
|
||||
@@ -377,6 +382,12 @@ static void vcp_on_line_config(void* context, struct usb_cdc_line_coding* config
|
||||
furi_thread_flags_set(furi_thread_get_id(usb_uart->thread), WorkerEvtLineCfgSet);
|
||||
}
|
||||
|
||||
static void vcp_on_cdc_break(void* context, uint16_t duration) {
|
||||
UNUSED(duration);
|
||||
UsbUartBridge* usb_uart = (UsbUartBridge*)context;
|
||||
furi_thread_flags_set(furi_thread_get_id(usb_uart->thread), WorkerEvtSendBreak);
|
||||
}
|
||||
|
||||
UsbUartBridge* usb_uart_enable(UsbUartConfig* cfg) {
|
||||
UsbUartBridge* usb_uart = malloc(sizeof(UsbUartBridge));
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ static CdcCallbacks cdc_cb = {
|
||||
vcp_state_callback,
|
||||
vcp_on_cdc_control_line,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static CliVcp* vcp = NULL;
|
||||
|
||||
@@ -42,6 +42,7 @@ typedef struct {
|
||||
enum HidPushToTalkAppIndex {
|
||||
HidPushToTalkAppIndexDiscord,
|
||||
HidPushToTalkAppIndexFaceTime,
|
||||
HidPushToTalkAppIndexGather,
|
||||
HidPushToTalkAppIndexGoogleMeet,
|
||||
HidPushToTalkAppIndexGoogleHangouts,
|
||||
HidPushToTalkAppIndexJamulus,
|
||||
@@ -308,7 +309,6 @@ static void hid_ptt_trigger_mute_jamulus(HidPushToTalk* hid_ptt) {
|
||||
}
|
||||
|
||||
// webex
|
||||
|
||||
static void hid_ptt_trigger_camera_webex(HidPushToTalk* hid_ptt) {
|
||||
hid_hal_keyboard_press(hid_ptt->hid, KEY_MOD_LEFT_CTRL | KEY_MOD_LEFT_SHIFT | HID_KEYBOARD_V);
|
||||
hid_hal_keyboard_release(
|
||||
@@ -325,6 +325,30 @@ static void hid_ptt_trigger_hand_linux_webex(HidPushToTalk* hid_ptt) {
|
||||
hid_ptt->hid, KEY_MOD_LEFT_CTRL | KEY_MOD_RIGHT_SHIFT | HID_KEYBOARD_R);
|
||||
}
|
||||
|
||||
// Gather
|
||||
static void hid_ptt_trigger_hand_gather(HidPushToTalk* hid_ptt) {
|
||||
hid_hal_keyboard_press(hid_ptt->hid, HID_KEYBOARD_H);
|
||||
hid_hal_keyboard_release(hid_ptt->hid, HID_KEYBOARD_H);
|
||||
}
|
||||
static void hid_ptt_trigger_camera_macos_gather(HidPushToTalk* hid_ptt) {
|
||||
hid_hal_keyboard_press(hid_ptt->hid, KEY_MOD_LEFT_GUI | KEY_MOD_LEFT_SHIFT | HID_KEYBOARD_V);
|
||||
hid_hal_keyboard_release(hid_ptt->hid, KEY_MOD_LEFT_GUI | KEY_MOD_LEFT_SHIFT | HID_KEYBOARD_V);
|
||||
}
|
||||
static void hid_ptt_trigger_mute_macos_gather(HidPushToTalk* hid_ptt) {
|
||||
hid_hal_keyboard_press(hid_ptt->hid, KEY_MOD_LEFT_GUI | KEY_MOD_LEFT_SHIFT | HID_KEYBOARD_A);
|
||||
hid_hal_keyboard_release(hid_ptt->hid, KEY_MOD_LEFT_GUI | KEY_MOD_LEFT_SHIFT | HID_KEYBOARD_A);
|
||||
}
|
||||
static void hid_ptt_trigger_camera_linux_gather(HidPushToTalk* hid_ptt) {
|
||||
hid_hal_keyboard_press(hid_ptt->hid, KEY_MOD_LEFT_CTRL | KEY_MOD_LEFT_SHIFT | HID_KEYBOARD_V);
|
||||
hid_hal_keyboard_release(
|
||||
hid_ptt->hid, KEY_MOD_LEFT_CTRL | KEY_MOD_LEFT_SHIFT | HID_KEYBOARD_V);
|
||||
}
|
||||
static void hid_ptt_trigger_mute_linux_gather(HidPushToTalk* hid_ptt) {
|
||||
hid_hal_keyboard_press(hid_ptt->hid, KEY_MOD_LEFT_CTRL | KEY_MOD_LEFT_SHIFT | HID_KEYBOARD_A);
|
||||
hid_hal_keyboard_release(
|
||||
hid_ptt->hid, KEY_MOD_LEFT_CTRL | KEY_MOD_LEFT_SHIFT | HID_KEYBOARD_A);
|
||||
}
|
||||
|
||||
static void hid_ptt_menu_callback(
|
||||
void* context,
|
||||
uint32_t osIndex,
|
||||
@@ -359,6 +383,13 @@ static void hid_ptt_menu_callback(
|
||||
model->callback_start_ptt = hid_ptt_trigger_cmd_shift_m;
|
||||
model->callback_stop_ptt = hid_ptt_trigger_cmd_shift_m;
|
||||
break;
|
||||
case HidPushToTalkAppIndexGather:
|
||||
model->callback_trigger_mute = hid_ptt_trigger_mute_macos_gather;
|
||||
model->callback_trigger_camera = hid_ptt_trigger_camera_macos_gather;
|
||||
model->callback_trigger_hand = hid_ptt_trigger_hand_gather;
|
||||
model->callback_start_ptt = hid_ptt_trigger_mute_macos_gather;
|
||||
model->callback_stop_ptt = hid_ptt_trigger_mute_macos_gather;
|
||||
break;
|
||||
case HidPushToTalkAppIndexGoogleHangouts:
|
||||
model->callback_trigger_mute = hid_ptt_trigger_mute_macos_hangouts;
|
||||
model->callback_trigger_camera = hid_ptt_trigger_camera_macos_hangouts;
|
||||
@@ -434,6 +465,13 @@ static void hid_ptt_menu_callback(
|
||||
model->callback_start_ptt = hid_ptt_start_ptt_linux_discord;
|
||||
model->callback_stop_ptt = hid_ptt_stop_ptt_linux_discord;
|
||||
break;
|
||||
case HidPushToTalkAppIndexGather:
|
||||
model->callback_trigger_mute = hid_ptt_trigger_mute_linux_gather;
|
||||
model->callback_trigger_camera = hid_ptt_trigger_camera_linux_gather;
|
||||
model->callback_trigger_hand = hid_ptt_trigger_hand_gather;
|
||||
model->callback_start_ptt = hid_ptt_trigger_mute_linux_gather;
|
||||
model->callback_stop_ptt = hid_ptt_trigger_mute_linux_gather;
|
||||
break;
|
||||
case HidPushToTalkAppIndexGoogleHangouts:
|
||||
model->callback_trigger_mute = hid_ptt_trigger_mute_linux_hangouts;
|
||||
model->callback_trigger_camera = hid_ptt_trigger_camera_linux_hangouts;
|
||||
@@ -873,6 +911,20 @@ HidPushToTalk* hid_ptt_alloc(Hid* hid) {
|
||||
HidPushToTalkAppIndexFaceTime,
|
||||
hid_ptt_menu_callback,
|
||||
hid_ptt);
|
||||
ptt_menu_add_item_to_list(
|
||||
hid->hid_ptt_menu,
|
||||
HidPushToTalkMacOS,
|
||||
"Gather",
|
||||
HidPushToTalkAppIndexGather,
|
||||
hid_ptt_menu_callback,
|
||||
hid_ptt);
|
||||
ptt_menu_add_item_to_list(
|
||||
hid->hid_ptt_menu,
|
||||
HidPushToTalkLinux,
|
||||
"Gather",
|
||||
HidPushToTalkAppIndexGather,
|
||||
hid_ptt_menu_callback,
|
||||
hid_ptt);
|
||||
ptt_menu_add_item_to_list(
|
||||
hid->hid_ptt_menu,
|
||||
HidPushToTalkMacOS,
|
||||
@@ -932,14 +984,14 @@ HidPushToTalk* hid_ptt_alloc(Hid* hid) {
|
||||
ptt_menu_add_item_to_list(
|
||||
hid->hid_ptt_menu,
|
||||
HidPushToTalkMacOS,
|
||||
"Slack Hubble",
|
||||
"Slack Huddle",
|
||||
HidPushToTalkAppIndexSlackHubble,
|
||||
hid_ptt_menu_callback,
|
||||
hid_ptt);
|
||||
ptt_menu_add_item_to_list(
|
||||
hid->hid_ptt_menu,
|
||||
HidPushToTalkLinux,
|
||||
"Slack Hubble",
|
||||
"Slack Huddle",
|
||||
HidPushToTalkAppIndexSlackHubble,
|
||||
hid_ptt_menu_callback,
|
||||
hid_ptt);
|
||||
|
||||
Reference in New Issue
Block a user