Skip to content

Commit

Permalink
fixup a slightly better getshortname override
Browse files Browse the repository at this point in the history
  • Loading branch information
obra committed Nov 15, 2023
1 parent 0ed0906 commit 9cca6d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/kaleidoscope/driver/hid/Keyboardio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/kaleidoscope/layers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/kaleidoscope_internal/shortname.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9cca6d6

Please sign in to comment.