Modifiers cleanup

- asdf_modifiers.[ch]: Replace asdf_modifier_shiftlock_activate() with
  asdf_modifier_shiftlock_on_activate() and
  asdf_modifier_shiftlock_toggle_activate().  Instead of a configurateion
  setting for shiftlock state to switch between SHIFTLOCK locks on, SHIFT turns
  off, vs SHIFTLOCK toggles, and SHIFT turns off, create two different
  SHIFTLOCK functions, one for each behavior, and allow the keymap to bind the
  desired function.

- asdf.h: replace ACTION_SHIFTLOCK with ACTION_SHIFTLOCK_ON and
  ACTION_SHIFTLOCK_TOGGLE.

- asdf.h: move start of ACTION codes from 0x80 to 0x90, since SOL-20 uses codes
  from 0x80-0x8f.

- asdf.c: test for ACTION code using (code > ASDF_ACTION) instead of (code &
  ASDF_ACTION), since ASDF_ACTION need not be a power of 2.

- asdf_modifiers.[ch] and other files: remove
  asdf_modifiers_shiftlock_deactivate() and
  asdf_modifiers_capslock_deactivate(), and any references to these functions
  since they are null functions anyway.
This commit is contained in:
Dave 2020-03-14 00:11:29 -05:00
parent aeaac665af
commit ed761974e6
8 changed files with 63 additions and 156 deletions

View File

@ -66,7 +66,7 @@
{ ACTION_NOTHING, ASCII_COMMA, 'm', 'n', 'b', 'v', 'c', 'x' }, \
{ ACTION_NOTHING, 'k', 'j', 'h', 'g', 'f', 'd', 's' }, \
{ ACTION_NOTHING, 'i', 'u', 'y', 't', 'r', 'e', 'w' }, \
/**/ { ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFT_LOCK, ASCII_CR, ASCII_LF, 'o', \
/**/ { ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFTLOCK_ON, ASCII_CR, ASCII_LF, 'o', \
'l', ASCII_PERIOD }, \
{ ASCII_TILDE, ASCII_RT_SQUARE_BRACE, ASCII_LT_SQUARE_BRACE, '-', ':', '0', '9', '8' }, \
{ ACTION_NOTHING, '7', '6', '5', '4', '3', '2', '1' }, ASDF_TEST_MAP_DIP_SWITCHES \
@ -80,7 +80,7 @@
{ ACTION_NOTHING, ASCII_COMMA, 'M', 'N', 'B', 'V', 'C', 'X' }, \
{ ACTION_NOTHING, 'K', 'J', 'H', 'G', 'F', 'D', 'S' }, \
{ ACTION_NOTHING, 'I', 'U', 'Y', 'T', 'R', 'E', 'W' }, \
/**/ { ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFT_LOCK, ASCII_CR, ASCII_LF, 'O', \
/**/ { ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFTLOCK_ON, ASCII_CR, ASCII_LF, 'O', \
'L', ASCII_PERIOD }, \
{ ASCII_TILDE, ASCII_RT_SQUARE_BRACE, ASCII_LT_SQUARE_BRACE, '-', ':', '0', '9', '8' }, \
{ ACTION_NOTHING, '7', '6', '5', '4', '3', '2', '1' }, ASDF_TEST_MAP_DIP_SWITCHES \
@ -95,7 +95,7 @@
{ ACTION_NOTHING, '>', 'M', 'N', 'B', 'V', 'C', 'X' }, \
{ ACTION_NOTHING, 'K', 'J', 'H', 'G', 'F', 'D', 'S' }, \
{ ACTION_NOTHING, 'I', 'U', 'Y', 'T', 'R', 'E', 'W' }, \
{ ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFT_LOCK, ASCII_CR, ASCII_LF, 'O', 'L', '<' }, \
{ ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFTLOCK_ON, ASCII_CR, ASCII_LF, 'O', 'L', '<' }, \
{ ASCII_TILDE, ASCII_RT_CURLY_BRACE, ASCII_LT_CURLY_BRACE, '=', '*', \
'0', ASCII_RT_PAREN, ASCII_LT_PAREN }, \
{ ACTION_NOTHING, ASCII_SINGLE_QUOTE, '&', '%', '$', '#', ASCII_DOUBLE_QUOTE, '!' }, \
@ -115,7 +115,7 @@
ASCII_CTRL_G, ASCII_CTRL_F, ASCII_CTRL_D, ASCII_CTRL_S }, \
{ ACTION_NOTHING, ASCII_CTRL_I, ASCII_CTRL_U, ASCII_CTRL_Y, \
ASCII_CTRL_T, ASCII_CTRL_R, ASCII_CTRL_E, ASCII_CTRL_W }, \
{ ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFT_LOCK, ASCII_CR, \
{ ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFTLOCK_ON, ASCII_CR, \
ASCII_LF, ASCII_CTRL_O, ASCII_CTRL_L, ACTION_NOTHING }, \
{ ACTION_NOTHING, 0x1d, ASCII_ESC, ACTION_NOTHING, \
ACTION_NOTHING, ACTION_FN_1, ACTION_FN_9, ACTION_FN_8 }, \

View File

@ -67,7 +67,7 @@
{ ACTION_NOTHING, ASCII_COMMA, 'm', 'n', 'b', 'v', 'c', 'x' }, \
{ ACTION_NOTHING, 'k', 'j', 'h', 'g', 'f', 'd', 's' }, \
{ ACTION_NOTHING, 'i', 'u', 'y', 't', 'r', 'e', 'w' }, \
/**/ { ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFT_LOCK, ASCII_CR, ASCII_LF, 'o', \
/**/ { ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFTLOCK_ON, ASCII_CR, ASCII_LF, 'o', \
'l', ASCII_PERIOD }, \
{ ASCII_TILDE, ASCII_RT_SQUARE_BRACE, ASCII_LT_SQUARE_BRACE, '-', ':', '0', '9', '8' }, \
{ ACTION_NOTHING, '7', '6', '5', '4', '3', '2', '1' }, ASDF_TEST_MAP_DIP_SWITCHES \
@ -81,7 +81,7 @@
{ ACTION_NOTHING, ASCII_COMMA, 'M', 'N', 'B', 'V', 'C', 'X' }, \
{ ACTION_NOTHING, 'K', 'J', 'H', 'G', 'F', 'D', 'S' }, \
{ ACTION_NOTHING, 'I', 'U', 'Y', 'T', 'R', 'E', 'W' }, \
/**/ { ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFT_LOCK, ASCII_CR, ASCII_LF, 'O', \
/**/ { ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFTLOCK_ON, ASCII_CR, ASCII_LF, 'O', \
'L', ASCII_PERIOD }, \
{ ASCII_TILDE, ASCII_RT_SQUARE_BRACE, ASCII_LT_SQUARE_BRACE, '-', ':', '0', '9', '8' }, \
{ ACTION_NOTHING, '7', '6', '5', '4', '3', '2', '1' }, ASDF_TEST_MAP_DIP_SWITCHES \
@ -96,7 +96,7 @@
{ ACTION_NOTHING, '>', 'M', 'N', 'B', 'V', 'C', 'X' }, \
{ ACTION_NOTHING, 'K', 'J', 'H', 'G', 'F', 'D', 'S' }, \
{ ACTION_NOTHING, 'I', 'U', 'Y', 'T', 'R', 'E', 'W' }, \
{ ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFT_LOCK, ASCII_CR, ASCII_LF, 'O', 'L', '<' }, \
{ ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFTLOCK_ON, ASCII_CR, ASCII_LF, 'O', 'L', '<' }, \
{ ASCII_TILDE, ASCII_RT_CURLY_BRACE, ASCII_LT_CURLY_BRACE, '=', '*', \
'0', ASCII_RT_PAREN, ASCII_LT_PAREN }, \
{ ACTION_NOTHING, ASCII_SINGLE_QUOTE, '&', '%', '$', '#', ASCII_DOUBLE_QUOTE, '!' }, \
@ -116,7 +116,7 @@
ASCII_CTRL_G, ASCII_CTRL_F, ASCII_CTRL_D, ASCII_CTRL_S }, \
{ ACTION_NOTHING, ASCII_CTRL_I, ASCII_CTRL_U, ASCII_CTRL_Y, \
ASCII_CTRL_T, ASCII_CTRL_R, ASCII_CTRL_E, ASCII_CTRL_W }, \
{ ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFT_LOCK, ASCII_CR, \
{ ACTION_REPEAT, ACTION_HERE_IS, ACTION_SHIFTLOCK_ON, ASCII_CR, \
ASCII_LF, ASCII_CTRL_O, ASCII_CTRL_L, ACTION_NOTHING }, \
{ ACTION_NOTHING, 0x1d, ASCII_ESC, ACTION_NOTHING, \
ACTION_NOTHING, ACTION_FN_1, ACTION_FN_9, ACTION_FN_8 }, \

View File

@ -152,8 +152,12 @@ static void asdf_activate_action(action_t keycode)
asdf_modifier_shift_activate();
break;
}
case ACTION_SHIFT_LOCK: {
asdf_modifier_shiftlock_activate();
case ACTION_SHIFTLOCK_ON: {
asdf_modifier_shiftlock_on_activate();
break;
}
case ACTION_SHIFTLOCK_TOGGLE: {
asdf_modifier_shiftlock_toggle_activate();
break;
}
case ACTION_CAPS: {
@ -261,15 +265,6 @@ static void asdf_deactivate_action(action_t keycode)
asdf_modifier_shift_deactivate();
break;
}
case ACTION_SHIFT_LOCK: {
asdf_modifier_shiftlock_deactivate();
break;
}
case ACTION_CAPS: {
asdf_modifier_capslock_deactivate();
break;
}
case ACTION_CTRL: {
asdf_modifier_ctrl_deactivate();
break;
@ -317,7 +312,7 @@ static void asdf_deactivate_action(action_t keycode)
//
static void asdf_activate_key(asdf_keycode_t keycode)
{
if (keycode & ASDF_ACTION) {
if (keycode > ASDF_ACTION) { // ASDF_ACTION = ASDF_NOTHING = no action.
asdf_activate_action((action_t) keycode);
}
else {

View File

@ -24,7 +24,7 @@
#if !defined(ASDF_H)
#define ASDF_H
#define ASDF_ACTION 0x80
#define ASDF_ACTION 0x90 // SOL-20 uses codes 0x80-0x8f
#define ASDF_INVALID_CODE ASDF_ACTION
// an action code is not a valid keycode.
@ -41,7 +41,8 @@ typedef uint8_t asdf_keycode_t;
typedef enum {
ACTION_NOTHING = ASDF_ACTION,
ACTION_SHIFT,
ACTION_SHIFT_LOCK,
ACTION_SHIFTLOCK_ON,
ACTION_SHIFTLOCK_TOGGLE,
ACTION_CAPS,
ACTION_CTRL,
ACTION_REPEAT,

View File

@ -34,8 +34,6 @@ static shift_state_t shift_state;
static caps_state_t caps_state;
static ctrl_state_t ctrl_state;
static shiftlock_mode_t asdf_toggle_shiftlock;
static const modifier_index_t modifier_indices[] = {
MOD_PLAIN_MAP, // 0x00: no modifiers
@ -59,11 +57,8 @@ static const modifier_index_t modifier_indices[] = {
//
void asdf_modifier_set_shift_state(uint8_t new_state)
{
uint8_t shiftlock_status = new_state & SHIFT_LOCKED_ST;
shift_state = new_state;
asdf_virtual_action(VSHIFT_LED, (shiftlock_status ? V_SET_HI : V_SET_LO));
asdf_virtual_action(VSHIFT_LED, (shift_state ? V_SET_HI : V_SET_LO));
}
// PROCEDURE: asdf_modifier_shift_activate
@ -82,37 +77,38 @@ void asdf_modifier_shift_activate(void)
}
// PROCEDURE: asdf_modifier_shiftlock_activate
// PROCEDURE: asdf_modifier_shiftlock_on_activate
// INPUTS: none
// OUTPUTS: none
//
// DESCRIPTION: sets SHIFTLOCK state depending on the mode.
// DESCRIPTION: sets SHIFTLOCK state to ON
//
// SHIFTLOCK normal mode:
// - SHIFTLOCK always activates shift mode
// - Pressing and Relasing SHIFT deactivates shift mode.
//
// SHIFTLOCK toggle mode:
// - Pressing SHIFTLOCK toggles the shift mode on and off
// - Pressing and Relasing SHIFT deactivates shift mode.
//
// NOTES: The test of the shiftlock mode constant always has the same result and
// will therefore be optimized by the compiler, so technically no added
// cyclometric complexity, but count it anyway, in case this is made into a
// user-definable behavior later.
// NOTES:
//
// SIDE EFFECTS: affects shift_state as described.
//
// COMPLEXITY: 2
// COMPLEXITY: 1
//
void asdf_modifier_shiftlock_activate(void)
void asdf_modifier_shiftlock_on_activate(void)
{
if (asdf_toggle_shiftlock) {
asdf_modifier_set_shift_state(shift_state ^ SHIFT_LOCKED_ST);
}
else {
asdf_modifier_set_shift_state(shift_state | SHIFT_LOCKED_ST);
}
asdf_modifier_set_shift_state(shift_state | SHIFT_LOCKED_ST);
}
// PROCEDURE: asdf_modifier_shiftlock_toggle_activate
// INPUTS: none
// OUTPUTS: none
//
// DESCRIPTION: Toggles SHIFTLOCK state.
//
// NOTES:
//
// SIDE EFFECTS: see DESCRIPTION
//
// COMPLEXITY: 1
//
void asdf_modifier_shiftlock_toggle_activate(void)
{
asdf_modifier_set_shift_state(shift_state ^ SHIFT_LOCKED_ST);
}
// PROCEDURE: asdf_modifier_set_caps_state
@ -193,32 +189,6 @@ void asdf_modifier_ctrl_deactivate(void)
ctrl_state = CTRL_OFF_ST;
}
// PROCEDURE: asdf_modifier_shiftlock_deactivate
// INPUTS: none
// OUTPUTS: none
//
// DESCRIPTION: Does nothing. This is called when releasing the SHIFT LOCK key,
// and no action is performed on releasing a SHIFT LOCK key
//
// SIDE EFFECTS: none
//
// COMPLEXITY: 1
//
void asdf_modifier_shiftlock_deactivate(void) {}
// PROCEDURE: asdf_modifier_capslock_deactivate
// INPUTS: none
// OUTPUTS: none
//
// DESCRIPTION: Does nothing. This is called when releasing the CAPS LOCK key,
// and no action is performed on releasing the CAPS LOCK key.
//
// SIDE EFFECTS: none
//
// COMPLEXITY: 1
//
void asdf_modifier_capslock_deactivate(void) {}
// PROCEDURE: asdf_modifiers_init
// INPUTS: none
// OUTPUTS: none
@ -234,8 +204,6 @@ void asdf_modifiers_init(void)
asdf_modifier_set_shift_state(SHIFT_OFF_ST);
asdf_modifier_set_caps_state(CAPS_OFF_ST);
ctrl_state = CTRL_OFF_ST;
asdf_toggle_shiftlock = HOLD_SHIFTLOCK;
}
// PROCEDURE: asdf_modifier_index

View File

@ -56,9 +56,6 @@ typedef enum {
ASDF_MOD_NUM_MODIFIERS
} modifier_index_t;
typedef enum { TOGGLE_SHIFTLOCK = 0, HOLD_SHIFTLOCK = 1 } shiftlock_mode_t;
// PROCEDURE: asdf_modifier_shift_activate
// INPUTS: none
// OUTPUTS: none
@ -66,12 +63,17 @@ typedef enum { TOGGLE_SHIFTLOCK = 0, HOLD_SHIFTLOCK = 1 } shiftlock_mode_t;
//
void asdf_modifier_shift_activate(void);
// PROCEDURE: asdf_modifier_shiftlock_activate
// PROCEDURE: asdf_modifier_shiftlock_on_activate
// INPUTS: none
// OUTPUTS: none
// DESCRIPTION: sets SHIFTLOCK state if in NORMAL mode, and toggle shiftlock if in TOGGLE mode.
//
void asdf_modifier_shiftlock_activate(void);
// DESCRIPTION: sets SHIFTLOCK state to ON
void asdf_modifier_shiftlock_on_activate(void);
// PROCEDURE: asdf_modifier_shiftlock_toggle_activate
// INPUTS: none
// OUTPUTS: none
// DESCRIPTION: Toggles SHIFTLOCK state.
void asdf_modifier_shiftlock_toggle_activate(void);
// PROCEDURE: asdf_modifier_capslock_activate
// INPUTS: none
@ -80,12 +82,6 @@ void asdf_modifier_shiftlock_activate(void);
//
void asdf_modifier_capslock_activate(void);
// PROCEDURE: asdf_modifier_caps_activate
// INPUTS: none
// OUTPUTS: none
// DESCRIPTION: sets CAPS state to ON (without disturbing the caps lock state)
void asdf_modifier_caps_activate(void);
// PROCEDURE: asdf_modifier_ctrl_activate
// INPUTS: none
// OUTPUTS: none
@ -107,26 +103,6 @@ void asdf_modifier_shift_deactivate(void);
//
void asdf_modifier_ctrl_deactivate(void);
// PROCEDURE: asdf_modifier_shiftlock_deactivate
// INPUTS: none
// OUTPUTS: none
// DESCRIPTION: No action. This is called when releasing the SHIFT LOCK key,
//
void asdf_modifier_shiftlock_deactivate(void);
// PROCEDURE: asdf_modifier_capslock_deactivate
// INPUTS: none
// OUTPUTS: none
// DESCRIPTION: No action. Called when releasing the CAPS LOCK key.
//
void asdf_modifier_capslock_deactivate(void);
// PROCEDURE: asdf_modifier_caps_deactivate
// INPUTS: none
// OUTPUTS: none
// DESCRIPTION: sets CAPS state to OFF (without disturbing the caps lock state)
void asdf_modifier_caps_deactivate(void);
// PROCEDURE: asdf_modifiers_init
// INPUTS: none
// OUTPUTS: none

View File

@ -54,7 +54,6 @@ void capslock_and_release_gives_caps(void)
asdf_modifier_capslock_activate();
TESTMAP(MOD_CAPS_MAP);
asdf_modifier_capslock_deactivate();
TESTMAP(MOD_CAPS_MAP);
}
@ -64,9 +63,6 @@ void caps_release_caps_gives_plain(void)
asdf_modifier_capslock_activate();
TESTMAP(MOD_CAPS_MAP);
asdf_modifier_capslock_deactivate();
TESTMAP(MOD_CAPS_MAP);
asdf_modifier_capslock_activate();
TESTMAP(MOD_PLAIN_MAP);
}
@ -78,14 +74,8 @@ void caps_release_caps_release_gives_plain(void)
asdf_modifier_capslock_activate();
TESTMAP(MOD_CAPS_MAP);
asdf_modifier_capslock_deactivate();
TESTMAP(MOD_CAPS_MAP);
asdf_modifier_capslock_activate();
TESTMAP(MOD_PLAIN_MAP);
asdf_modifier_capslock_deactivate();
TESTMAP(MOD_PLAIN_MAP);
}
// If SHIFT and CAPS are activated, the SHIFT map results
@ -94,9 +84,6 @@ void shift_and_caps_gives_shift(void)
asdf_modifier_capslock_activate();
TESTMAP(MOD_CAPS_MAP);
asdf_modifier_capslock_deactivate();
TESTMAP(MOD_CAPS_MAP);
asdf_modifier_shift_activate();
TESTMAP(MOD_SHIFT_MAP);
}
@ -107,9 +94,6 @@ void caps_shift_unshift_gives_caps(void)
asdf_modifier_capslock_activate();
TESTMAP(MOD_CAPS_MAP);
asdf_modifier_capslock_deactivate();
TESTMAP(MOD_CAPS_MAP);
asdf_modifier_shift_activate();
TESTMAP(MOD_SHIFT_MAP);
@ -121,11 +105,9 @@ void caps_shift_unshift_gives_caps(void)
void capslock_shiftlock_gives_shift(void)
{
asdf_modifier_capslock_activate();
asdf_modifier_capslock_deactivate();
TESTMAP(MOD_CAPS_MAP);
asdf_modifier_shiftlock_activate();
asdf_modifier_shiftlock_deactivate();
asdf_modifier_shiftlock_on_activate();
TESTMAP(MOD_SHIFT_MAP);
}
@ -133,15 +115,12 @@ void capslock_shiftlock_gives_shift(void)
void capslock_shiftlock_capslock_gives_shift(void)
{
asdf_modifier_capslock_activate();
asdf_modifier_capslock_deactivate();
TESTMAP(MOD_CAPS_MAP);
asdf_modifier_shiftlock_activate();
asdf_modifier_shiftlock_deactivate();
asdf_modifier_shiftlock_on_activate();
TESTMAP(MOD_SHIFT_MAP);
asdf_modifier_capslock_activate();
asdf_modifier_capslock_deactivate();
TESTMAP(MOD_SHIFT_MAP);
}
@ -150,11 +129,9 @@ void capslock_shiftlock_capslock_gives_shift(void)
void capslock_shiftlock_shift_gives_caps(void)
{
asdf_modifier_capslock_activate();
asdf_modifier_capslock_deactivate();
TESTMAP(MOD_CAPS_MAP);
TESTMAP(MOD_CAPS_MAP);
asdf_modifier_shiftlock_activate();
asdf_modifier_shiftlock_deactivate();
asdf_modifier_shiftlock_on_activate();
TESTMAP(MOD_SHIFT_MAP);
asdf_modifier_shift_activate();
@ -165,15 +142,14 @@ void capslock_shiftlock_shift_gives_caps(void)
// SHIFTLOCK press gives shift map
void shiftlock_gives_shift(void)
{
asdf_modifier_shiftlock_activate();
asdf_modifier_shiftlock_on_activate();
TESTMAP(MOD_SHIFT_MAP);
}
// SHIFTLOCK press and release gives shift map
void shiftlock_and_release_gives_shift(void)
{
asdf_modifier_shiftlock_activate();
asdf_modifier_shiftlock_deactivate();
asdf_modifier_shiftlock_on_activate();
TESTMAP(MOD_SHIFT_MAP);
}
@ -181,8 +157,7 @@ void shiftlock_and_release_gives_shift(void)
// SHIFTLOCK and SHIFT gives shift map
void shiftlock_shift_gives_shift(void)
{
asdf_modifier_shiftlock_activate();
asdf_modifier_shiftlock_deactivate();
asdf_modifier_shiftlock_on_activate();
TESTMAP(MOD_SHIFT_MAP);
asdf_modifier_shift_activate();
@ -192,8 +167,7 @@ void shiftlock_shift_gives_shift(void)
// SHIFTLOCK and SHIFT press and release gives plain map
void shiftlock_shift_release_gives_plain(void)
{
asdf_modifier_shiftlock_activate();
asdf_modifier_shiftlock_deactivate();
asdf_modifier_shiftlock_on_activate();
TESTMAP(MOD_SHIFT_MAP);
asdf_modifier_shift_activate();
@ -247,7 +221,7 @@ void ctrl_shiftlock_gives_ctrl_map(void)
asdf_modifier_ctrl_activate();
TESTMAP(MOD_CTRL_MAP);
asdf_modifier_shiftlock_activate();
asdf_modifier_shiftlock_on_activate();
TESTMAP(MOD_CTRL_MAP);
}
@ -257,11 +231,9 @@ void ctrl_double_caps_returns_to_ctrl_map(void)
TESTMAP(MOD_CTRL_MAP);
asdf_modifier_capslock_activate();
asdf_modifier_capslock_deactivate();
TESTMAP(MOD_CTRL_MAP);
asdf_modifier_capslock_activate();
asdf_modifier_capslock_deactivate();
TESTMAP(MOD_CTRL_MAP);
}
@ -270,12 +242,10 @@ void ctrl_double_shiftlock_returns_to_ctrl_map(void)
asdf_modifier_ctrl_activate();
TESTMAP(MOD_CTRL_MAP);
asdf_modifier_shiftlock_activate();
asdf_modifier_shiftlock_deactivate();
asdf_modifier_shiftlock_on_activate();
TESTMAP(MOD_CTRL_MAP);
asdf_modifier_shiftlock_activate();
asdf_modifier_shiftlock_deactivate();
asdf_modifier_shiftlock_on_activate();
TESTMAP(MOD_CTRL_MAP);
}

View File

@ -226,14 +226,12 @@ void test_virtual_capslock_indicator(void)
// emulate capslock press and release. Should set LED1
asdf_modifier_capslock_activate();
asdf_modifier_capslock_deactivate();
TEST_ASSERT_EQUAL_INT32(1, asdf_arch_check_output(PHYSICAL_LED1));
// emulate capslock press and release. clear LED1
asdf_modifier_capslock_activate();
asdf_modifier_capslock_deactivate();
TEST_ASSERT_EQUAL_INT32(0, asdf_arch_check_output(PHYSICAL_LED1));
}
@ -247,8 +245,7 @@ void test_virtual_shiftlock_indicator(void)
TEST_ASSERT_EQUAL_INT32(0, asdf_arch_check_output(PHYSICAL_LED2));
// emulate shiftlock press and release. Should set LED2
asdf_modifier_shiftlock_activate();
asdf_modifier_shiftlock_deactivate();
asdf_modifier_shiftlock_on_activate();
TEST_ASSERT_EQUAL_INT32(1, asdf_arch_check_output(PHYSICAL_LED2));