mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-29 06:30:17 +00:00
make 'layer_state_set' visible to user code
This commit is contained in:
parent
3aec9a4354
commit
bad839e6ac
@ -73,7 +73,7 @@ uint32_t layer_state_set_kb(uint32_t state) {
|
|||||||
return layer_state_set_user(state);
|
return layer_state_set_user(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void layer_state_set(uint32_t state)
|
void layer_state_set(uint32_t state)
|
||||||
{
|
{
|
||||||
state = layer_state_set_kb(state);
|
state = layer_state_set_kb(state);
|
||||||
dprint("layer_state: ");
|
dprint("layer_state: ");
|
||||||
|
@ -49,10 +49,13 @@ void default_layer_xor(uint32_t state);
|
|||||||
*/
|
*/
|
||||||
#ifndef NO_ACTION_LAYER
|
#ifndef NO_ACTION_LAYER
|
||||||
extern uint32_t layer_state;
|
extern uint32_t layer_state;
|
||||||
void layer_debug(void);
|
|
||||||
void layer_clear(void);
|
void layer_state_set(uint32_t state);
|
||||||
bool layer_state_is(uint8_t layer);
|
bool layer_state_is(uint8_t layer);
|
||||||
bool layer_state_cmp(uint32_t layer1, uint8_t layer2);
|
bool layer_state_cmp(uint32_t layer1, uint8_t layer2);
|
||||||
|
|
||||||
|
void layer_debug(void);
|
||||||
|
void layer_clear(void);
|
||||||
void layer_move(uint8_t layer);
|
void layer_move(uint8_t layer);
|
||||||
void layer_on(uint8_t layer);
|
void layer_on(uint8_t layer);
|
||||||
void layer_off(uint8_t layer);
|
void layer_off(uint8_t layer);
|
||||||
@ -63,16 +66,20 @@ void layer_and(uint32_t state);
|
|||||||
void layer_xor(uint32_t state);
|
void layer_xor(uint32_t state);
|
||||||
#else
|
#else
|
||||||
#define layer_state 0
|
#define layer_state 0
|
||||||
|
|
||||||
|
#define layer_state_set(layer)
|
||||||
|
#define layer_state_is(layer) (layer == 0)
|
||||||
|
#define layer_state_cmp(state, layer) (state == 0 ? layer == 0 : (state & 1UL << layer) != 0)
|
||||||
|
|
||||||
|
#define layer_debug()
|
||||||
#define layer_clear()
|
#define layer_clear()
|
||||||
#define layer_move(layer)
|
#define layer_move(layer)
|
||||||
#define layer_on(layer)
|
#define layer_on(layer)
|
||||||
#define layer_off(layer)
|
#define layer_off(layer)
|
||||||
#define layer_invert(layer)
|
#define layer_invert(layer)
|
||||||
|
|
||||||
#define layer_or(state)
|
#define layer_or(state)
|
||||||
#define layer_and(state)
|
#define layer_and(state)
|
||||||
#define layer_xor(state)
|
#define layer_xor(state)
|
||||||
#define layer_debug()
|
|
||||||
|
|
||||||
__attribute__((weak))
|
__attribute__((weak))
|
||||||
uint32_t layer_state_set_user(uint32_t state);
|
uint32_t layer_state_set_user(uint32_t state);
|
||||||
|
Loading…
Reference in New Issue
Block a user