Cleaning out prototype traces

This commit is contained in:
krikun98 2021-05-02 13:30:57 +03:00 committed by Alexander Krikun
parent 5083b31296
commit c36ec0c717
4 changed files with 4 additions and 28 deletions

View file

@ -264,7 +264,6 @@ static void disconnect_current_endpoint() {
zmk_endpoints_send_report(HID_USAGE_KEY);
zmk_endpoints_send_report(HID_USAGE_CONSUMER);
zmk_endpoints_send_report(HID_USAGE_GD);
}
static void update_current_endpoint() {

View file

@ -16,7 +16,7 @@ static struct zmk_hid_keyboard_report keyboard_report = {
static struct zmk_hid_consumer_report consumer_report = {.report_id = 2, .body = {.keys = {0}}};
static struct zmk_hid_mouse_report mouse_report = {.report_id = 4, .body = {
.buttons = 0, .x = 0, .y = 0, .wheel_hor = 0, .wheel_vert = 0}};
.buttons = 0, .x = 0, .y = 0, .wheel_vert = 0, .wheel_hor = 0}};
// Keep track of how often a modifier was pressed.
// Only release the modifier if the count is 0.

View file

@ -36,13 +36,6 @@ static int hid_listener_keycode_pressed(const struct zmk_keycode_state_changed *
return err;
}
break;
case HID_USAGE_GD:
err = zmk_hid_mouse_buttons_press(ev->keycode);
if (err) {
LOG_ERR("Unable to press button");
return err;
}
break;
}
zmk_hid_register_mods(ev->explicit_modifiers);
zmk_hid_implicit_modifiers_press(ev->implicit_modifiers);
@ -67,14 +60,6 @@ static int hid_listener_keycode_released(const struct zmk_keycode_state_changed
LOG_ERR("Unable to release keycode");
return err;
}
break;
case HID_USAGE_GD:
err = zmk_hid_mouse_buttons_release(ev->keycode);
if (err) {
LOG_ERR("Unable to release button");
return err;
}
break;
}
zmk_hid_unregister_mods(ev->explicit_modifiers);
// There is a minor issue with this code.

View file

@ -187,8 +187,6 @@ K_MSGQ_DEFINE(zmk_hog_keyboard_msgq, sizeof(struct zmk_hid_keyboard_report_body)
void send_keyboard_report_callback(struct k_work *work) {
struct zmk_hid_keyboard_report_body report;
LOG_ERR("Sending keyboard callback");
while (k_msgq_get(&zmk_hog_keyboard_msgq, &report, K_NO_WAIT) == 0) {
struct bt_conn *conn = destination_connection();
if (conn == NULL) {
@ -214,7 +212,6 @@ K_WORK_DEFINE(hog_keyboard_work, send_keyboard_report_callback);
int zmk_hog_send_keyboard_report(struct zmk_hid_keyboard_report_body *report) {
int err = k_msgq_put(&zmk_hog_keyboard_msgq, report, K_MSEC(100));
LOG_ERR("Sending keyboard report");
if (err) {
switch (err) {
case -EAGAIN: {
@ -285,14 +282,10 @@ int zmk_hog_send_consumer_report(struct zmk_hid_consumer_report_body *report) {
};
K_MSGQ_DEFINE(zmk_hog_mouse_msgq, sizeof(struct zmk_hid_mouse_report_body),
CONFIG_ZMK_BLE_MOUSE_REPORT_QUEUE_SIZE, 4);
CONFIG_ZMK_BLE_MOUSE_REPORT_QUEUE_SIZE, 4);
void send_mouse_report_callback(struct k_work *work) {
struct zmk_hid_mouse_report_body report;
LOG_ERR("Sending mouse callback");
while (k_msgq_get(&zmk_hog_mouse_msgq, &report, K_NO_WAIT) == 0) {
struct bt_conn *conn = destination_connection();
if (conn == NULL) {
@ -318,7 +311,6 @@ K_WORK_DEFINE(hog_mouse_work, send_mouse_report_callback);
int zmk_hog_send_mouse_report(struct zmk_hid_mouse_report_body *report) {
int err = k_msgq_put(&zmk_hog_mouse_msgq, report, K_MSEC(100));
LOG_ERR("Sending mouse report");
if (err) {
switch (err) {
case -EAGAIN: {