From 1a1ab9c52993deec1161f51d1d8ae7d9c8c3527a Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 14 Nov 2023 11:53:51 -0800 Subject: [PATCH] Make it possible to not use our short name override, which we need when not using keyboardiohid --- src/kaleidoscope/driver/hid/Keyboardio.h | 2 ++ src/kaleidoscope/layers.h | 1 + src/kaleidoscope_internal/shortname.h | 7 ++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/kaleidoscope/driver/hid/Keyboardio.h b/src/kaleidoscope/driver/hid/Keyboardio.h index f71d3a0a58..82849e727a 100644 --- a/src/kaleidoscope/driver/hid/Keyboardio.h +++ b/src/kaleidoscope/driver/hid/Keyboardio.h @@ -22,6 +22,8 @@ #include "kaleidoscope/driver/hid/keyboardio/Keyboard.h" // for Keyboard, KeyboardProps #include "kaleidoscope/driver/hid/keyboardio/Mouse.h" // for Mouse, MouseProps +#define KALEIDOSCOPE_HID_DRIVER_KEYBOARDIOHID + namespace kaleidoscope { namespace driver { namespace hid { diff --git a/src/kaleidoscope/layers.h b/src/kaleidoscope/layers.h index f970ed6218..c5073f8e2f 100644 --- a/src/kaleidoscope/layers.h +++ b/src/kaleidoscope/layers.h @@ -56,6 +56,7 @@ __NL__ \ _INIT_SKETCH_EXPLORATION __NL__ \ _INIT_HID_GETSHORTNAME + // TODO(jesse): re-enable GETSHORTNAME once we figure out how to do that for non-keyboardiohid devices // Macro for defining the keymap. This should be used in the sketch // file (*.ino) to define the keymap[] array that holds the user's diff --git a/src/kaleidoscope_internal/shortname.h b/src/kaleidoscope_internal/shortname.h index 80f6fa88f0..649149f7bf 100644 --- a/src/kaleidoscope_internal/shortname.h +++ b/src/kaleidoscope_internal/shortname.h @@ -30,9 +30,14 @@ #ifndef _INIT_HID_GETSHORTNAME -#define _INIT_HID_GETSHORTNAME __NL__ \ + #ifdef KALEIDOSCOPE_HID_DRIVER_KEYBOARDIOHID + + #define _INIT_HID_GETSHORTNAME __NL__ \ uint8_t HID_::getShortName(char *name) { __NL__ \ return Kaleidoscope.device().getShortName(name); __NL__ \ } + #else + #define _INIT_HID_GETSHORTNAME + #endif #endif