Add more unit tests for virtual layer

- use macros to designate which keymaps are used to setup the tests.
This commit is contained in:
David Fenyes 2020-03-11 01:50:27 -05:00
parent 23237fae88
commit 73e2760d94
5 changed files with 139 additions and 58 deletions

View File

@ -108,24 +108,6 @@ static pulse_state_t pulse_transition_table[PD_ST_NUM_VALID_PULSE_STATES][NUM_PU
static uint8_t outputs[NUM_REAL_OUTPUTS]; static uint8_t outputs[NUM_REAL_OUTPUTS];
static pulse_state_t pulses[NUM_REAL_OUTPUTS]; static pulse_state_t pulses[NUM_REAL_OUTPUTS];
// PROCEDURE: asdf_arch_null_output
// INPUTS: (uint8_t) value - ignored
// OUTPUTS: none
//
// DESCRIPTION: Does nothing.
//
// SIDE EFFECTS: See above.
//
// NOTES:
//
// SCOPE: public
//
// COMPLEXITY: 2
//
void asdf_arch_null_output(uint8_t value)
{
(void) value;
}
// PROCEDURE: pulse_detect // PROCEDURE: pulse_detect
// INPUTS: (pulse_state_t) current_state // INPUTS: (pulse_state_t) current_state
@ -179,6 +161,25 @@ static void set_output(asdf_virtual_real_dev_t output_dev, uint8_t value)
pulses[output_dev] = pulse_detect(pulses[output_dev], pulse_event); pulses[output_dev] = pulse_detect(pulses[output_dev], pulse_event);
} }
// PROCEDURE: asdf_arch_null_output
// INPUTS: (uint8_t) value - ignored
// OUTPUTS: none
//
// DESCRIPTION: Does nothing.
//
// SIDE EFFECTS: See above.
//
// NOTES:
//
// SCOPE: public
//
// COMPLEXITY: 2
//
void asdf_arch_null_output(uint8_t value)
{
set_output(VMAP_NO_OUT, value);
}
// PROCEDURE: asdf_arch_led1_set // PROCEDURE: asdf_arch_led1_set
// INPUTS: (uint8_t) value // INPUTS: (uint8_t) value

View File

@ -50,36 +50,60 @@
#define ASDF_ASCII_NUM_ROWS 16 // DIP switches are row 15. #define ASDF_ASCII_NUM_ROWS 16 // DIP switches are row 15.
#define ASDF_ASCII_NUM_COLS 8 #define ASDF_ASCII_NUM_COLS 8
#define ACTION_RESET ACTION_VOUT1
#define VIRTUAL_RESET VOUT1 #define VIRTUAL_RESET VOUT1
#define RESET_OUTPUT VMAP_OUT3_OC #define RESET_OUTPUT VMAP_OUT3_OC
#define RESET_ACTIVE_VALUE 0 #define RESET_ACTIVE_VALUE 0
#define ACTION_CLEAR ACTION_VOUT2
#define VIRTUAL_CLR_SCR VOUT2 #define VIRTUAL_CLR_SCR VOUT2
#define CLR_SCR_OUT VMAP_OUT1 #define CLR_SCR_OUTPUT VMAP_OUT1
#define CLR_SCR_ACTIVE_VALUE 1 #define CLR_SCR_ACTIVE_VALUE 1
#define VIRTUAL_POWER_LED VLED1 #define VIRTUAL_POWER_LED VLED1
#define POWER_LED VMAP_LED1 #define POWER_LED VMAP_LED1
#define POWER_LED_INIT_VALUE 1 #define POWER_LED_INIT_VALUE 1
#define ASDF_APPLE2_KEYMAP_INITIALIZER_LENGTH 4 #define ASDF_APPLE2_KEYMAP_INITIALIZER_LENGTH 3
#define ASDF_APPLE2_KEYMAP_INITIALIZER \
// The PLAIN map uses the "power" button as a caps-lock, so map the CAPS LED to
// the power button LED.
#define ASDF_APPLE2_PLAIN_KEYMAP_INITIALIZER \
{ \
{ .virtual_device = VCAPS_LED, \
.real_device = POWER_LED, \
.initial_value = 0 }, \
{ .virtual_device = VIRTUAL_RESET, \
.real_device = RESET_OUTPUT, \
.function = V_PULSE, \
.initial_value = !RESET_ACTIVE_VALUE }, \
{ .virtual_device = VIRTUAL_CLR_SCR, \
.real_device = CLR_SCR_OUTPUT, \
.function = V_PULSE, \
.initial_value = !CLR_SCR_ACTIVE_VALUE } \
}
// The ALL CAPS map is the classic Apple II/II+ map.
#define ASDF_APPLE2_CAPS_KEYMAP_INITIALIZER \
{ \ { \
{ .virtual_device = VIRTUAL_POWER_LED, \ { .virtual_device = VIRTUAL_POWER_LED, \
.real_device = POWER_LED, \ .real_device = POWER_LED, \
.initial_value = POWER_LED_INIT_VALUE }, \ .initial_value = POWER_LED_INIT_VALUE }, \
{ .virtual_device = VCAPS_LED, \ { .virtual_device = VIRTUAL_RESET, \
.real_device = VMAP_LED3 }, \ .real_device = RESET_OUTPUT, \
{ .virtual_device = RESET_OUTPUT, \
.real_device = VMAP_OUT1, \
.function = V_PULSE, \ .function = V_PULSE, \
.initial_value = !CLR_SCR_ACTIVE_VALUE }, \ .initial_value = !RESET_ACTIVE_VALUE }, \
{ .virtual_device = CLR_SCR_OUT, \ { .virtual_device = VIRTUAL_CLR_SCR, \
.real_device = VMAP_OUT3, \ .real_device = CLR_SCR_OUTPUT, \
.function = V_PULSE, \ .function = V_PULSE, \
.initial_value = !RESET_ACTIVE_VALUE } \ .initial_value = !CLR_SCR_ACTIVE_VALUE } \
} }
#define ASDF_APPLE2_KEYMAP_INITIALIZER ASDF_APPLE2_PLAIN_KEYMAP_INITIALIZER, ASDF_APPLE2_CAPS_KEYMAP_INITIALIZER
// TO ensure consistent DIP switch operation within the keymap, a // TO ensure consistent DIP switch operation within the keymap, a
// ASDF_APPLE2_DIP_SWITCHES macro is defined. Keeping the ACTION_MAPSEL0-3 // ASDF_APPLE2_DIP_SWITCHES macro is defined. Keeping the ACTION_MAPSEL0-3
// definitions in positions 0-3 ensures consistent map selection among all // definitions in positions 0-3 ensures consistent map selection among all

View File

@ -51,24 +51,51 @@
#define POWER_LED VMAP_LED1 #define POWER_LED VMAP_LED1
#define POWER_LED_INIT_VALUE 1 #define POWER_LED_INIT_VALUE 1
#define CAPS_LED VMAP_LED3
#define CAPS_LED_INIT_VALUE 0
#define ASDF_ASCII_KEYMAP_INITIALIZER_LENGTH 4 #define ASDF_ASCII_KEYMAP_INITIALIZER_LENGTH 4
#define ASDF_ASCII_KEYMAP_INITIALIZER \
#define ASDF_ASCII_PLAIN_KEYMAP_INITIALIZER \
{ \ { \
{ .virtual_device = VIRTUAL_POWER_LED, \ { .virtual_device = VIRTUAL_POWER_LED, \
.real_device = POWER_LED, \ .real_device = POWER_LED, \
.initial_value = POWER_LED_INIT_VALUE }, \ .initial_value = POWER_LED_INIT_VALUE }, \
{ .virtual_device = VCAPS_LED, \ { .virtual_device = VCAPS_LED, \
.real_device = VMAP_LED3 }, \ .real_device = CAPS_LED, \
{ .virtual_device = RESET_OUTPUT, \ .initial_value = CAPS_LED_INIT_VALUE }, \
.real_device = VMAP_OUT1, \ { .virtual_device = VIRTUAL_RESET, \
.real_device = RESET_OUTPUT, \
.function = V_PULSE, \
.initial_value = !RESET_ACTIVE_VALUE }, \
{ .virtual_device = VIRTUAL_CLR_SCR, \
.real_device = CLR_SCR_OUT, \
.function = V_PULSE, \ .function = V_PULSE, \
.initial_value = !CLR_SCR_ACTIVE_VALUE }, \ .initial_value = !CLR_SCR_ACTIVE_VALUE }, \
{ .virtual_device = CLR_SCR_OUT, \
.real_device = VMAP_OUT3, \
.function = V_PULSE, \
.initial_value = !RESET_ACTIVE_VALUE } \
} }
#define ASDF_ASCII_CAPS_KEYMAP_INITIALIZER \
{ \
{ .virtual_device = VIRTUAL_POWER_LED, \
.real_device = POWER_LED, \
.initial_value = POWER_LED_INIT_VALUE }, \
{ .virtual_device = VCAPS_LED, \
.real_device = CAPS_LED, \
.initial_value = CAPS_LED_INIT_VALUE }, \
{ .virtual_device = VIRTUAL_RESET, \
.real_device = RESET_OUTPUT, \
.function = V_PULSE, \
.initial_value = !RESET_ACTIVE_VALUE }, \
{ .virtual_device = VIRTUAL_CLR_SCR, \
.real_device = CLR_SCR_OUT, \
.function = V_PULSE, \
.initial_value = !CLR_SCR_ACTIVE_VALUE }, \
}
#define ASDF_ASCII_KEYMAP_INITIALIZER ASDF_ASCII_PLAIN_KEYMAP_INITIALIZER, ASDF_ASCII_CAPS_KEYMAP_INITIALIZER
// TO ensure consistent DIP switch operation within the keymap, a // TO ensure consistent DIP switch operation within the keymap, a
// ASDF_ASCII_DIP_SWITCHES macro is defined. Keeping the ACTION_MAPSEL0-3 // ASDF_ASCII_DIP_SWITCHES macro is defined. Keeping the ACTION_MAPSEL0-3

View File

@ -65,7 +65,7 @@
{ ACTION_NOTHING, 'p', ';', '/', ASCII_SPACE, 'z', 'a', 'q' }, \ { ACTION_NOTHING, 'p', ';', '/', ASCII_SPACE, 'z', 'a', 'q' }, \
{ ACTION_BREAK, ASCII_COMMA, 'm', 'n', 'b', 'v', 'c', 'x' }, \ { ACTION_BREAK, ASCII_COMMA, 'm', 'n', 'b', 'v', 'c', 'x' }, \
{ ACTION_NOTHING, 'k', 'j', 'h', 'g', 'f', 'd', 's' }, \ { ACTION_NOTHING, 'k', 'j', 'h', 'g', 'f', 'd', 's' }, \
{ ACTION_CLEAR, 'i', 'u', 'y', 't', 'r', 'e', 'w' }, \ { 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_SHIFT_LOCK, ASCII_CR, ASCII_LF, 'o', \
'l', ASCII_PERIOD }, \ 'l', ASCII_PERIOD }, \
{ ASCII_TILDE, ASCII_RT_SQUARE_BRACE, ASCII_LT_SQUARE_BRACE, '-', ':', '0', '9', '8' }, \ { ASCII_TILDE, ASCII_RT_SQUARE_BRACE, ASCII_LT_SQUARE_BRACE, '-', ':', '0', '9', '8' }, \
@ -79,7 +79,7 @@
{ ACTION_NOTHING, 'P', ';', '/', ASCII_SPACE, 'Z', 'A', 'Q' }, \ { ACTION_NOTHING, 'P', ';', '/', ASCII_SPACE, 'Z', 'A', 'Q' }, \
{ ACTION_BREAK, ASCII_COMMA, 'M', 'N', 'B', 'V', 'C', 'X' }, \ { ACTION_BREAK, ASCII_COMMA, 'M', 'N', 'B', 'V', 'C', 'X' }, \
{ ACTION_NOTHING, 'K', 'J', 'H', 'G', 'F', 'D', 'S' }, \ { ACTION_NOTHING, 'K', 'J', 'H', 'G', 'F', 'D', 'S' }, \
{ ACTION_CLEAR, 'I', 'U', 'Y', 'T', 'R', 'E', 'W' }, \ { 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_SHIFT_LOCK, ASCII_CR, ASCII_LF, 'O', \
'L', ASCII_PERIOD }, \ 'L', ASCII_PERIOD }, \
{ ASCII_TILDE, ASCII_RT_SQUARE_BRACE, ASCII_LT_SQUARE_BRACE, '-', ':', '0', '9', '8' }, \ { ASCII_TILDE, ASCII_RT_SQUARE_BRACE, ASCII_LT_SQUARE_BRACE, '-', ':', '0', '9', '8' }, \
@ -94,7 +94,7 @@
{ ACTION_NOTHING, 'P', '+', '?', ASCII_SPACE, 'Z', 'A', 'Q' }, \ { ACTION_NOTHING, 'P', '+', '?', ASCII_SPACE, 'Z', 'A', 'Q' }, \
{ ACTION_BREAK, '>', 'M', 'N', 'B', 'V', 'C', 'X' }, \ { ACTION_BREAK, '>', 'M', 'N', 'B', 'V', 'C', 'X' }, \
{ ACTION_NOTHING, 'K', 'J', 'H', 'G', 'F', 'D', 'S' }, \ { ACTION_NOTHING, 'K', 'J', 'H', 'G', 'F', 'D', 'S' }, \
{ ACTION_CLEAR, 'I', 'U', 'Y', 'T', 'R', 'E', 'W' }, \ { 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_SHIFT_LOCK, ASCII_CR, ASCII_LF, 'O', 'L', '<' }, \
{ ASCII_TILDE, ASCII_RT_CURLY_BRACE, ASCII_LT_CURLY_BRACE, '=', '*', \ { ASCII_TILDE, ASCII_RT_CURLY_BRACE, ASCII_LT_CURLY_BRACE, '=', '*', \
'0', ASCII_RT_PAREN, ASCII_LT_PAREN }, \ '0', ASCII_RT_PAREN, ASCII_LT_PAREN }, \
@ -113,7 +113,7 @@
ASCII_CTRL_B, ASCII_CTRL_V, ASCII_CTRL_C, ASCII_CTRL_X }, \ ASCII_CTRL_B, ASCII_CTRL_V, ASCII_CTRL_C, ASCII_CTRL_X }, \
{ ACTION_NOTHING, ASCII_CTRL_K, ASCII_CTRL_J, ASCII_CTRL_H, \ { ACTION_NOTHING, ASCII_CTRL_K, ASCII_CTRL_J, ASCII_CTRL_H, \
ASCII_CTRL_G, ASCII_CTRL_F, ASCII_CTRL_D, ASCII_CTRL_S }, \ ASCII_CTRL_G, ASCII_CTRL_F, ASCII_CTRL_D, ASCII_CTRL_S }, \
{ ACTION_CLEAR, ASCII_CTRL_I, ASCII_CTRL_U, ASCII_CTRL_Y, \ { ACTION_NOTHING, ASCII_CTRL_I, ASCII_CTRL_U, ASCII_CTRL_Y, \
ASCII_CTRL_T, ASCII_CTRL_R, ASCII_CTRL_E, ASCII_CTRL_W }, \ 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_SHIFT_LOCK, ASCII_CR, \
ASCII_LF, ASCII_CTRL_O, ASCII_CTRL_L, ACTION_NOTHING }, \ ASCII_LF, ASCII_CTRL_O, ASCII_CTRL_L, ACTION_NOTHING }, \
@ -147,7 +147,12 @@
#define ASDF_TEST_PLAIN_MAP_INDEX ASDF_TEST_BASE + 0 #define ASDF_TEST_PLAIN_MAP_INDEX ASDF_TEST_BASE + 0
#define ASDF_TEST_CAPS_MAP_INDEX ASDF_TEST_BASE + 1 #define ASDF_TEST_CAPS_MAP_INDEX ASDF_TEST_BASE + 1
#define ASDF_TEST_KEYMAP_INITIALIZER_LENGTH 3 #define SINGLE_TESTS_KEYMAP ASDF_TEST_PLAIN_MAP_INDEX
#define DOUBLE_ASSIGN_TEST_KEYMAP ASDF_TEST_PLAIN_MAP_INDEX
#define TRIPLE_TESTS_KEYMAP ASDF_TEST_CAPS_MAP_INDEX
#define ASDF_TEST_KEYMAP_INITIALIZER_LENGTH 5
#define ASDF_TEST_KEYMAP_INITIALIZER_1 \ #define ASDF_TEST_KEYMAP_INITIALIZER_1 \
{ \ { \
{ \ { \
@ -171,7 +176,16 @@
.function = V_PULSE, \ .function = V_PULSE, \
.initial_value = 0, \ .initial_value = 0, \
}, \ }, \
{ /* first of double assignment attempt */ \
.virtual_device = VOUT4, \
.real_device = VMAP_LED1, \
.initial_value = 0 \
}, \
{ /* second of double assignment attempt */ \
.virtual_device = VOUT5, .real_device = VMAP_LED1, .initial_value = 1 \
} \
} }
#define ASDF_TEST_KEYMAP_INITIALIZER_2 \ #define ASDF_TEST_KEYMAP_INITIALIZER_2 \
{ \ { \
{ \ { \

View File

@ -66,7 +66,7 @@
{ ACTION_NOTHING, 'p', ';', '/', ASCII_SPACE, 'z', 'a', 'q' }, \ { ACTION_NOTHING, 'p', ';', '/', ASCII_SPACE, 'z', 'a', 'q' }, \
{ ACTION_BREAK, ASCII_COMMA, 'm', 'n', 'b', 'v', 'c', 'x' }, \ { ACTION_BREAK, ASCII_COMMA, 'm', 'n', 'b', 'v', 'c', 'x' }, \
{ ACTION_NOTHING, 'k', 'j', 'h', 'g', 'f', 'd', 's' }, \ { ACTION_NOTHING, 'k', 'j', 'h', 'g', 'f', 'd', 's' }, \
{ ACTION_CLEAR, 'i', 'u', 'y', 't', 'r', 'e', 'w' }, \ { 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_SHIFT_LOCK, ASCII_CR, ASCII_LF, 'o', \
'l', ASCII_PERIOD }, \ 'l', ASCII_PERIOD }, \
{ ASCII_TILDE, ASCII_RT_SQUARE_BRACE, ASCII_LT_SQUARE_BRACE, '-', ':', '0', '9', '8' }, \ { ASCII_TILDE, ASCII_RT_SQUARE_BRACE, ASCII_LT_SQUARE_BRACE, '-', ':', '0', '9', '8' }, \
@ -80,7 +80,7 @@
{ ACTION_NOTHING, 'P', ';', '/', ASCII_SPACE, 'Z', 'A', 'Q' }, \ { ACTION_NOTHING, 'P', ';', '/', ASCII_SPACE, 'Z', 'A', 'Q' }, \
{ ACTION_BREAK, ASCII_COMMA, 'M', 'N', 'B', 'V', 'C', 'X' }, \ { ACTION_BREAK, ASCII_COMMA, 'M', 'N', 'B', 'V', 'C', 'X' }, \
{ ACTION_NOTHING, 'K', 'J', 'H', 'G', 'F', 'D', 'S' }, \ { ACTION_NOTHING, 'K', 'J', 'H', 'G', 'F', 'D', 'S' }, \
{ ACTION_CLEAR, 'I', 'U', 'Y', 'T', 'R', 'E', 'W' }, \ { 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_SHIFT_LOCK, ASCII_CR, ASCII_LF, 'O', \
'L', ASCII_PERIOD }, \ 'L', ASCII_PERIOD }, \
{ ASCII_TILDE, ASCII_RT_SQUARE_BRACE, ASCII_LT_SQUARE_BRACE, '-', ':', '0', '9', '8' }, \ { ASCII_TILDE, ASCII_RT_SQUARE_BRACE, ASCII_LT_SQUARE_BRACE, '-', ':', '0', '9', '8' }, \
@ -95,7 +95,7 @@
{ ACTION_NOTHING, 'P', '+', '?', ASCII_SPACE, 'Z', 'A', 'Q' }, \ { ACTION_NOTHING, 'P', '+', '?', ASCII_SPACE, 'Z', 'A', 'Q' }, \
{ ACTION_BREAK, '>', 'M', 'N', 'B', 'V', 'C', 'X' }, \ { ACTION_BREAK, '>', 'M', 'N', 'B', 'V', 'C', 'X' }, \
{ ACTION_NOTHING, 'K', 'J', 'H', 'G', 'F', 'D', 'S' }, \ { ACTION_NOTHING, 'K', 'J', 'H', 'G', 'F', 'D', 'S' }, \
{ ACTION_CLEAR, 'I', 'U', 'Y', 'T', 'R', 'E', 'W' }, \ { 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_SHIFT_LOCK, ASCII_CR, ASCII_LF, 'O', 'L', '<' }, \
{ ASCII_TILDE, ASCII_RT_CURLY_BRACE, ASCII_LT_CURLY_BRACE, '=', '*', \ { ASCII_TILDE, ASCII_RT_CURLY_BRACE, ASCII_LT_CURLY_BRACE, '=', '*', \
'0', ASCII_RT_PAREN, ASCII_LT_PAREN }, \ '0', ASCII_RT_PAREN, ASCII_LT_PAREN }, \
@ -114,7 +114,7 @@
ASCII_CTRL_B, ASCII_CTRL_V, ASCII_CTRL_C, ASCII_CTRL_X }, \ ASCII_CTRL_B, ASCII_CTRL_V, ASCII_CTRL_C, ASCII_CTRL_X }, \
{ ACTION_NOTHING, ASCII_CTRL_K, ASCII_CTRL_J, ASCII_CTRL_H, \ { ACTION_NOTHING, ASCII_CTRL_K, ASCII_CTRL_J, ASCII_CTRL_H, \
ASCII_CTRL_G, ASCII_CTRL_F, ASCII_CTRL_D, ASCII_CTRL_S }, \ ASCII_CTRL_G, ASCII_CTRL_F, ASCII_CTRL_D, ASCII_CTRL_S }, \
{ ACTION_CLEAR, ASCII_CTRL_I, ASCII_CTRL_U, ASCII_CTRL_Y, \ { ACTION_NOTHING, ASCII_CTRL_I, ASCII_CTRL_U, ASCII_CTRL_Y, \
ASCII_CTRL_T, ASCII_CTRL_R, ASCII_CTRL_E, ASCII_CTRL_W }, \ 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_SHIFT_LOCK, ASCII_CR, \
ASCII_LF, ASCII_CTRL_O, ASCII_CTRL_L, ACTION_NOTHING }, \ ASCII_LF, ASCII_CTRL_O, ASCII_CTRL_L, ACTION_NOTHING }, \
@ -148,17 +148,32 @@
#define ASDF_TEST2_PLAIN_MAP_INDEX (ASDF_TEST2_BASE + 0) #define ASDF_TEST2_PLAIN_MAP_INDEX (ASDF_TEST2_BASE + 0)
#define ASDF_TEST2_CAPS_MAP_INDEX (ASDF_TEST2_BASE + 1) #define ASDF_TEST2_CAPS_MAP_INDEX (ASDF_TEST2_BASE + 1)
#define VCAPS_TEST_KEYMAP ASDF_TEST2_PLAIN_MAP_INDEX
#define VSHIFT_TEST_KEYMAP ASDF_TEST2_PLAIN_MAP_INDEX
#define ASDF_TEST2_KEYMAP_INITIALIZER_LENGTH 4 #define ASDF_TEST2_KEYMAP_INITIALIZER_LENGTH 4
#define ASDF_TEST2_KEYMAP_INITIALIZER \ #define ASDF_TEST2_KEYMAP_INITIALIZER_1 \
{ \ { \
{ .virtual_device = VCAPS_LED, .real_device = VMAP_LED2, .initial_value = 1 }, \ { .virtual_device = VCAPS_LED, .real_device = VMAP_LED1, .initial_value = 0 }, \
{ .virtual_device = VOUT1, .real_device = VMAP_OUT2, .initial_value = 1 }, \ { .virtual_device = VSHIFT_LED, .real_device = VMAP_LED2, .initial_value = 0 }, \
{ .virtual_device = VOUT2, .real_device = VMAP_OUT3, .initial_value = 0 }, \ { .virtual_device = VOUT2, .real_device = VMAP_OUT3, .initial_value = 0 }, \
{ \ { \
.virtual_device = VOUT2, .real_device = NUM_REAL_OUTPUTS, .initial_value = 0 \ .virtual_device = VOUT2, .real_device = NUM_REAL_OUTPUTS, .initial_value = 0 \
} \ } \
} }
#define ASDF_TEST2_KEYMAP_INITIALIZER_2 \
{ \
{ .virtual_device = VCAPS_LED, .real_device = VMAP_LED1, .initial_value = 0 }, \
{ .virtual_device = VSHIFT_LED, .real_device = VMAP_LED2, .initial_value = 0 }, \
{ .virtual_device = VOUT2, .real_device = VMAP_OUT3, .initial_value = 0 }, \
{ \
.virtual_device = VOUT2, .real_device = NUM_REAL_OUTPUTS, .initial_value = 0 \
} \
}
#define ASDF_TEST2_KEYMAP_INITIALIZER \
ASDF_TEST2_KEYMAP_INITIALIZER_1, ASDF_TEST2_KEYMAP_INITIALIZER_2
// The following preprocessor "code" permits various keymaps to be created and // The following preprocessor "code" permits various keymaps to be created and
// included without generating a lot of complicating code dependencies. The use // included without generating a lot of complicating code dependencies. The use