summaryrefslogtreecommitdiffstats
path: root/quantum/template
diff options
context:
space:
mode:
authorNoah Andrews <NoahAndrews@users.noreply.github.com>2016-03-30 02:03:22 +0200
committerNoah Andrews <NoahAndrews@users.noreply.github.com>2016-03-30 02:03:22 +0200
commite28334017c94c6928dd7e82436cec171f0243747 (patch)
treed2b2ecb96aff656094b2113f83632e3131000a75 /quantum/template
parentccf848917b7e931327f6c4a469877e9d8ef238ea (diff)
parent26513b497b8bae5160389c0beac2d45cbb29c50f (diff)
downloadqmk_firmware-e28334017c94c6928dd7e82436cec171f0243747.tar.gz
qmk_firmware-e28334017c94c6928dd7e82436cec171f0243747.tar.xz
Merge remote-tracking branch 'jackhumbert/master' into make-keymap-names-consistent
Diffstat (limited to 'quantum/template')
-rw-r--r--quantum/template/Makefile23
-rw-r--r--quantum/template/config.h92
-rw-r--r--quantum/template/template.c49
-rw-r--r--quantum/template/template.h12
4 files changed, 137 insertions, 39 deletions
diff --git a/quantum/template/Makefile b/quantum/template/Makefile
index 2efa69138..4fa195468 100644
--- a/quantum/template/Makefile
+++ b/quantum/template/Makefile
@@ -113,18 +113,19 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512
# Build Options
# comment out to disable the options.
#
-BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
-EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
-CONSOLE_ENABLE = yes # Console for debug(+400)
-COMMAND_ENABLE = yes # Commands for debug and configuration
+BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
+EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
+CONSOLE_ENABLE = yes # Console for debug(+400)
+COMMAND_ENABLE = yes # Commands for debug and configuration
+KEYBOARD_LOCK_ENABLE = yes # Allow locking of keyboard via magic key
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
-# NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
-# MIDI_ENABLE = YES # MIDI controls
-# UNICODE_ENABLE = YES # Unicode
-# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID
+# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
+#NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
+# MIDI_ENABLE = YES # MIDI controls
+# UNICODE_ENABLE = YES # Unicode
+# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID
# Optimize size but this may cause error "relocation truncated to fit"
diff --git a/quantum/template/config.h b/quantum/template/config.h
index 7d6149f43..e6fb7866c 100644
--- a/quantum/template/config.h
+++ b/quantum/template/config.h
@@ -32,34 +32,110 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_ROWS 2
#define MATRIX_COLS 3
-// Planck PCB default pin-out
-// Change this to how you wired your keyboard
-// COLS: Left to right, ROWS: Top to bottom
+/*
+ * Keyboard Matrix Assignments
+ *
+ * Change this to how you wired your keyboard
+ * COLS: AVR pins used for columns, left to right
+ * ROWS: AVR pins used for rows, top to bottom
+ * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
+ * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
+ *
+*/
#define COLS (int []){ F1, F0, B0 }
#define ROWS (int []){ D0, D5 }
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
-/* define if matrix has ghost */
+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
+#define DEBOUNCE 5
+
+/* define if matrix has ghost (lacks anti-ghosting diodes) */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
#define BACKLIGHT_LEVELS 3
-/* Set 0 if debouncing isn't needed */
-#define DEBOUNCE 5
-
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
-/* key combination for command */
+/*
+ * Force NKRO
+ *
+ * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
+ * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
+ * makefile for this to work.)
+ *
+ * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
+ * until the next keyboard reset.
+ *
+ * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
+ * fully operational during normal computer usage.
+ *
+ * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
+ * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
+ * bootmagic, NKRO mode will always be enabled until it is toggled again during a
+ * power-up.
+ *
+ */
+//#define FORCE_NKRO
+
+/*
+ * Magic Key Options
+ *
+ * Magic keys are hotkey commands that allow control over firmware functions of
+ * the keyboard. They are best used in combination with the HID Listen program,
+ * found here: https://www.pjrc.com/teensy/hid_listen.html
+ *
+ * The options below allow the magic key functionality to be changed. This is
+ * useful if your keyboard/keypad is missing keys and you want magic key support.
+ *
+ */
+
+/* key combination for magic key command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
+/* control how magic key switches layers */
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
+
+/* override magic key keymap */
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
+//#define MAGIC_KEY_HELP1 H
+//#define MAGIC_KEY_HELP2 SLASH
+//#define MAGIC_KEY_DEBUG D
+//#define MAGIC_KEY_DEBUG_MATRIX X
+//#define MAGIC_KEY_DEBUG_KBD K
+//#define MAGIC_KEY_DEBUG_MOUSE M
+//#define MAGIC_KEY_VERSION V
+//#define MAGIC_KEY_STATUS S
+//#define MAGIC_KEY_CONSOLE C
+//#define MAGIC_KEY_LAYER0_ALT1 ESC
+//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
+//#define MAGIC_KEY_LAYER0 0
+//#define MAGIC_KEY_LAYER1 1
+//#define MAGIC_KEY_LAYER2 2
+//#define MAGIC_KEY_LAYER3 3
+//#define MAGIC_KEY_LAYER4 4
+//#define MAGIC_KEY_LAYER5 5
+//#define MAGIC_KEY_LAYER6 6
+//#define MAGIC_KEY_LAYER7 7
+//#define MAGIC_KEY_LAYER8 8
+//#define MAGIC_KEY_LAYER9 9
+//#define MAGIC_KEY_BOOTLOADER PAUSE
+//#define MAGIC_KEY_LOCK CAPS
+//#define MAGIC_KEY_EEPROM E
+//#define MAGIC_KEY_NKRO N
+//#define MAGIC_KEY_SLEEP_LED Z
+
/*
* Feature disable options
* These options are also useful to firmware size reduction.
diff --git a/quantum/template/template.c b/quantum/template/template.c
index 7be7dfc3d..cc52e496f 100644
--- a/quantum/template/template.c
+++ b/quantum/template/template.c
@@ -1,29 +1,48 @@
#include "%KEYBOARD%.h"
__attribute__ ((weak))
-void * matrix_init_user(void) {
- // leave these blank
+void matrix_init_user(void) {
+ // leave this function blank - it can be defined in a keymap file
};
__attribute__ ((weak))
-void * matrix_scan_user(void) {
- // leave these blank
-};
+void matrix_scan_user(void) {
+ // leave this function blank - it can be defined in a keymap file
+}
+
+__attribute__ ((weak))
+void process_action_user(keyrecord_t *record) {
+ // leave this function blank - it can be defined in a keymap file
+}
+
+__attribute__ ((weak))
+void led_set_user(uint8_t usb_led) {
+ // leave this function blank - it can be defined in a keymap file
+}
-void * matrix_init_kb(void) {
+void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
- if (matrix_init_user) {
- (*matrix_init_user)();
- }
-};
+ matrix_init_user();
+}
-void * matrix_scan_kb(void) {
+void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
- if (matrix_scan_user) {
- (*matrix_scan_user)();
- }
-}; \ No newline at end of file
+ matrix_scan_user();
+}
+
+void process_action_kb(keyrecord_t *record) {
+ // put your per-action keyboard code here
+ // runs for every action, just before processing by the firmware
+
+ process_action_user(record);
+}
+
+void led_set_kb(uint8_t usb_led) {
+ // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
+
+ led_set_user(usb_led);
+}
diff --git a/quantum/template/template.h b/quantum/template/template.h
index d4d78e4c9..b1c34d3cb 100644
--- a/quantum/template/template.h
+++ b/quantum/template/template.h
@@ -12,14 +12,16 @@
// The second converts the arguments into a two-dimensional array
#define KEYMAP( \
k00, k01, k02, \
- k10, k11, \
+ k10, k11 \
) \
{ \
{ k00, k01, k02 }, \
{ k10, KC_NO, k11 }, \
-}
+}
-void * matrix_init_user(void);
-void * matrix_scan_user(void);
+void matrix_init_user(void);
+void matrix_scan_user(void);
+void process_action_user(keyrecord_t *record);
+void led_set_user(uint8_t usb_led);
-#endif \ No newline at end of file
+#endif