mirror of
https://github.com/osiweb/unified_retro_keyboard.git
synced 2024-11-22 04:33:19 +00:00
Add DIP switch select for strobe polarity and autorepeat
- arch-* files: replace private arch_strobe_init() function with public arch_set_neg_strobe() and arch_set_pos_strobe() functions - asdf.c,h: add ACTION hooks to set strobe polarity and enable/disable autorepeat - break out DIP switch definitions into a separate header file, included by each keymap. This ensures consistent DIP switch behavior across keymaps.
This commit is contained in:
parent
8828d90d96
commit
7801a17f56
@ -49,10 +49,6 @@ static volatile uint8_t tick = 0;
|
||||
// data polarity may be changed with a DIP switch, so we use a static instead of a constant
|
||||
static uint8_t data_polarity = ASDF_DEFAULT_DATA_POLARITY;
|
||||
|
||||
// strobe polarity may be changed with a DIP switch, so we use a static instead of a constant
|
||||
static uint8_t strobe_polarity = ASDF_DEFAULT_STROBE_POLARITY;
|
||||
|
||||
|
||||
// PROCEDURE: ISR for Timer 0 overflow
|
||||
// INPUTS: none
|
||||
// OUTPUTS:none
|
||||
@ -554,7 +550,26 @@ void asdf_arch_out3_open_lo_set(uint8_t value)
|
||||
}
|
||||
}
|
||||
|
||||
// PROCEDURE: asdf_arch_init_strobe
|
||||
// PROCEDURE: asdf_arch_pos_strobe
|
||||
// INPUTS: none
|
||||
// OUTPUTS: none
|
||||
//
|
||||
// DESCRIPTION: Initialize strobe output to positive polarity. Initial state is
|
||||
// LOW
|
||||
//
|
||||
// SIDE EFFECTS: See DESCRIPTION
|
||||
//
|
||||
// SCOPE: public
|
||||
//
|
||||
// COMPLEXITY: 1
|
||||
//
|
||||
void asdf_arch_set_pos_strobe(void)
|
||||
{
|
||||
clear_bit(&ASDF_STROBE_PORT, ASDF_STROBE_BIT);
|
||||
set_bit(&ASDF_STROBE_DDR, ASDF_STROBE_BIT);
|
||||
}
|
||||
|
||||
// PROCEDURE: asdf_arch_neg_strobe
|
||||
// INPUTS: none
|
||||
// OUTPUTS: none
|
||||
//
|
||||
@ -566,14 +581,9 @@ void asdf_arch_out3_open_lo_set(uint8_t value)
|
||||
//
|
||||
// COMPLEXITY: 1
|
||||
//
|
||||
static void asdf_arch_init_strobe(void)
|
||||
void asdf_arch_set_neg_strobe(void)
|
||||
{
|
||||
if (strobe_polarity == ASDF_POSITIVE_POLARITY) {
|
||||
clear_bit(&ASDF_STROBE_PORT, ASDF_STROBE_BIT);
|
||||
}
|
||||
else {
|
||||
set_bit(&ASDF_STROBE_PORT, ASDF_STROBE_BIT);
|
||||
}
|
||||
set_bit(&ASDF_STROBE_PORT, ASDF_STROBE_BIT);
|
||||
set_bit(&ASDF_STROBE_DDR, ASDF_STROBE_BIT);
|
||||
}
|
||||
|
||||
@ -636,7 +646,8 @@ static void asdf_arch_init_row_outputs(void)
|
||||
// INPUTS: none
|
||||
// OUTPUTS: none
|
||||
//
|
||||
// DESCRIPTION: Delays a fixed amount of time for keyboard output pulses specified by ASDF_PULSE_DELAY_SHORT_US
|
||||
// DESCRIPTION: Delays a fixed amount of time for keyboard output pulses specified by
|
||||
// ASDF_PULSE_DELAY_SHORT_US
|
||||
//
|
||||
// SIDE EFFECTS: see above.
|
||||
//
|
||||
@ -655,7 +666,8 @@ void asdf_arch_pulse_delay_short(void)
|
||||
// INPUTS: none
|
||||
// OUTPUTS: none
|
||||
//
|
||||
// DESCRIPTION: Delays a fixed amount of time for keyboard output pulses specified by ASDF_PULSE_DELAY_LONG_MS
|
||||
// DESCRIPTION: Delays a fixed amount of time for keyboard output pulses specified by
|
||||
// ASDF_PULSE_DELAY_LONG_MS
|
||||
//
|
||||
// SIDE EFFECTS: see above.
|
||||
//
|
||||
@ -697,11 +709,15 @@ void asdf_arch_init(void)
|
||||
// set up ASCII output port
|
||||
asdf_arch_init_ascii_output();
|
||||
|
||||
// initialize keyboard data and strobe to positive polairy
|
||||
// initialize keyboard data polarity and strobe polarity
|
||||
data_polarity = ASDF_DEFAULT_DATA_POLARITY;
|
||||
strobe_polarity = ASDF_DEFAULT_STROBE_POLARITY;
|
||||
|
||||
asdf_arch_init_strobe();
|
||||
if (ASDF_DEFAULT_STROBE_POLARITY == ASDF_POSITIVE_POLARITY) {
|
||||
asdf_arch_set_pos_strobe();
|
||||
} else {
|
||||
asdf_arch_set_neg_strobe();
|
||||
}
|
||||
|
||||
asdf_arch_init_leds();
|
||||
|
||||
// set up row and column ports
|
||||
@ -774,7 +790,8 @@ asdf_cols_t asdf_arch_osi_read_row(uint8_t row)
|
||||
|
||||
if (row > 7) {
|
||||
cols = asdf_arch_read_row(row);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// enable the OSI keyboard
|
||||
clear_bit(&ASDF_OSI_KBE_PORT, ASDF_OSI_KBE_BIT);
|
||||
|
||||
@ -791,7 +808,7 @@ asdf_cols_t asdf_arch_osi_read_row(uint8_t row)
|
||||
|
||||
ASDF_LOROW_PORT = row & 0xff;
|
||||
|
||||
cols = (asdf_cols_t) ASDF_COLUMNS_PORT;
|
||||
cols = (asdf_cols_t) ASDF_COLUMNS_PORT;
|
||||
}
|
||||
return cols;
|
||||
}
|
||||
|
@ -357,6 +357,21 @@
|
||||
// DIP switch is on row 8
|
||||
#define ASDF_ARCH_DIPSWITCH_ROW 8
|
||||
|
||||
|
||||
// PROCEDURE: asdf_arch_pos_strobe
|
||||
// INPUTS: none
|
||||
// OUTPUTS: none
|
||||
// DESCRIPTION: Initialize strobe output to positive polarity. Initial state is
|
||||
// LOW
|
||||
void asdf_arch_set_pos_strobe(void);
|
||||
|
||||
// PROCEDURE: asdf_arch_neg_strobe
|
||||
// INPUTS: none
|
||||
// OUTPUTS: none
|
||||
// DESCRIPTION: Initialize strobe output
|
||||
void asdf_arch_set_neg_strobe(void);
|
||||
|
||||
|
||||
// PROCEDURE: asdf_arch_null_output
|
||||
// INPUTS: (uint8_t) value - ignored
|
||||
// OUTPUTS: none
|
||||
|
@ -45,7 +45,6 @@
|
||||
static volatile uint8_t tick = 0;
|
||||
|
||||
static uint8_t data_polarity = ASDF_DEFAULT_DATA_POLARITY;
|
||||
static uint8_t strobe_polarity = ASDF_DEFAULT_STROBE_POLARITY;
|
||||
|
||||
|
||||
// PROCEDURE: ISR for Timer 0 overflow
|
||||
@ -536,7 +535,26 @@ void asdf_arch_out3_open_lo_set(uint8_t value)
|
||||
}
|
||||
}
|
||||
|
||||
// PROCEDURE: asdf_arch_init_strobe
|
||||
// PROCEDURE: asdf_arch_pos_strobe
|
||||
// INPUTS: none
|
||||
// OUTPUTS: none
|
||||
//
|
||||
// DESCRIPTION: Initialize strobe output to positive polarity. Initial state is
|
||||
// LOW
|
||||
//
|
||||
// SIDE EFFECTS: See DESCRIPTION
|
||||
//
|
||||
// SCOPE: public
|
||||
//
|
||||
// COMPLEXITY: 1
|
||||
//
|
||||
void asdf_arch_set_pos_strobe(void)
|
||||
{
|
||||
clear_bit(&ASDF_STROBE_PORT, ASDF_STROBE_BIT);
|
||||
set_bit(&ASDF_STROBE_DDR, ASDF_STROBE_BIT);
|
||||
}
|
||||
|
||||
// PROCEDURE: asdf_arch_neg_strobe
|
||||
// INPUTS: none
|
||||
// OUTPUTS: none
|
||||
//
|
||||
@ -548,14 +566,9 @@ void asdf_arch_out3_open_lo_set(uint8_t value)
|
||||
//
|
||||
// COMPLEXITY: 1
|
||||
//
|
||||
static void asdf_arch_init_strobe(void)
|
||||
void asdf_arch_set_neg_strobe(void)
|
||||
{
|
||||
if (strobe_polarity == ASDF_POSITIVE_POLARITY) {
|
||||
clear_bit(&ASDF_STROBE_PORT, ASDF_STROBE_BIT);
|
||||
}
|
||||
else {
|
||||
set_bit(&ASDF_STROBE_PORT, ASDF_STROBE_BIT);
|
||||
}
|
||||
set_bit(&ASDF_STROBE_PORT, ASDF_STROBE_BIT);
|
||||
set_bit(&ASDF_STROBE_DDR, ASDF_STROBE_BIT);
|
||||
}
|
||||
|
||||
@ -691,11 +704,17 @@ void asdf_arch_init(void)
|
||||
// set up ASCII output port
|
||||
asdf_arch_init_ascii_output();
|
||||
|
||||
// initialize keyboard data and strobe to positive polairy
|
||||
// initialize keyboard data polarity and strobe polarity
|
||||
data_polarity = ASDF_DEFAULT_DATA_POLARITY;
|
||||
strobe_polarity = ASDF_DEFAULT_STROBE_POLARITY;
|
||||
|
||||
asdf_arch_init_strobe();
|
||||
if (ASDF_DEFAULT_STROBE_POLARITY == ASDF_POSITIVE_POLARITY) {
|
||||
asdf_arch_set_pos_strobe();
|
||||
} else {
|
||||
asdf_arch_set_neg_strobe();
|
||||
}
|
||||
|
||||
asdf_arch_init_leds();
|
||||
|
||||
asdf_arch_init_leds();
|
||||
|
||||
// set up row output port
|
||||
|
@ -262,6 +262,19 @@
|
||||
// DIP switch is on row 8
|
||||
#define ASDF_ARCH_DIPSWITCH_ROW 8
|
||||
|
||||
// PROCEDURE: asdf_arch_pos_strobe
|
||||
// INPUTS: none
|
||||
// OUTPUTS: none
|
||||
// DESCRIPTION: Initialize strobe output to positive polarity. Initial state is
|
||||
// LOW
|
||||
void asdf_arch_set_pos_strobe(void);
|
||||
|
||||
// PROCEDURE: asdf_arch_neg_strobe
|
||||
// INPUTS: none
|
||||
// OUTPUTS: none
|
||||
// DESCRIPTION: Initialize strobe output
|
||||
void asdf_arch_set_neg_strobe(void);
|
||||
|
||||
// PROCEDURE: asdf_arch_null_output
|
||||
// INPUTS: (uint8_t) value - ignored
|
||||
// OUTPUTS: none
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include "Keymaps/asdf_keymap_defs_apple2.h"
|
||||
#include "Keymaps/asdf_keymap_defs_sol.h"
|
||||
|
||||
#define ASDF_NUM_KEYMAPS \
|
||||
#define ASDF_NUM_KEYMAPS \
|
||||
(ASDF_ASCII_ALL_MAPS_COUNT + ASDF_APPLE2_ALL_MAPS_COUNT + ASDF_SOL_ALL_MAPS_COUNT)
|
||||
|
||||
#define ASDF_KEYMAP_DEFS \
|
||||
|
@ -39,6 +39,9 @@
|
||||
#if !defined(ASDF_KEYMAP_DEFS_APPLE2_H)
|
||||
#define ASDF_KEYMAP_DEFS_APPLE2_H
|
||||
|
||||
// include DIP switch definitions
|
||||
#include "asdf_keymap_defs_dipswitch.h"
|
||||
|
||||
// Edit the number of rows and columns used in this map. If the number is less
|
||||
// than the maxium, the unused elements will be initialized to 0.
|
||||
|
||||
@ -151,8 +154,7 @@
|
||||
// definitions in positions 0-3 ensures consistent map selection among all
|
||||
// keymaps.
|
||||
|
||||
#define ASDF_APPLE2_DIP_SWITCHES \
|
||||
[ASDF_ARCH_DIPSWITCH_ROW] = { ACTION_MAPSEL_0, ACTION_MAPSEL_1, ACTION_MAPSEL_2, ACTION_MAPSEL_3 }
|
||||
#define ASDF_APPLE2_DIP_SWITCHES ASDF_KEYMAP_DIP_SWITCHES
|
||||
|
||||
#define APPLE_LEFT_ARROW ASCII_CTRL_H
|
||||
#define APPLE_RIGHT_ARROW ASCII_CTRL_U
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Unfified Keyboard Project
|
||||
// ASDF keyboard firmware
|
||||
//
|
||||
// asdf_keymaps_ascii.h
|
||||
// asdf_keymaps_ascii.h
|
||||
//
|
||||
// Ascii keymaps
|
||||
//
|
||||
@ -31,6 +31,9 @@
|
||||
#if !defined(ASDF_KEYMAP_DEFS_ASCII_H)
|
||||
#define ASDF_KEYMAP_DEFS_ASCII_H
|
||||
|
||||
// include DIP switch definitions
|
||||
#include "asdf_keymap_defs_dipswitch.h"
|
||||
|
||||
// Edit the number of rows and columns used in this map. If the number is less
|
||||
// than the maxium, the unused elements will be initialized to 0.
|
||||
|
||||
@ -57,57 +60,62 @@
|
||||
#define ASCII_CAPS_LED_INIT_VALUE 0
|
||||
|
||||
|
||||
|
||||
#define ASDF_ASCII_KEYMAP_INITIALIZER_LENGTH 4
|
||||
|
||||
#define ASDF_ASCII_PLAIN_KEYMAP_INITIALIZER \
|
||||
{ \
|
||||
{ .virtual_device = ASCII_VIRTUAL_POWER_LED, \
|
||||
.physical_device = ASCII_POWER_LED, \
|
||||
.initial_value = ASCII_POWER_LED_INIT_VALUE }, \
|
||||
{ .virtual_device = VCAPS_LED, \
|
||||
.physical_device = ASCII_CAPS_LED, \
|
||||
.initial_value = ASCII_CAPS_LED_INIT_VALUE }, \
|
||||
{ .virtual_device = ASCII_VIRTUAL_RESET, \
|
||||
.physical_device = ASCII_RESET_OUTPUT, \
|
||||
.function = V_PULSE_SHORT, \
|
||||
.initial_value = !ASCII_RESET_ACTIVE_VALUE }, \
|
||||
{ .virtual_device = ASCII_VIRTUAL_CLR_SCR, \
|
||||
.physical_device = ASCII_CLR_SCR_OUT, \
|
||||
.function = V_PULSE_LONG, \
|
||||
.initial_value = !ASCII_CLR_SCR_ACTIVE_VALUE }, \
|
||||
#define ASDF_ASCII_PLAIN_KEYMAP_INITIALIZER \
|
||||
{ \
|
||||
{ .virtual_device = ASCII_VIRTUAL_POWER_LED, \
|
||||
.physical_device = ASCII_POWER_LED, \
|
||||
.initial_value = ASCII_POWER_LED_INIT_VALUE }, \
|
||||
{ .virtual_device = VCAPS_LED, \
|
||||
.physical_device = ASCII_CAPS_LED, \
|
||||
.initial_value = ASCII_CAPS_LED_INIT_VALUE }, \
|
||||
{ .virtual_device = ASCII_VIRTUAL_RESET, \
|
||||
.physical_device = ASCII_RESET_OUTPUT, \
|
||||
.function = V_PULSE_SHORT, \
|
||||
.initial_value = !ASCII_RESET_ACTIVE_VALUE }, \
|
||||
{ .virtual_device = ASCII_VIRTUAL_CLR_SCR, \
|
||||
.physical_device = ASCII_CLR_SCR_OUT, \
|
||||
.function = V_PULSE_LONG, \
|
||||
.initial_value = !ASCII_CLR_SCR_ACTIVE_VALUE }, \
|
||||
}
|
||||
|
||||
// For the CAPS map, no LED is mapped to the CapsLock virtual LED, since
|
||||
// Capslock has no observable effect. The LED on the CAPSLOCK key is mapped to
|
||||
// an unused LED output, initialized to OFF, to ensure the LED is dark.
|
||||
#define ASDF_ASCII_CAPS_KEYMAP_INITIALIZER \
|
||||
{ \
|
||||
{ .virtual_device = ASCII_VIRTUAL_POWER_LED, \
|
||||
.physical_device = ASCII_POWER_LED, \
|
||||
.initial_value = ASCII_POWER_LED_INIT_VALUE }, \
|
||||
{ .virtual_device = VLED1, \
|
||||
.physical_device = ASCII_CAPS_LED, \
|
||||
.initial_value = ASCII_CAPS_LED_INIT_VALUE }, \
|
||||
{ .virtual_device = ASCII_VIRTUAL_RESET, \
|
||||
.physical_device = ASCII_RESET_OUTPUT, \
|
||||
.function = V_PULSE_SHORT, \
|
||||
.initial_value = !ASCII_RESET_ACTIVE_VALUE }, \
|
||||
{ .virtual_device = ASCII_VIRTUAL_CLR_SCR, \
|
||||
.physical_device = ASCII_CLR_SCR_OUT, \
|
||||
.function = V_PULSE_LONG, \
|
||||
.initial_value = !ASCII_CLR_SCR_ACTIVE_VALUE }, \
|
||||
#define ASDF_ASCII_CAPS_KEYMAP_INITIALIZER \
|
||||
{ \
|
||||
{ .virtual_device = ASCII_VIRTUAL_POWER_LED, \
|
||||
.physical_device = ASCII_POWER_LED, \
|
||||
.initial_value = ASCII_POWER_LED_INIT_VALUE }, \
|
||||
{ .virtual_device = VLED1, \
|
||||
.physical_device = ASCII_CAPS_LED, \
|
||||
.initial_value = ASCII_CAPS_LED_INIT_VALUE }, \
|
||||
{ .virtual_device = ASCII_VIRTUAL_RESET, \
|
||||
.physical_device = ASCII_RESET_OUTPUT, \
|
||||
.function = V_PULSE_SHORT, \
|
||||
.initial_value = !ASCII_RESET_ACTIVE_VALUE }, \
|
||||
{ .virtual_device = ASCII_VIRTUAL_CLR_SCR, \
|
||||
.physical_device = ASCII_CLR_SCR_OUT, \
|
||||
.function = V_PULSE_LONG, \
|
||||
.initial_value = !ASCII_CLR_SCR_ACTIVE_VALUE }, \
|
||||
}
|
||||
|
||||
|
||||
#define ASDF_ASCII_KEYMAP_INITIALIZER ASDF_ASCII_PLAIN_KEYMAP_INITIALIZER, ASDF_ASCII_CAPS_KEYMAP_INITIALIZER
|
||||
#define ASDF_ASCII_KEYMAP_INITIALIZER \
|
||||
ASDF_ASCII_PLAIN_KEYMAP_INITIALIZER, ASDF_ASCII_CAPS_KEYMAP_INITIALIZER
|
||||
|
||||
|
||||
// Structure to initialize hooks. No hook functions are needed for ASCII keyboard.
|
||||
#define ASDF_ASCII_KEYMAP_HOOK_INITIALIZER_LENGTH 0
|
||||
#define ASDF_ASCII_PLAIN_KEYMAP_HOOK_INITIALIZER {}
|
||||
#define ASDF_ASCII_CAPS_KEYMAP_HOOK_INITIALIZER {}
|
||||
#define ASDF_ASCII_KEYMAP_HOOK_INITIALIZER ASDF_ASCII_PLAIN_KEYMAP_HOOK_INITIALIZER, ASDF_ASCII_CAPS_KEYMAP_HOOK_INITIALIZER
|
||||
#define ASDF_ASCII_PLAIN_KEYMAP_HOOK_INITIALIZER \
|
||||
{ \
|
||||
}
|
||||
#define ASDF_ASCII_CAPS_KEYMAP_HOOK_INITIALIZER \
|
||||
{ \
|
||||
}
|
||||
#define ASDF_ASCII_KEYMAP_HOOK_INITIALIZER \
|
||||
ASDF_ASCII_PLAIN_KEYMAP_HOOK_INITIALIZER, ASDF_ASCII_CAPS_KEYMAP_HOOK_INITIALIZER
|
||||
|
||||
// Key Matrix for combination of ASCII controller and Classic ASCII matrix
|
||||
//
|
||||
@ -140,9 +148,7 @@
|
||||
// definitions in positions 0-3 ensures consistent map selection among all
|
||||
// keymaps.
|
||||
|
||||
|
||||
#define ASDF_ASCII_DIP_SWITCHES \
|
||||
[ASDF_ARCH_DIPSWITCH_ROW] = { ACTION_MAPSEL_0, ACTION_MAPSEL_1, ACTION_MAPSEL_2, ACTION_MAPSEL_3 }
|
||||
#define ASDF_ASCII_DIP_SWITCHES ASDF_KEYMAP_DIP_SWITCHES
|
||||
|
||||
// clang-format off
|
||||
#define ASDF_ASCII_PLAIN_MAP \
|
||||
@ -211,9 +217,9 @@
|
||||
// clang-format on
|
||||
|
||||
#define ASDF_ASCII_MAP_DECLARATIONS \
|
||||
static const FLASH keycode_matrix_t ascii_plain_matrix = ASDF_ASCII_PLAIN_MAP; \
|
||||
static const FLASH keycode_matrix_t ascii_shift_matrix = ASDF_ASCII_SHIFT_MAP; \
|
||||
static const FLASH keycode_matrix_t ascii_caps_matrix = ASDF_ASCII_CAPS_MAP; \
|
||||
static const FLASH keycode_matrix_t ascii_plain_matrix = ASDF_ASCII_PLAIN_MAP; \
|
||||
static const FLASH keycode_matrix_t ascii_shift_matrix = ASDF_ASCII_SHIFT_MAP; \
|
||||
static const FLASH keycode_matrix_t ascii_caps_matrix = ASDF_ASCII_CAPS_MAP; \
|
||||
static const FLASH keycode_matrix_t ascii_ctrl_matrix = ASDF_ASCII_CTRL_MAP;
|
||||
|
||||
|
||||
@ -228,20 +234,16 @@
|
||||
// [2]: caps (caps lock active)
|
||||
// [3]: ctrl: (control key active)
|
||||
|
||||
#define ASDF_ASCII_PLAIN_MAP_DEFS \
|
||||
{ \
|
||||
[MOD_PLAIN_MAP] = &ascii_plain_matrix, \
|
||||
[MOD_SHIFT_MAP] = &ascii_shift_matrix, \
|
||||
[MOD_CAPS_MAP] = &ascii_caps_matrix, \
|
||||
[MOD_CTRL_MAP] = &ascii_ctrl_matrix \
|
||||
#define ASDF_ASCII_PLAIN_MAP_DEFS \
|
||||
{ \
|
||||
[MOD_PLAIN_MAP] = &ascii_plain_matrix, [MOD_SHIFT_MAP] = &ascii_shift_matrix, \
|
||||
[MOD_CAPS_MAP] = &ascii_caps_matrix, [MOD_CTRL_MAP] = &ascii_ctrl_matrix \
|
||||
}
|
||||
|
||||
#define ASDF_ASCII_CAPS_MAP_DEFS \
|
||||
{ \
|
||||
[MOD_PLAIN_MAP] = &ascii_caps_matrix, \
|
||||
[MOD_SHIFT_MAP] = &ascii_shift_matrix, \
|
||||
[MOD_CAPS_MAP] = &ascii_caps_matrix, \
|
||||
[MOD_CTRL_MAP] = &ascii_ctrl_matrix \
|
||||
#define ASDF_ASCII_CAPS_MAP_DEFS \
|
||||
{ \
|
||||
[MOD_PLAIN_MAP] = &ascii_caps_matrix, [MOD_SHIFT_MAP] = &ascii_shift_matrix, \
|
||||
[MOD_CAPS_MAP] = &ascii_caps_matrix, [MOD_CTRL_MAP] = &ascii_ctrl_matrix \
|
||||
}
|
||||
|
||||
#define ASDF_ASCII_ALL_MAPS ASDF_ASCII_PLAIN_MAP_DEFS, ASDF_ASCII_CAPS_MAP_DEFS
|
||||
@ -258,12 +260,14 @@
|
||||
#define ASDF_NUM_COLS ASDF_ASCII_NUM_COLS
|
||||
#endif
|
||||
|
||||
#if !defined(ASDF_KEYMAP_INITIALIZER_LENGTH) || (ASDF_KEYMAP_INITIALIZER_LENGTH < ASDF_ASCII_KEYMAP_INITIALIZER_LENGTH)
|
||||
#if !defined(ASDF_KEYMAP_INITIALIZER_LENGTH) \
|
||||
|| (ASDF_KEYMAP_INITIALIZER_LENGTH < ASDF_ASCII_KEYMAP_INITIALIZER_LENGTH)
|
||||
#undef ASDF_KEYMAP_INITIALIZER_LENGTH
|
||||
#define ASDF_KEYMAP_INITIALIZER_LENGTH ASDF_ASCII_KEYMAP_INITIALIZER_LENGTH
|
||||
#endif
|
||||
|
||||
#if !defined(ASDF_KEYMAP_HOOK_INITIALIZER_LENGTH) || (ASDF_KEYMAP_HOOK_INITIALIZER_LENGTH < ASDF_ASCII_KEYMAP_HOOK_INITIALIZER_LENGTH)
|
||||
#if !defined(ASDF_KEYMAP_HOOK_INITIALIZER_LENGTH) \
|
||||
|| (ASDF_KEYMAP_HOOK_INITIALIZER_LENGTH < ASDF_ASCII_KEYMAP_HOOK_INITIALIZER_LENGTH)
|
||||
#undef ASDF_KEYMAP_HOOK_INITIALIZER_LENGTH
|
||||
#define ASDF_KEYMAP_HOOK_INITIALIZER_LENGTH ASDF_ASCII_KEYMAP_HOOK_INITIALIZER_LENGTH
|
||||
#endif
|
||||
@ -272,4 +276,3 @@
|
||||
|
||||
//-------|---------|---------+---------+---------+---------+---------+---------+
|
||||
// Above line is 80 columns, and should display completely in the editor.
|
||||
|
||||
|
@ -31,6 +31,9 @@
|
||||
#if !defined(ASDF_KEYMAP_DEFS_SOL20_H)
|
||||
#define ASDF_KEYMAP_DEFS_SOL20_H
|
||||
|
||||
// include DIP switch definitions
|
||||
#include "asdf_keymap_defs_dipswitch.h"
|
||||
|
||||
// Edit the number of rows and columns used in this map. If the number is less
|
||||
// than the maxium, the unused elements will be initialized to 0.
|
||||
|
||||
@ -117,7 +120,7 @@
|
||||
{ \
|
||||
{ .virtual_device = VCAPS_LED, \
|
||||
.physical_device = SOL_KBD_LED_UPPERCASE, \
|
||||
.initial_value = SOL_KBD_LED_OFF }, \
|
||||
.initial_value = SOL_KBD_LED_OFF }, \
|
||||
{ .virtual_device = VSHIFT_LED, \
|
||||
.physical_device = SOL_KBD_LED_SHIFTLOCK, \
|
||||
.initial_value = SOL_KBD_LED_OFF }, \
|
||||
@ -139,19 +142,21 @@
|
||||
.initial_value = SOL_KBD_TTL_HIGH }, \
|
||||
}
|
||||
|
||||
// function hooks for the SOL keyboard. At Setup, activate CAPSLOCK to emulate
|
||||
// original keyboard.
|
||||
#define ASDF_SOL_KEYMAP_HOOK_INITIALIZER_LENGTH 1
|
||||
// function hooks for the SOL keyboard:
|
||||
// - At Setup, activate CAPSLOCK to emulate original keyboard.
|
||||
// - At Setup, configure negative strobe
|
||||
#define ASDF_SOL_KEYMAP_HOOK_INITIALIZER_LENGTH 2
|
||||
#define ASDF_SOL_KEYMAP_HOOK_INITIALIZER \
|
||||
{ \
|
||||
{ \
|
||||
.hook_id = ASDF_HOOK_KEYMAP_SETUP, \
|
||||
{ .hook_id = ASDF_HOOK_KEYMAP_SETUP, \
|
||||
.hook_func = asdf_modifier_capslock_activate, \
|
||||
}, \
|
||||
{ .hook_id = ASDF_HOOK_KEYMAP_SETUP, \
|
||||
.hook_func = asdf_arch_set_neg_strobe, \
|
||||
}, \
|
||||
}
|
||||
|
||||
#define ASDF_SOL_DIP_SWITCHES \
|
||||
[ASDF_ARCH_DIPSWITCH_ROW] = { ACTION_MAPSEL_0, ACTION_MAPSEL_1, ACTION_MAPSEL_2, ACTION_MAPSEL_3 }
|
||||
#define ASDF_SOL_DIP_SWITCHES ASDF_KEYMAP_DIP_SWITCHES
|
||||
|
||||
// clang-format off
|
||||
#define ASDF_SOL_PLAIN_MAP \
|
||||
|
@ -191,6 +191,14 @@ static void asdf_activate_action(action_t keycode)
|
||||
asdf_keymaps_map_select_3_set();
|
||||
break;
|
||||
}
|
||||
case ACTION_STROBE_POLARITY_SELECT: {
|
||||
asdf_arch_set_pos_strobe();
|
||||
break;
|
||||
}
|
||||
case ACTION_AUTOREPEAT_SELECT: {
|
||||
asdf_repeat_auto_on();
|
||||
break;
|
||||
}
|
||||
case ACTION_VLED1: {
|
||||
asdf_virtual_activate(VLED1);
|
||||
break;
|
||||
@ -292,6 +300,14 @@ static void asdf_deactivate_action(action_t keycode)
|
||||
asdf_keymaps_map_select_3_clear();
|
||||
break;
|
||||
}
|
||||
case ACTION_STROBE_POLARITY_SELECT: {
|
||||
asdf_arch_set_neg_strobe();
|
||||
break;
|
||||
}
|
||||
case ACTION_AUTOREPEAT_SELECT: {
|
||||
asdf_repeat_auto_off();
|
||||
break;
|
||||
}
|
||||
case ACTION_NOTHING:
|
||||
default: break;
|
||||
}
|
||||
@ -498,8 +514,7 @@ void asdf_keyscan(void)
|
||||
{
|
||||
asdf_hook_get(ASDF_HOOK_EACH_SCAN)();
|
||||
for (uint8_t row = 0; row < ASDF_NUM_ROWS; row++) {
|
||||
asdf_cols_t (*row_reader)(uint8_t) =
|
||||
(asdf_cols_t (*) (uint8_t)) asdf_hook_get(ASDF_HOOK_SCANNER);
|
||||
asdf_cols_t (*row_reader)(uint8_t) = (asdf_cols_t(*)(uint8_t)) asdf_hook_get(ASDF_HOOK_SCANNER);
|
||||
asdf_cols_t row_key_state = (*row_reader)(row);
|
||||
|
||||
asdf_cols_t changed = row_key_state ^ last_stable_key_state[row];
|
||||
|
@ -57,6 +57,8 @@ typedef enum {
|
||||
ACTION_MAPSEL_1,
|
||||
ACTION_MAPSEL_2,
|
||||
ACTION_MAPSEL_3,
|
||||
ACTION_AUTOREPEAT_SELECT,
|
||||
ACTION_STROBE_POLARITY_SELECT,
|
||||
ACTION_VLED1,
|
||||
ACTION_VLED2,
|
||||
ACTION_VLED3,
|
||||
|
Loading…
Reference in New Issue
Block a user