Merge pull request #54 from algernon/f/keymap/auto-size

Introduce a helper macro to compute the keymap size
pull/55/head
Jesse Vincent 8 years ago committed by GitHub
commit 06d38a1bda

@ -19,7 +19,6 @@
uint8_t primary_keymap = 0; uint8_t primary_keymap = 0;
uint8_t temporary_keymap = 0; uint8_t temporary_keymap = 0;
#define KEYMAPS 3
#define NUMPAD_KEYMAP 2 #define NUMPAD_KEYMAP 2
#define KEYMAP_LIST KEYMAP_QWERTY KEYMAP_GENERIC_FN2 KEYMAP_NUMPAD #define KEYMAP_LIST KEYMAP_QWERTY KEYMAP_GENERIC_FN2 KEYMAP_NUMPAD
@ -42,7 +41,7 @@ static LEDChaseEffect chaseEffect;
static LEDNumlock numLockEffect (NUMPAD_KEYMAP); static LEDNumlock numLockEffect (NUMPAD_KEYMAP);
void setup() { void setup() {
Keyboardio.setup(KEYMAPS); Keyboardio.setup(KEYMAP_SIZE);
bootAnimation(); bootAnimation();
} }

@ -33,6 +33,8 @@ extern uint8_t temporary_keymap;
#define VERSION "locally-built" #define VERSION "locally-built"
#endif #endif
#define KEYMAP_SIZE (sizeof(keymaps) / ROWS / COLS / sizeof(Key))
class Keyboardio_ { class Keyboardio_ {
public: public:
Keyboardio_(void); Keyboardio_(void);

Loading…
Cancel
Save