Browse Source

better ifdef to handle non split kb

xmkb
Shawn Meier 2 years ago committed by Julia Luna
parent
commit
a956143b29
Signed by: xenua
GPG Key ID: 6A0C04FA9A7D7582
  1. 3
      app/include/zmk/hid.h
  2. 3
      app/src/mouse/key_listener.c
  3. 5
      app/src/mouse/tick_listener.c

3
app/include/zmk/hid.h

@ -15,6 +15,8 @@ @@ -15,6 +15,8 @@
#include <dt-bindings/zmk/hid_usage.h>
#include <dt-bindings/zmk/hid_usage_pages.h>
#define ZMK_HID_KEYBOARD_NKRO_MAX_USAGE HID_USAGE_KEY_KEYPAD_EQUAL
#define COLLECTION_REPORT 0x03
static const uint8_t zmk_hid_report_desc[] = {
@ -88,7 +90,6 @@ static const uint8_t zmk_hid_report_desc[] = { @@ -88,7 +90,6 @@ static const uint8_t zmk_hid_report_desc[] = {
/* REPORT_COUNT (CONFIG_ZMK_HID_CONSUMER_REPORT_SIZE) */
HID_REPORT_COUNT(CONFIG_ZMK_HID_CONSUMER_REPORT_SIZE),
HID_INPUT(0x00),
0x00,
/* END COLLECTION */
HID_END_COLLECTION,

3
app/src/mouse/key_listener.c

@ -18,8 +18,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); @@ -18,8 +18,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
#include <zmk/endpoints.h>
#include <zmk/mouse.h>
//TODO: There is probably a better flag to use here
#if(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL)
#if !defined(CONFIG_ZMK_SPLIT) || defined(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL)
static struct vector2d move_speed = {0};
static struct vector2d scroll_speed = {0};
static struct mouse_config move_config = (struct mouse_config){0};

5
app/src/mouse/tick_listener.c

@ -16,8 +16,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); @@ -16,8 +16,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
#include <sys/util.h> // CLAMP
//TODO: probably a better flag to use here
#if(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL)
#if !defined(CONFIG_ZMK_SPLIT) || defined(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL)
#if CONFIG_MINIMAL_LIBC
static float powf(float base, float exponent) {
// poor man's power implementation rounds the exponent down to the nearest integer.
@ -104,4 +103,4 @@ int zmk_mouse_tick_listener(const zmk_event_t *eh) { @@ -104,4 +103,4 @@ int zmk_mouse_tick_listener(const zmk_event_t *eh) {
ZMK_LISTENER(zmk_mouse_tick_listener, zmk_mouse_tick_listener);
ZMK_SUBSCRIPTION(zmk_mouse_tick_listener, zmk_mouse_tick);
#endif /* CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL */
#endif /* !defined(CONFIG_ZMK_SPLIT) || defined(CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL) */
Loading…
Cancel
Save