Merge remote-tracking branch 'tmk/master'
This commit is contained in:
commit
2ac00aa8a1
96 changed files with 15031 additions and 7760 deletions
|
|
@ -1,4 +0,0 @@
|
|||
TARGET = alps64_editor
|
||||
KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor
|
||||
KEYMAP = editor
|
||||
include Makefile
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -25,13 +25,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "timer.h"
|
||||
#include "matrix.h"
|
||||
|
||||
|
||||
#ifndef DEBOUNCE
|
||||
# define DEBOUNCE 5
|
||||
#endif
|
||||
static uint8_t debouncing = DEBOUNCE;
|
||||
static bool debouncing = false;
|
||||
static uint16_t debouncing_time = 0;
|
||||
|
||||
/* matrix state(1:on, 0:off) */
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
|
|
@ -70,26 +72,24 @@ uint8_t matrix_scan(void)
|
|||
{
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
select_row(i);
|
||||
_delay_us(30); // without this wait read unstable value.
|
||||
_delay_us(30); // delay for settling
|
||||
matrix_row_t cols = read_cols();
|
||||
if (matrix_debouncing[i] != cols) {
|
||||
matrix_debouncing[i] = cols;
|
||||
if (debouncing) {
|
||||
debug("bounce!: "); debug_hex(debouncing); debug("\n");
|
||||
dprintf("bounce: %d %d@%02X\n", timer_elapsed(debouncing_time), i, matrix_debouncing[i]^cols);
|
||||
}
|
||||
debouncing = DEBOUNCE;
|
||||
matrix_debouncing[i] = cols;
|
||||
debouncing = true;
|
||||
debouncing_time = timer_read();
|
||||
}
|
||||
unselect_rows();
|
||||
}
|
||||
|
||||
if (debouncing) {
|
||||
if (--debouncing) {
|
||||
_delay_ms(1);
|
||||
} else {
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = matrix_debouncing[i];
|
||||
}
|
||||
if (debouncing && timer_elapsed(debouncing_time) >= DEBOUNCE) {
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = matrix_debouncing[i];
|
||||
}
|
||||
debouncing = false;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "unimap_trans.h"
|
||||
|
||||
|
||||
#define AC_L1 ACTION_LAYER_TAP_KEY(1, KC_RGUI)
|
||||
|
||||
|
||||
#ifdef KEYMAP_SECTION_ENABLE
|
||||
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
|
||||
#else
|
||||
|
|
@ -41,14 +38,7 @@ const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
|
|||
[0] = UNIMAP_ALPS64( \
|
||||
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NUHS,BSPC, \
|
||||
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, \
|
||||
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \
|
||||
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \
|
||||
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT,ESC, \
|
||||
LCTL,LGUI,LALT, SPC, APP, RALT,L1, RCTL),
|
||||
|
||||
[1] = UNIMAP_ALPS64( \
|
||||
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \
|
||||
CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS, UP, TRNS, BSPC, \
|
||||
TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT, PENT, \
|
||||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN, TRNS,TRNS, \
|
||||
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
|
||||
LCTL,LALT,LGUI, SPC, RGUI,RALT,APP, RCTL),
|
||||
};
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -51,7 +51,7 @@ void matrix_init(void)
|
|||
|
||||
// LEDs on NumLock, CapsLock and ScrollLock(PB4, PB5, PB6)
|
||||
DDRB |= (1<<4) | (1<<5) | (1<<6);
|
||||
PORTB |= (1<<4) | (1<<5) | (1<<6);
|
||||
PORTB &= ~((1<<4) | (1<<5) | (1<<6));
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix0[i] = 0x00;
|
||||
|
|
|
|||
|
|
@ -25,13 +25,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "timer.h"
|
||||
#include "matrix.h"
|
||||
|
||||
|
||||
#ifndef DEBOUNCE
|
||||
# define DEBOUNCE 5
|
||||
#endif
|
||||
static uint8_t debouncing = DEBOUNCE;
|
||||
static bool debouncing = false;
|
||||
static uint16_t debouncing_time = 0;
|
||||
|
||||
|
||||
/* matrix state(1:on, 0:off) */
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
|
|
@ -60,26 +63,24 @@ uint8_t matrix_scan(void)
|
|||
{
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
select_row(i);
|
||||
_delay_us(30); // without this wait read unstable value.
|
||||
_delay_us(1); // delay for settling
|
||||
matrix_row_t cols = read_cols();
|
||||
if (matrix_debouncing[i] != cols) {
|
||||
matrix_debouncing[i] = cols;
|
||||
if (debouncing) {
|
||||
debug("bounce!: "); debug_hex(debouncing); debug("\n");
|
||||
dprintf("bounce: %d %d@%02X\n", timer_elapsed(debouncing_time), i, matrix_debouncing[i]^cols);
|
||||
}
|
||||
debouncing = DEBOUNCE;
|
||||
matrix_debouncing[i] = cols;
|
||||
debouncing = true;
|
||||
debouncing_time = timer_read();
|
||||
}
|
||||
unselect_rows();
|
||||
}
|
||||
|
||||
if (debouncing) {
|
||||
if (--debouncing) {
|
||||
_delay_ms(1);
|
||||
} else {
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = matrix_debouncing[i];
|
||||
}
|
||||
if (debouncing && timer_elapsed(debouncing_time) >= DEBOUNCE) {
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = matrix_debouncing[i];
|
||||
}
|
||||
debouncing = false;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue