summaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
Diffstat (limited to 'quantum')
-rw-r--r--quantum/config_common.h5
-rw-r--r--quantum/keymap_common.c14
-rw-r--r--quantum/keymap_extras/keymap_korean.h128
-rw-r--r--quantum/mcu_selection.mk15
-rw-r--r--quantum/quantum.c6
5 files changed, 163 insertions, 5 deletions
diff --git a/quantum/config_common.h b/quantum/config_common.h
index f981f3f8cb..9861c86780 100644
--- a/quantum/config_common.h
+++ b/quantum/config_common.h
@@ -21,7 +21,7 @@
#define ROW2COL 1
// useful for direct pin mapping
-#define NO_PIN (~0)
+#define NO_PIN (pin_t)(~0)
#ifdef __AVR__
# ifndef __ASSEMBLER__
@@ -63,6 +63,9 @@
# define PINB_ADDRESS 0x3
# define PINC_ADDRESS 0x6
# define PIND_ADDRESS 0x9
+# elif defined(__AVR_ATtiny85__)
+# define ADDRESS_BASE 0x10
+# define PINB_ADDRESS 0x6
# else
# error "Pins are not defined"
# endif
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c
index f34ba26e5a..570d4798de 100644
--- a/quantum/keymap_common.c
+++ b/quantum/keymap_common.c
@@ -51,17 +51,23 @@ action_t action_for_key(uint8_t layer, keypos_t key) {
action_t action = {};
uint8_t action_layer, when, mod;
+ (void)action_layer;
+ (void)when;
+ (void)mod;
+
switch (keycode) {
case KC_A ... KC_EXSEL:
case KC_LCTRL ... KC_RGUI:
action.code = ACTION_KEY(keycode);
break;
+#ifdef EXTRAKEY_ENABLE
case KC_SYSTEM_POWER ... KC_SYSTEM_WAKE:
action.code = ACTION_USAGE_SYSTEM(KEYCODE2SYSTEM(keycode));
break;
case KC_AUDIO_MUTE ... KC_BRIGHTNESS_DOWN:
action.code = ACTION_USAGE_CONSUMER(KEYCODE2CONSUMER(keycode));
break;
+#endif
#ifdef MOUSEKEY_ENABLE
case KC_MS_UP ... KC_MS_ACCEL2:
action.code = ACTION_MOUSEKEY(keycode);
@@ -93,6 +99,7 @@ action_t action_for_key(uint8_t layer, keypos_t key) {
action.code = ACTION_MACRO(keycode & 0xFF);
break;
#endif
+#ifndef NO_ACTION_LAYER
case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
action.code = ACTION_LAYER_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF);
break;
@@ -117,6 +124,8 @@ action_t action_for_key(uint8_t layer, keypos_t key) {
action_layer = keycode & 0xFF;
action.code = ACTION_LAYER_TOGGLE(action_layer);
break;
+#endif
+#ifndef NO_ACTION_ONESHOT
case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER_MAX:;
// OSL(action_layer) - One-shot action_layer
action_layer = keycode & 0xFF;
@@ -127,6 +136,8 @@ action_t action_for_key(uint8_t layer, keypos_t key) {
mod = mod_config(keycode & 0xFF);
action.code = ACTION_MODS_ONESHOT(mod);
break;
+#endif
+#ifndef NO_ACTION_LAYER
case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX:
action.code = ACTION_LAYER_TAP_TOGGLE(keycode & 0xFF);
break;
@@ -135,10 +146,13 @@ action_t action_for_key(uint8_t layer, keypos_t key) {
action_layer = (keycode >> 4) & 0xF;
action.code = ACTION_LAYER_MODS(action_layer, mod);
break;
+#endif
+#ifndef NO_ACTION_TAPPING
case QK_MOD_TAP ... QK_MOD_TAP_MAX:
mod = mod_config((keycode >> 0x8) & 0x1F);
action.code = ACTION_MODS_TAP_KEY(mod, keycode & 0xFF);
break;
+#endif
#ifdef SWAP_HANDS_ENABLE
case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX:
action.code = ACTION(ACT_SWAP_HANDS, keycode & 0xff);
diff --git a/quantum/keymap_extras/keymap_korean.h b/quantum/keymap_extras/keymap_korean.h
new file mode 100644
index 0000000000..da914767b8
--- /dev/null
+++ b/quantum/keymap_extras/keymap_korean.h
@@ -0,0 +1,128 @@
+/* Copyright 2020
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "keymap.h"
+
+// clang-format off
+
+/*
+ * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
+ * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │       │
+ * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
+ * │     │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │  ₩  │
+ * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤
+ * │      │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │        │
+ * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤
+ * │        │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │          │
+ * ├─────┬──┴┬──┴──┬┴──┬┴───┴───┴───┴──┬┴──┬┴───┴┬──┴┬───┬─────┤
+ * │     │   │     │Hnj│               │H↔Y│     │   │   │     │
+ * └─────┴───┴─────┴───┴───────────────┴───┴─────┴───┴───┴─────┘
+ */
+// Row 1
+#define KR_GRV KC_GRV // `
+#define KR_1 KC_1 // 1
+#define KR_2 KC_2 // 2
+#define KR_3 KC_3 // 3
+#define KR_4 KC_4 // 4
+#define KR_5 KC_5 // 5
+#define KR_6 KC_6 // 6
+#define KR_7 KC_7 // 7
+#define KR_8 KC_8 // 8
+#define KR_9 KC_9 // 9
+#define KR_0 KC_0 // 0
+#define KR_MINS KC_MINS // -
+#define KR_EQL KC_EQL // =
+// Row 2
+#define KR_Q KC_Q // Q
+#define KR_W KC_W // W
+#define KR_E KC_E // E
+#define KR_R KC_R // R
+#define KR_T KC_T // T
+#define KR_Y KC_Y // Y
+#define KR_U KC_U // U
+#define KR_I KC_I // I
+#define KR_O KC_O // O
+#define KR_P KC_P // P
+#define KR_LBRC KC_LBRC // [
+#define KR_RBRC KC_RBRC // ]
+#define KR_WON KC_BSLS // ₩
+// Row 3
+#define KR_A KC_A // A
+#define KR_S KC_S // S
+#define KR_D KC_D // D
+#define KR_F KC_F // F
+#define KR_G KC_G // G
+#define KR_H KC_H // H
+#define KR_J KC_J // J
+#define KR_K KC_K // K
+#define KR_L KC_L // L
+#define KR_SCLN KC_SCLN // ;
+#define KR_QUOT KC_QUOT // '
+// Row 4
+#define KR_Z KC_Z // Z
+#define KR_X KC_X // X
+#define KR_C KC_C // C
+#define KR_V KC_V // V
+#define KR_B KC_B // B
+#define KR_N KC_N // N
+#define KR_M KC_M // M
+#define KR_COMM KC_COMM // ,
+#define KR_DOT KC_DOT // .
+#define KR_SLSH KC_SLSH // /
+// Row 5
+#define KR_HANJ KC_LANG2 // Hanja (한자)
+#define KR_HAEN KC_LANG1 // Han ↔ Yeong (한 ↔ 영)
+
+/* Shifted symbols
+ * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
+ * │ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ( │ ) │ _ │ + │       │
+ * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
+ * │     │   │   │   │   │   │   │   │   │   │   │ { │ } │  |  │
+ * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤
+ * │      │   │   │   │   │   │   │   │   │   │ : │ " │        │
+ * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤
+ * │        │   │   │   │   │   │   │   │ < │ > │ ? │          │
+ * ├─────┬──┴┬──┴──┬┴──┬┴───┴───┴───┴──┬┴──┬┴───┴┬──┴┬───┬─────┤
+ * │     │   │     │   │               │   │     │   │   │     │
+ * └─────┴───┴─────┴───┴───────────────┴───┴─────┴───┴───┴─────┘
+ */
+// Row 1
+#define KR_TILD S(KR_GRV) // ~
+#define KR_EXLM S(KR_1) // !
+#define KR_AT S(KR_2) // @
+#define KR_HASH S(KR_3) // #
+#define KR_DLR S(KR_4) // $
+#define KR_PERC S(KR_5) // %
+#define KR_CIRC S(KR_6) // ^
+#define KR_AMPR S(KR_7) // &
+#define KR_ASTR S(KR_8) // *
+#define KR_LPRN S(KR_9) // (
+#define KR_RPRN S(KR_0) // )
+#define KR_UNDS S(KR_MINS) // _
+#define KR_PLUS S(KR_EQL) // +
+// Row 2
+#define KR_LCBR S(KR_LBRC) // {
+#define KR_RCBR S(KR_RBRC) // }
+#define KR_PIPE S(KR_WON) // |
+// Row 3
+#define KR_COLN S(KR_SCLN) // :
+#define KR_DQUO S(KR_COLN) // "
+// Row 4
+#define KR_LABK S(KR_COMM) // <
+#define KR_RABK S(KR_DOT) // >
+#define KR_QUES S(KR_SLSH) // ?
diff --git a/quantum/mcu_selection.mk b/quantum/mcu_selection.mk
index ef7e8ae75d..33de162bb1 100644
--- a/quantum/mcu_selection.mk
+++ b/quantum/mcu_selection.mk
@@ -287,3 +287,18 @@ ifneq (,$(filter $(MCU),atmega328p))
NO_UART ?= yes
NO_SUSPEND_POWER_DOWN ?= yes
endif
+
+ifneq (,$(filter $(MCU),attiny85))
+ PROTOCOL = VUSB
+
+ # Processor frequency.
+ # This will define a symbol, F_CPU, in all source code files equal to the
+ # processor frequency in Hz. You can then use this symbol in your source code to
+ # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+ # automatically to create a 32-bit value in your source code.
+ F_CPU ?= 16500000
+
+ # unsupported features for now
+ NO_UART ?= yes
+ NO_SUSPEND_POWER_DOWN ?= yes
+endif
diff --git a/quantum/quantum.c b/quantum/quantum.c
index c857e5f7a1..76a48cc77c 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -145,10 +145,6 @@ void reset_keyboard(void) {
#ifdef HAPTIC_ENABLE
haptic_shutdown();
#endif
-// this is also done later in bootloader.c - not sure if it's neccesary here
-#ifdef BOOTLOADER_CATERINA
- *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific
-#endif
bootloader_jump();
}
@@ -288,9 +284,11 @@ bool process_record_quantum(keyrecord_t *record) {
if (record->event.pressed) {
switch (keycode) {
+#ifndef NO_RESET
case RESET:
reset_keyboard();
return false;
+#endif
#ifndef NO_DEBUG
case DEBUG:
debug_enable ^= 1;