summaryrefslogtreecommitdiff
path: root/tmk_core/common/action_layer.h
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/action_layer.h')
-rw-r--r--tmk_core/common/action_layer.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h
index 7fa30c86d6..a2734a29ee 100644
--- a/tmk_core/common/action_layer.h
+++ b/tmk_core/common/action_layer.h
@@ -21,12 +21,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "keyboard.h"
#include "action.h"
-#if defined(LAYER_STATE_8BIT) || ( defined(DYNAMIC_KEYMAP_ENABLE) && DYNAMIC_KEYMAP_LAYER_COUNT >= 8 )
+#if defined(LAYER_STATE_8BIT)
typedef uint8_t layer_state_t;
+#define get_highest_layer(state) biton8(state)
#elif defined(LAYER_STATE_16BIT)
typedef uint16_t layer_state_t;
+#define get_highest_layer(state) biton16(state)
#else
typedef uint32_t layer_state_t;
+#define get_highest_layer(state) biton32(state)
#endif