From 9cca6d62b043ee9b5f100713d4d111097d5f12d5 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 14 Nov 2023 21:49:43 -0800 Subject: [PATCH] fixup a slightly better getshortname override --- src/kaleidoscope/driver/hid/Keyboardio.h | 2 ++ src/kaleidoscope/layers.h | 2 +- src/kaleidoscope_internal/shortname.h | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) 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 5bb2c00753..c5073f8e2f 100644 --- a/src/kaleidoscope/layers.h +++ b/src/kaleidoscope/layers.h @@ -55,7 +55,7 @@ = sizeof(keymaps_linear) / sizeof(*keymaps_linear); __NL__ \ __NL__ \ _INIT_SKETCH_EXPLORATION __NL__ \ - // _INIT_HID_GETSHORTNAME + _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 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