Move ActiveLayer back to keyboard_layout.c too
That is the only place we use it from, no need to expose it outside of that. Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
static uint8_t keyMasks[SLOT_COUNT][MAX_KEY_COUNT_PER_MODULE];
|
static uint8_t keyMasks[SLOT_COUNT][MAX_KEY_COUNT_PER_MODULE];
|
||||||
|
|
||||||
uint8_t ActiveLayer = LAYER_ID_BASE;
|
static uint8_t ActiveLayer = LAYER_ID_BASE;
|
||||||
uint8_t prevKeyStates[SLOT_COUNT][MAX_KEY_COUNT_PER_MODULE];
|
uint8_t prevKeyStates[SLOT_COUNT][MAX_KEY_COUNT_PER_MODULE];
|
||||||
|
|
||||||
static inline __attribute__((always_inline)) uhk_key_t getKeycode(uint8_t slotId, uint8_t keyId)
|
static inline __attribute__((always_inline)) uhk_key_t getKeycode(uint8_t slotId, uint8_t keyId)
|
||||||
@@ -77,7 +77,7 @@ bool handleKey(uhk_key_t key, int scancodeIdx, usb_keyboard_report_t *report, co
|
|||||||
break;
|
break;
|
||||||
case UHK_KEY_LAYER:
|
case UHK_KEY_LAYER:
|
||||||
if (key_toggled_on(prevKeyStates, currKeyStates, keyId)) {
|
if (key_toggled_on(prevKeyStates, currKeyStates, keyId)) {
|
||||||
ActiveLayer = layer;
|
ActiveLayer = key.layer.target;
|
||||||
}
|
}
|
||||||
if (key_toggled_off(prevKeyStates, currKeyStates, keyId)) {
|
if (key_toggled_off(prevKeyStates, currKeyStates, keyId)) {
|
||||||
ActiveLayer = LAYER_ID_BASE;
|
ActiveLayer = LAYER_ID_BASE;
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
#ifndef __LAYER_H__
|
#ifndef __LAYER_H__
|
||||||
#define __LAYER_H__
|
#define __LAYER_H__
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
// Macros:
|
// Macros:
|
||||||
|
|
||||||
#define LAYER_ID_BASE 0
|
#define LAYER_ID_BASE 0
|
||||||
@@ -12,6 +10,4 @@
|
|||||||
|
|
||||||
#define LAYER_COUNT 4
|
#define LAYER_COUNT 4
|
||||||
|
|
||||||
extern uint8_t ActiveLayer;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user