]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Merge pull request #471 from Chipairon/patch-1
authorJack Humbert <jack.humb@gmail.com>
Tue, 5 Jul 2016 15:05:14 +0000 (11:05 -0400)
committerGitHub <noreply@github.com>
Tue, 5 Jul 2016 15:05:14 +0000 (11:05 -0400)
Fix for '~' in spanish layout

103 files changed:
doc/keycode.txt
keyboards/chibios_test/Makefile [new file with mode: 0644]
keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c [new file with mode: 0644]
keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h [new file with mode: 0644]
keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk [new file with mode: 0644]
keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.png [new file with mode: 0644]
keyboards/chibios_test/boards/maple_mini_mapping.png [new file with mode: 0644]
keyboards/chibios_test/chibios_test.c [new file with mode: 0644]
keyboards/chibios_test/chibios_test.h [new file with mode: 0644]
keyboards/chibios_test/config.h [new file with mode: 0644]
keyboards/chibios_test/keymaps/default/keymap.c [new file with mode: 0644]
keyboards/chibios_test/ld/MKL26Z64.ld [new file with mode: 0644]
keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld [new file with mode: 0644]
keyboards/chibios_test/stm32_f072_onekey/Makefile [new file with mode: 0644]
keyboards/chibios_test/stm32_f072_onekey/bootloader_defs.h [new file with mode: 0644]
keyboards/chibios_test/stm32_f072_onekey/chconf.h [new file with mode: 0644]
keyboards/chibios_test/stm32_f072_onekey/config.h [new file with mode: 0644]
keyboards/chibios_test/stm32_f072_onekey/halconf.h [new file with mode: 0644]
keyboards/chibios_test/stm32_f072_onekey/led.c [new file with mode: 0644]
keyboards/chibios_test/stm32_f072_onekey/matrix.c [new file with mode: 0644]
keyboards/chibios_test/stm32_f072_onekey/mcuconf.h [new file with mode: 0644]
keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.c [new file with mode: 0644]
keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.h [new file with mode: 0644]
keyboards/chibios_test/stm32_f103_onekey/Makefile [new file with mode: 0644]
keyboards/chibios_test/stm32_f103_onekey/bootloader_defs.h [new file with mode: 0644]
keyboards/chibios_test/stm32_f103_onekey/chconf.h [new file with mode: 0644]
keyboards/chibios_test/stm32_f103_onekey/config.h [new file with mode: 0644]
keyboards/chibios_test/stm32_f103_onekey/flash.sh [new file with mode: 0755]
keyboards/chibios_test/stm32_f103_onekey/halconf.h [new file with mode: 0644]
keyboards/chibios_test/stm32_f103_onekey/led.c [new file with mode: 0644]
keyboards/chibios_test/stm32_f103_onekey/matrix.c [new file with mode: 0644]
keyboards/chibios_test/stm32_f103_onekey/mcuconf.h [new file with mode: 0644]
keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.c [new file with mode: 0644]
keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.h [new file with mode: 0644]
keyboards/chibios_test/teensy_lc_onekey/Makefile [new file with mode: 0644]
keyboards/chibios_test/teensy_lc_onekey/Makefile.3.0 [new file with mode: 0644]
keyboards/chibios_test/teensy_lc_onekey/Makefile.3.2 [new file with mode: 0644]
keyboards/chibios_test/teensy_lc_onekey/chconf.h [new file with mode: 0644]
keyboards/chibios_test/teensy_lc_onekey/config.h [new file with mode: 0644]
keyboards/chibios_test/teensy_lc_onekey/halconf.h [new file with mode: 0644]
keyboards/chibios_test/teensy_lc_onekey/instructions.md [new file with mode: 0644]
keyboards/chibios_test/teensy_lc_onekey/led.c [new file with mode: 0644]
keyboards/chibios_test/teensy_lc_onekey/matrix.c [new file with mode: 0644]
keyboards/chibios_test/teensy_lc_onekey/mcuconf.h [new file with mode: 0644]
keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.c [new file with mode: 0644]
keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h [new file with mode: 0644]
keyboards/ergodox_ez/config.h
keyboards/ergodox_ez/matrix.c
keyboards/kc60/keymaps/stanleylai/Makefile
keyboards/kc60/keymaps/wigguno/Makefile [new file with mode: 0644]
keyboards/kc60/keymaps/wigguno/keymap.c [new file with mode: 0644]
keyboards/kc60/keymaps/wigguno/readme.md [new file with mode: 0644]
keyboards/kc60/keymaps/ws2812/Makefile
keyboards/planck/keymaps/default/keymap.c
keyboards/preonic/keymaps/default/keymap.c
keyboards/stm32_f072_onekey/Makefile [deleted file]
keyboards/stm32_f072_onekey/bootloader_defs.h [deleted file]
keyboards/stm32_f072_onekey/chconf.h [deleted file]
keyboards/stm32_f072_onekey/config.h [deleted file]
keyboards/stm32_f072_onekey/halconf.h [deleted file]
keyboards/stm32_f072_onekey/keymaps/default/keymap.c [deleted file]
keyboards/stm32_f072_onekey/led.c [deleted file]
keyboards/stm32_f072_onekey/matrix.c [deleted file]
keyboards/stm32_f072_onekey/mcuconf.h [deleted file]
keyboards/stm32_f072_onekey/stm32_f072_onekey.c [deleted file]
keyboards/stm32_f072_onekey/stm32_f072_onekey.h [deleted file]
keyboards/stm32_f103_onekey/Makefile [deleted file]
keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c [deleted file]
keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h [deleted file]
keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk [deleted file]
keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png [deleted file]
keyboards/stm32_f103_onekey/boards/maple_mini_mapping.png [deleted file]
keyboards/stm32_f103_onekey/bootloader_defs.h [deleted file]
keyboards/stm32_f103_onekey/chconf.h [deleted file]
keyboards/stm32_f103_onekey/config.h [deleted file]
keyboards/stm32_f103_onekey/flash.sh [deleted file]
keyboards/stm32_f103_onekey/halconf.h [deleted file]
keyboards/stm32_f103_onekey/keymaps/default/keymap.c [deleted file]
keyboards/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld [deleted file]
keyboards/stm32_f103_onekey/led.c [deleted file]
keyboards/stm32_f103_onekey/matrix.c [deleted file]
keyboards/stm32_f103_onekey/mcuconf.h [deleted file]
keyboards/stm32_f103_onekey/stm32_f103_onekey.c [deleted file]
keyboards/stm32_f103_onekey/stm32_f103_onekey.h [deleted file]
keyboards/teensy_lc_onekey/Makefile [deleted file]
keyboards/teensy_lc_onekey/Makefile.3.0 [deleted file]
keyboards/teensy_lc_onekey/Makefile.3.2 [deleted file]
keyboards/teensy_lc_onekey/chconf.h [deleted file]
keyboards/teensy_lc_onekey/config.h [deleted file]
keyboards/teensy_lc_onekey/halconf.h [deleted file]
keyboards/teensy_lc_onekey/instructions.md [deleted file]
keyboards/teensy_lc_onekey/keymaps/default/keymap.c [deleted file]
keyboards/teensy_lc_onekey/ld/MKL26Z64.ld [deleted file]
keyboards/teensy_lc_onekey/led.c [deleted file]
keyboards/teensy_lc_onekey/matrix.c [deleted file]
keyboards/teensy_lc_onekey/mcuconf.h [deleted file]
keyboards/teensy_lc_onekey/teensy_lc_onekey.c [deleted file]
keyboards/teensy_lc_onekey/teensy_lc_onekey.h [deleted file]
quantum/matrix.c
tmk_core/common/avr/suspend.c
tmk_core/common/bootmagic.c
tmk_core/common/keyboard.c
tmk_core/common/matrix.h

index 44d7e27cd6a562f4efef616cc2f9c7981de3a73f..c1134f9bf2ed4e66283eb69f9bfb132a5cd56e3f 100644 (file)
@@ -62,7 +62,7 @@ KC_NONUS_HASH       KC_NUHS         32 Keyboard Non-US # and ~
 KC_SCOLON           KC_SCLN         33 Keyboard ; and :
 KC_QUOTE            KC_QUOT         34 Keyboard â€˜ and â€œ
 KC_GRAVE            KC_GRV          35 Keyboard Grave Accent and Tilde
-KC_COMMA            KC_COMM         36 Keyboard, and <
+KC_COMMA            KC_COMM         36 Keyboard , and <
 KC_DOT                              37 Keyboard . and >
 KC_SLASH            KC_SLSH         38 Keyboard / and ?
 KC_CAPSLOCK         KC_CAPS         39 Keyboard Caps Lock
@@ -92,7 +92,7 @@ KC_LEFT                             50 Keyboard LeftArrow1
 KC_DOWN                             51 Keyboard DownArrow1
 KC_UP                               52 Keyboard UpArrow1
 KC_NUMLOCK          KC_NLCK         53 Keypad Num Lock and Clear11
-KC_KP_SLASH         KC_PSLS         54 Keypad /1
+KC_KP_SLASH         KC_PSLS         54 Keypad /
 KC_KP_ASTERISK      KC_PAST         55 Keypad *
 KC_KP_MINUS         KC_PMNS         56 Keypad -
 KC_KP_PLUS          KC_PPLS         57 Keypad +
diff --git a/keyboards/chibios_test/Makefile b/keyboards/chibios_test/Makefile
new file mode 100644 (file)
index 0000000..d9f2b8b
--- /dev/null
@@ -0,0 +1,14 @@
+SUBPROJECT_DEFAULT = stm32_f072_onekey
+
+#BOOTMAGIC_ENABLE = yes        # Virtual DIP switch configuration
+MOUSEKEY_ENABLE ?= yes # Mouse keys
+EXTRAKEY_ENABLE ?= yes # Audio control and System control
+CONSOLE_ENABLE ?= yes  # Console for debug
+COMMAND_ENABLE ?= yes    # Commands for debug and configuration
+SLEEP_LED_ENABLE ?= yes  # Breathing sleep LED during USB suspend
+NKRO_ENABLE ?= yes         # USB Nkey Rollover
+CUSTOM_MATRIX ?= yes # Custom matrix file
+
+ifndef QUANTUM_DIR
+       include ../../Makefile
+endif
\ No newline at end of file
diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c
new file mode 100644 (file)
index 0000000..31319ef
--- /dev/null
@@ -0,0 +1,49 @@
+/*\r
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
+\r
+    Licensed under the Apache License, Version 2.0 (the "License");\r
+    you may not use this file except in compliance with the License.\r
+    You may obtain a copy of the License at\r
+\r
+        http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+    Unless required by applicable law or agreed to in writing, software\r
+    distributed under the License is distributed on an "AS IS" BASIS,\r
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+    See the License for the specific language governing permissions and\r
+    limitations under the License.\r
+*/\r
+\r
+#include "hal.h"\r
+\r
+/**\r
+ * @brief   PAL setup.\r
+ * @details Digital I/O ports static configuration as defined in @p board.h.\r
+ *          This variable is used by the HAL when initializing the PAL driver.\r
+ */\r
+#if HAL_USE_PAL || defined(__DOXYGEN__)\r
+const PALConfig pal_default_config =\r
+{\r
+  {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},\r
+  {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},\r
+  {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},\r
+  {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},\r
+  {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},\r
+};\r
+#endif\r
+\r
+/*\r
+ * Early initialization code.\r
+ * This initialization must be performed just after stack setup and before\r
+ * any other initialization.\r
+ */\r
+void __early_init(void) {\r
+\r
+  stm32_clock_init();\r
+}\r
+\r
+/*\r
+ * Board-specific initialization code.\r
+ */\r
+void boardInit(void) {\r
+}\r
diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h
new file mode 100644 (file)
index 0000000..7253e77
--- /dev/null
@@ -0,0 +1,166 @@
+/*\r
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
+\r
+    Licensed under the Apache License, Version 2.0 (the "License");\r
+    you may not use this file except in compliance with the License.\r
+    You may obtain a copy of the License at\r
+\r
+        http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+    Unless required by applicable law or agreed to in writing, software\r
+    distributed under the License is distributed on an "AS IS" BASIS,\r
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+    See the License for the specific language governing permissions and\r
+    limitations under the License.\r
+*/\r
+\r
+#ifndef _BOARD_H_\r
+#define _BOARD_H_\r
+\r
+/*\r
+ * Setup for a Generic STM32F103 board.\r
+ */\r
+\r
+/*\r
+ * Board identifier.\r
+ */\r
+#define BOARD_GENERIC_STM32_F103\r
+#define BOARD_NAME              "Generic STM32F103x board"\r
+\r
+/*\r
+ * Board frequencies.\r
+ */\r
+#define STM32_LSECLK            32768\r
+#define STM32_HSECLK            8000000\r
+\r
+/*\r
+ * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.\r
+ */\r
+#define STM32F103xB\r
+\r
+/*\r
+ * IO pins assignments\r
+ */\r
+\r
+/* on-board */\r
+\r
+#define GPIOC_LED               13\r
+#define GPIOD_OSC_IN            0\r
+#define GPIOD_OSC_OUT           1\r
+\r
+/* In case your board has a "USB enable" hardware\r
+   controlled by a pin, define it here. (It could be just\r
+   a 1.5k resistor connected to D+ line.)\r
+*/\r
+/*\r
+#define GPIOB_USB_DISC          10\r
+*/\r
+\r
+/*\r
+ * I/O ports initial setup, this configuration is established soon after reset\r
+ * in the initialization code.\r
+ *\r
+ * The digits have the following meaning:\r
+ *   0 - Analog input.\r
+ *   1 - Push Pull output 10MHz.\r
+ *   2 - Push Pull output 2MHz.\r
+ *   3 - Push Pull output 50MHz.\r
+ *   4 - Digital input.\r
+ *   5 - Open Drain output 10MHz.\r
+ *   6 - Open Drain output 2MHz.\r
+ *   7 - Open Drain output 50MHz.\r
+ *   8 - Digital input with PullUp or PullDown resistor depending on ODR.\r
+ *   9 - Alternate Push Pull output 10MHz.\r
+ *   A - Alternate Push Pull output 2MHz.\r
+ *   B - Alternate Push Pull output 50MHz.\r
+ *   C - Reserved.\r
+ *   D - Alternate Open Drain output 10MHz.\r
+ *   E - Alternate Open Drain output 2MHz.\r
+ *   F - Alternate Open Drain output 50MHz.\r
+ * Please refer to the STM32 Reference Manual for details.\r
+ */\r
+\r
+/*\r
+ * Port A setup.\r
+ * Everything input with pull-up except:\r
+ * PA2  - Alternate output  (USART2 TX).\r
+ * PA3  - Normal input      (USART2 RX).\r
+ * PA9  - Alternate output  (USART1 TX).\r
+ * PA10 - Normal input      (USART1 RX).\r
+ */\r
+#define VAL_GPIOACRL            0x88884B88      /*  PA7...PA0 */\r
+#define VAL_GPIOACRH            0x888884B8      /* PA15...PA8 */\r
+#define VAL_GPIOAODR            0xFFFFFFFF\r
+\r
+/*\r
+ * Port B setup.\r
+ * Everything input with pull-up except:\r
+ * PB10    - Push Pull output  (USB switch).\r
+ */\r
+#define VAL_GPIOBCRL            0x88888888      /*  PB7...PB0 */\r
+#define VAL_GPIOBCRH            0x88888388      /* PB15...PB8 */\r
+#define VAL_GPIOBODR            0xFFFFFFFF\r
+\r
+/*\r
+ * Port C setup.\r
+ * Everything input with pull-up except:\r
+ * PC13    - Push Pull output  (LED).\r
+ */\r
+#define VAL_GPIOCCRL            0x88888888      /*  PC7...PC0 */\r
+#define VAL_GPIOCCRH            0x88388888      /* PC15...PC8 */\r
+#define VAL_GPIOCODR            0xFFFFFFFF\r
+\r
+/*\r
+ * Port D setup.\r
+ * Everything input with pull-up except:\r
+ * PD0  - Normal input (XTAL).\r
+ * PD1  - Normal input (XTAL).\r
+ */\r
+#define VAL_GPIODCRL            0x88888844      /*  PD7...PD0 */\r
+#define VAL_GPIODCRH            0x88888888      /* PD15...PD8 */\r
+#define VAL_GPIODODR            0xFFFFFFFF\r
+\r
+/*\r
+ * Port E setup.\r
+ * Everything input with pull-up except:\r
+ */\r
+#define VAL_GPIOECRL            0x88888888      /*  PE7...PE0 */\r
+#define VAL_GPIOECRH            0x88888888      /* PE15...PE8 */\r
+#define VAL_GPIOEODR            0xFFFFFFFF\r
+\r
+/*\r
+ * USB bus activation macro, required by the USB driver.\r
+ */\r
+/* The point is that most of the generic STM32F103* boards\r
+   have a 1.5k resistor connected on one end to the D+ line\r
+   and on the other end to some pin. Or even a slightly more\r
+   complicated "USB enable" circuit, controlled by a pin.\r
+   That should go here.\r
+\r
+   However on some boards (e.g. one that I have), there's no\r
+   such hardware. In which case it's better to not do anything.\r
+*/\r
+/*\r
+#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC)\r
+*/\r
+#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT);\r
+\r
+/*\r
+ * USB bus de-activation macro, required by the USB driver.\r
+ */\r
+/*\r
+#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC)\r
+*/\r
+#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12);\r
+\r
+#if !defined(_FROM_ASM_)\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+  void boardInit(void);\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+#endif /* _FROM_ASM_ */\r
+\r
+#endif /* _BOARD_H_ */\r
diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk
new file mode 100644 (file)
index 0000000..d692c0e
--- /dev/null
@@ -0,0 +1,5 @@
+# List of all the board related files.\r
+BOARDSRC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103/board.c\r
+\r
+# Required include directories\r
+BOARDINC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103\r
diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.png b/keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.png
new file mode 100644 (file)
index 0000000..c44a7d9
Binary files /dev/null and b/keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.png differ
diff --git a/keyboards/chibios_test/boards/maple_mini_mapping.png b/keyboards/chibios_test/boards/maple_mini_mapping.png
new file mode 100644 (file)
index 0000000..12cfa81
Binary files /dev/null and b/keyboards/chibios_test/boards/maple_mini_mapping.png differ
diff --git a/keyboards/chibios_test/chibios_test.c b/keyboards/chibios_test/chibios_test.c
new file mode 100644 (file)
index 0000000..efe2d4a
--- /dev/null
@@ -0,0 +1 @@
+#include "chibios_test.h"
diff --git a/keyboards/chibios_test/chibios_test.h b/keyboards/chibios_test/chibios_test.h
new file mode 100644 (file)
index 0000000..25b0317
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef KEYBOARDS_CHIBIOS_TEST_CHIBIOS_TEST_H_
+#define KEYBOARDS_CHIBIOS_TEST_CHIBIOS_TEST_H_
+
+#include "quantum.h"
+
+#endif /* KEYBOARDS_CHIBIOS_TEST_CHIBIOS_TEST_H_ */
diff --git a/keyboards/chibios_test/config.h b/keyboards/chibios_test/config.h
new file mode 100644 (file)
index 0000000..c32a77b
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+Copyright 2015 Jun Wako <wakojun@gmail.com>
+
+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/>.
+*/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID       0xFEED
+#define PRODUCT_ID      0x6464
+#define DEVICE_VER      0x0001
+/* in python2: list(u"whatever".encode('utf-16-le')) */
+/*   at most 32 characters or the ugly hack in usb_main.c borks */
+#define MANUFACTURER "QMK"
+#define USBSTR_MANUFACTURER    'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00'
+#define PRODUCT "ChibiOS QMK test"
+#define USBSTR_PRODUCT         'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'Q', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', 't', '\x00', 'e', '\x00', 's', '\x00', 't', '\x00'
+#define DESCRIPTION "QMK keyboard firmware test for ChibiOS"
+
+/* key matrix size */
+#define MATRIX_ROWS 1
+#define MATRIX_COLS 1
+#define DIODE_DIRECTION COL2ROW
+
+/* define if matrix has ghost */
+//#define MATRIX_HAS_GHOST
+
+/* 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 */
+#define IS_COMMAND() ( \
+    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
+)
+
+
+
+/*
+ * Feature disable options
+ *  These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+//#define NO_DEBUG
+
+/* disable print */
+//#define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION
+
+#endif
diff --git a/keyboards/chibios_test/keymaps/default/keymap.c b/keyboards/chibios_test/keymaps/default/keymap.c
new file mode 100644 (file)
index 0000000..239d700
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
+
+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/>.
+*/
+
+#include "chibios_test.h"
+
+const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+    {{KC_CAPS}}, // test with KC_CAPS, KC_A, KC_BTLD
+};
+
+const uint16_t fn_actions[] = {
+};
diff --git a/keyboards/chibios_test/ld/MKL26Z64.ld b/keyboards/chibios_test/ld/MKL26Z64.ld
new file mode 100644 (file)
index 0000000..fb141f8
--- /dev/null
@@ -0,0 +1,105 @@
+/*\r
+ * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com\r
+ *           (C) 2016 flabbergast <s3+flabbergast@sdfeu.org>\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining\r
+ * a copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+ * SOFTWARE.\r
+ */\r
+\r
+/*\r
+ * KL26Z64 memory setup.\r
+ */\r
+MEMORY\r
+{\r
+  flash0   : org = 0x00000000, len = 0x100\r
+  flash1   : org = 0x00000400, len = 0x10\r
+  flash2   : org = 0x00000410, len = 62k - 0x410\r
+  flash3   : org = 0x0000F800, len = 2k\r
+  flash4   : org = 0x00000000, len = 0\r
+  flash5   : org = 0x00000000, len = 0\r
+  flash6   : org = 0x00000000, len = 0\r
+  flash7   : org = 0x00000000, len = 0\r
+  ram0     : org = 0x1FFFF800, len = 8k\r
+  ram1     : org = 0x00000000, len = 0\r
+  ram2     : org = 0x00000000, len = 0\r
+  ram3     : org = 0x00000000, len = 0\r
+  ram4     : org = 0x00000000, len = 0\r
+  ram5     : org = 0x00000000, len = 0\r
+  ram6     : org = 0x00000000, len = 0\r
+  ram7     : org = 0x00000000, len = 0\r
+}\r
+\r
+/* Flash region for the configuration bytes.*/\r
+SECTIONS\r
+{\r
+  .cfmprotect : ALIGN(4) SUBALIGN(4)\r
+  {\r
+    KEEP(*(.cfmconfig))\r
+  } > flash1\r
+}\r
+\r
+/* For each data/text section two region are defined, a virtual region\r
+   and a load region (_LMA suffix).*/\r
+\r
+/* Flash region to be used for exception vectors.*/\r
+REGION_ALIAS("VECTORS_FLASH", flash0);\r
+REGION_ALIAS("VECTORS_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for constructors and destructors.*/\r
+REGION_ALIAS("XTORS_FLASH", flash2);\r
+REGION_ALIAS("XTORS_FLASH_LMA", flash2);\r
+\r
+/* Flash region to be used for code text.*/\r
+REGION_ALIAS("TEXT_FLASH", flash2);\r
+REGION_ALIAS("TEXT_FLASH_LMA", flash2);\r
+\r
+/* Flash region to be used for read only data.*/\r
+REGION_ALIAS("RODATA_FLASH", flash2);\r
+REGION_ALIAS("RODATA_FLASH_LMA", flash2);\r
+\r
+/* Flash region to be used for various.*/\r
+REGION_ALIAS("VARIOUS_FLASH", flash2);\r
+REGION_ALIAS("VARIOUS_FLASH_LMA", flash2);\r
+\r
+/* Flash region to be used for RAM(n) initialization data.*/\r
+REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2);\r
+\r
+/* RAM region to be used for Main stack. This stack accommodates the processing\r
+   of all exceptions and interrupts.*/\r
+REGION_ALIAS("MAIN_STACK_RAM", ram0);\r
+\r
+/* RAM region to be used for the process stack. This is the stack used by\r
+   the main() function.*/\r
+REGION_ALIAS("PROCESS_STACK_RAM", ram0);\r
+\r
+/* RAM region to be used for data segment.*/\r
+REGION_ALIAS("DATA_RAM", ram0);\r
+REGION_ALIAS("DATA_RAM_LMA", flash2);\r
+\r
+/* RAM region to be used for BSS segment.*/\r
+REGION_ALIAS("BSS_RAM", ram0);\r
+\r
+/* RAM region to be used for the default heap.*/\r
+REGION_ALIAS("HEAP_RAM", ram0);\r
+\r
+__eeprom_workarea_start__ = ORIGIN(flash3);\r
+__eeprom_workarea_size__  = LENGTH(flash3);\r
+__eeprom_workarea_end__   = __eeprom_workarea_start__ + __eeprom_workarea_size__;\r
+\r
+/* Generic rules inclusion.*/\r
+INCLUDE rules.ld\r
diff --git a/keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld
new file mode 100644 (file)
index 0000000..0061332
--- /dev/null
@@ -0,0 +1,88 @@
+/*\r
+    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio\r
+\r
+    Licensed under the Apache License, Version 2.0 (the "License");\r
+    you may not use this file except in compliance with the License.\r
+    You may obtain a copy of the License at\r
+\r
+        http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+    Unless required by applicable law or agreed to in writing, software\r
+    distributed under the License is distributed on an "AS IS" BASIS,\r
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+    See the License for the specific language governing permissions and\r
+    limitations under the License.\r
+*/\r
+\r
+/*\r
+ * ST32F103xB memory setup for use with the maplemini bootloader.\r
+ * You will have to\r
+ *     #define CORTEX_VTOR_INIT 0x5000\r
+ * in your projects chconf.h\r
+ */\r
+MEMORY\r
+{\r
+    flash0  : org = 0x08002000, len = 128k - 0x2000\r
+    flash1  : org = 0x00000000, len = 0\r
+    flash2  : org = 0x00000000, len = 0\r
+    flash3  : org = 0x00000000, len = 0\r
+    flash4  : org = 0x00000000, len = 0\r
+    flash5  : org = 0x00000000, len = 0\r
+    flash6  : org = 0x00000000, len = 0\r
+    flash7  : org = 0x00000000, len = 0\r
+    ram0    : org = 0x20000000, len = 20k\r
+    ram1    : org = 0x00000000, len = 0\r
+    ram2    : org = 0x00000000, len = 0\r
+    ram3    : org = 0x00000000, len = 0\r
+    ram4    : org = 0x00000000, len = 0\r
+    ram5    : org = 0x00000000, len = 0\r
+    ram6    : org = 0x00000000, len = 0\r
+    ram7    : org = 0x00000000, len = 0\r
+}\r
+\r
+/* For each data/text section two region are defined, a virtual region\r
+   and a load region (_LMA suffix).*/\r
+\r
+/* Flash region to be used for exception vectors.*/\r
+REGION_ALIAS("VECTORS_FLASH", flash0);\r
+REGION_ALIAS("VECTORS_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for constructors and destructors.*/\r
+REGION_ALIAS("XTORS_FLASH", flash0);\r
+REGION_ALIAS("XTORS_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for code text.*/\r
+REGION_ALIAS("TEXT_FLASH", flash0);\r
+REGION_ALIAS("TEXT_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for read only data.*/\r
+REGION_ALIAS("RODATA_FLASH", flash0);\r
+REGION_ALIAS("RODATA_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for various.*/\r
+REGION_ALIAS("VARIOUS_FLASH", flash0);\r
+REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);\r
+\r
+/* Flash region to be used for RAM(n) initialization data.*/\r
+REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);\r
+\r
+/* RAM region to be used for Main stack. This stack accommodates the processing\r
+   of all exceptions and interrupts.*/\r
+REGION_ALIAS("MAIN_STACK_RAM", ram0);\r
+\r
+/* RAM region to be used for the process stack. This is the stack used by\r
+   the main() function.*/\r
+REGION_ALIAS("PROCESS_STACK_RAM", ram0);\r
+\r
+/* RAM region to be used for data segment.*/\r
+REGION_ALIAS("DATA_RAM", ram0);\r
+REGION_ALIAS("DATA_RAM_LMA", flash0);\r
+\r
+/* RAM region to be used for BSS segment.*/\r
+REGION_ALIAS("BSS_RAM", ram0);\r
+\r
+/* RAM region to be used for the default heap.*/\r
+REGION_ALIAS("HEAP_RAM", ram0);\r
+\r
+/* Generic rules inclusion.*/\r
+INCLUDE rules.ld\r
diff --git a/keyboards/chibios_test/stm32_f072_onekey/Makefile b/keyboards/chibios_test/stm32_f072_onekey/Makefile
new file mode 100644 (file)
index 0000000..eae38c4
--- /dev/null
@@ -0,0 +1,41 @@
+# project specific files
+SRC =  matrix.c \
+           led.c
+
+## chip/board settings
+# the next two should match the directories in
+#  <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
+MCU_FAMILY = STM32
+MCU_SERIES = STM32F0xx
+# linker script to use
+# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
+#  or <this_dir>/ld/
+MCU_LDSCRIPT = STM32F072xB
+# startup code to use
+# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
+MCU_STARTUP = stm32f0xx
+# it should exist either in <chibios>/os/hal/boards/
+#  or <this_dir>/boards
+BOARD = ST_STM32F072B_DISCOVERY
+# Cortex version
+# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
+MCU  = cortex-m0
+# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
+ARMV = 6
+# If you want to be able to jump to bootloader from firmware on STM32 MCUs,
+# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in
+# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have
+# a custom board definition that you plan to reuse).
+# If you're not setting it here, leave it commented out.
+# It is chip dependent, the correct number can be looked up here (page 175):
+# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
+# This also requires a patch to chibios:
+#   <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
+#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
+
+# Build Options
+#   comment out to disable the options.
+#
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
diff --git a/keyboards/chibios_test/stm32_f072_onekey/bootloader_defs.h b/keyboards/chibios_test/stm32_f072_onekey/bootloader_defs.h
new file mode 100644 (file)
index 0000000..02c48c4
--- /dev/null
@@ -0,0 +1,7 @@
+/* Address for jumping to bootloader on STM32 chips. */
+/* It is chip dependent, the correct number can be looked up here (page 175):
+ * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
+ * This also requires a patch to chibios:
+ *  <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
+ */
+#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800
diff --git a/keyboards/chibios_test/stm32_f072_onekey/chconf.h b/keyboards/chibios_test/stm32_f072_onekey/chconf.h
new file mode 100644 (file)
index 0000000..99fa8ce
--- /dev/null
@@ -0,0 +1,524 @@
+/*
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+/**
+ * @file    templates/chconf.h
+ * @brief   Configuration file template.
+ * @details A copy of this file must be placed in each project directory, it
+ *          contains the application specific kernel settings.
+ *
+ * @addtogroup config
+ * @details Kernel related settings and hooks.
+ * @{
+ */
+
+#ifndef CHCONF_H
+#define CHCONF_H
+
+#define _CHIBIOS_RT_CONF_
+
+/*===========================================================================*/
+/**
+ * @name System timers settings
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   System time counter resolution.
+ * @note    Allowed values are 16 or 32 bits.
+ */
+#define CH_CFG_ST_RESOLUTION                32
+
+/**
+ * @brief   System tick frequency.
+ * @details Frequency of the system timer that drives the system ticks. This
+ *          setting also defines the system tick time unit.
+ */
+#define CH_CFG_ST_FREQUENCY                 10000
+
+/**
+ * @brief   Time delta constant for the tick-less mode.
+ * @note    If this value is zero then the system uses the classic
+ *          periodic tick. This value represents the minimum number
+ *          of ticks that is safe to specify in a timeout directive.
+ *          The value one is not valid, timeouts are rounded up to
+ *          this value.
+ */
+#define CH_CFG_ST_TIMEDELTA                 2
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Kernel parameters and options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Round robin interval.
+ * @details This constant is the number of system ticks allowed for the
+ *          threads before preemption occurs. Setting this value to zero
+ *          disables the preemption for threads with equal priority and the
+ *          round robin becomes cooperative. Note that higher priority
+ *          threads can still preempt, the kernel is always preemptive.
+ * @note    Disabling the round robin preemption makes the kernel more compact
+ *          and generally faster.
+ * @note    The round robin preemption is not supported in tickless mode and
+ *          must be set to zero in that case.
+ */
+#define CH_CFG_TIME_QUANTUM                 0
+
+/**
+ * @brief   Managed RAM size.
+ * @details Size of the RAM area to be managed by the OS. If set to zero
+ *          then the whole available RAM is used. The core memory is made
+ *          available to the heap allocator and/or can be used directly through
+ *          the simplified core memory allocator.
+ *
+ * @note    In order to let the OS manage the whole RAM the linker script must
+ *          provide the @p __heap_base__ and @p __heap_end__ symbols.
+ * @note    Requires @p CH_CFG_USE_MEMCORE.
+ */
+#define CH_CFG_MEMCORE_SIZE                 0
+
+/**
+ * @brief   Idle thread automatic spawn suppression.
+ * @details When this option is activated the function @p chSysInit()
+ *          does not spawn the idle thread. The application @p main()
+ *          function becomes the idle thread and must implement an
+ *          infinite loop.
+ */
+#define CH_CFG_NO_IDLE_THREAD               FALSE
+
+/* Use __WFI in the idle thread for waiting. Does lower the power
+ * consumption. */
+#define CORTEX_ENABLE_WFI_IDLE              TRUE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Performance options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   OS optimization.
+ * @details If enabled then time efficient rather than space efficient code
+ *          is used when two possible implementations exist.
+ *
+ * @note    This is not related to the compiler optimization options.
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_OPTIMIZE_SPEED               FALSE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Subsystem options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Time Measurement APIs.
+ * @details If enabled then the time measurement APIs are included in
+ *          the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_TM                       FALSE
+
+/**
+ * @brief   Threads registry APIs.
+ * @details If enabled then the registry APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_REGISTRY                 TRUE
+
+/**
+ * @brief   Threads synchronization APIs.
+ * @details If enabled then the @p chThdWait() function is included in
+ *          the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_WAITEXIT                 TRUE
+
+/**
+ * @brief   Semaphores APIs.
+ * @details If enabled then the Semaphores APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_SEMAPHORES               TRUE
+
+/**
+ * @brief   Semaphores queuing mode.
+ * @details If enabled then the threads are enqueued on semaphores by
+ *          priority rather than in FIFO order.
+ *
+ * @note    The default is @p FALSE. Enable this if you have special
+ *          requirements.
+ * @note    Requires @p CH_CFG_USE_SEMAPHORES.
+ */
+#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE
+
+/**
+ * @brief   Mutexes APIs.
+ * @details If enabled then the mutexes APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MUTEXES                  TRUE
+
+/**
+ * @brief   Enables recursive behavior on mutexes.
+ * @note    Recursive mutexes are heavier and have an increased
+ *          memory footprint.
+ *
+ * @note    The default is @p FALSE.
+ * @note    Requires @p CH_CFG_USE_MUTEXES.
+ */
+#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE
+
+/**
+ * @brief   Conditional Variables APIs.
+ * @details If enabled then the conditional variables APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_MUTEXES.
+ */
+#define CH_CFG_USE_CONDVARS                 TRUE
+
+/**
+ * @brief   Conditional Variables APIs with timeout.
+ * @details If enabled then the conditional variables APIs with timeout
+ *          specification are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_CONDVARS.
+ */
+#define CH_CFG_USE_CONDVARS_TIMEOUT         FALSE
+
+/**
+ * @brief   Events Flags APIs.
+ * @details If enabled then the event flags APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_EVENTS                   TRUE
+
+/**
+ * @brief   Events Flags APIs with timeout.
+ * @details If enabled then the events APIs with timeout specification
+ *          are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_EVENTS.
+ */
+#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE
+
+/**
+ * @brief   Synchronous Messages APIs.
+ * @details If enabled then the synchronous messages APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MESSAGES                 TRUE
+
+/**
+ * @brief   Synchronous Messages queuing mode.
+ * @details If enabled then messages are served by priority rather than in
+ *          FIFO order.
+ *
+ * @note    The default is @p FALSE. Enable this if you have special
+ *          requirements.
+ * @note    Requires @p CH_CFG_USE_MESSAGES.
+ */
+#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE
+
+/**
+ * @brief   Mailboxes APIs.
+ * @details If enabled then the asynchronous messages (mailboxes) APIs are
+ *          included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_SEMAPHORES.
+ */
+#define CH_CFG_USE_MAILBOXES                TRUE
+
+/**
+ * @brief   Core Memory Manager APIs.
+ * @details If enabled then the core memory manager APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MEMCORE                  FALSE
+
+/**
+ * @brief   Heap Allocator APIs.
+ * @details If enabled then the memory heap allocator APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
+ *          @p CH_CFG_USE_SEMAPHORES.
+ * @note    Mutexes are recommended.
+ */
+#define CH_CFG_USE_HEAP                     FALSE
+
+/**
+ * @brief   Memory Pools Allocator APIs.
+ * @details If enabled then the memory pools allocator APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MEMPOOLS                 FALSE
+
+/**
+ * @brief   Dynamic Threads APIs.
+ * @details If enabled then the dynamic threads creation APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_WAITEXIT.
+ * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
+ */
+#define CH_CFG_USE_DYNAMIC                  FALSE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Debug options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Debug option, kernel statistics.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_STATISTICS                   FALSE
+
+/**
+ * @brief   Debug option, system state check.
+ * @details If enabled the correct call protocol for system APIs is checked
+ *          at runtime.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_SYSTEM_STATE_CHECK           FALSE
+
+/**
+ * @brief   Debug option, parameters checks.
+ * @details If enabled then the checks on the API functions input
+ *          parameters are activated.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_ENABLE_CHECKS                FALSE
+
+/**
+ * @brief   Debug option, consistency checks.
+ * @details If enabled then all the assertions in the kernel code are
+ *          activated. This includes consistency checks inside the kernel,
+ *          runtime anomalies and port-defined checks.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_ENABLE_ASSERTS               FALSE
+
+/**
+ * @brief   Debug option, trace buffer.
+ * @details If enabled then the trace buffer is activated.
+ *
+ * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
+ */
+#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
+
+/**
+ * @brief   Trace buffer entries.
+ * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
+ *          different from @p CH_DBG_TRACE_MASK_DISABLED.
+ */
+#define CH_DBG_TRACE_BUFFER_SIZE            128
+
+/**
+ * @brief   Debug option, stack checks.
+ * @details If enabled then a runtime stack check is performed.
+ *
+ * @note    The default is @p FALSE.
+ * @note    The stack check is performed in a architecture/port dependent way.
+ *          It may not be implemented or some ports.
+ * @note    The default failure mode is to halt the system with the global
+ *          @p panic_msg variable set to @p NULL.
+ */
+#define CH_DBG_ENABLE_STACK_CHECK           FALSE
+
+/**
+ * @brief   Debug option, stacks initialization.
+ * @details If enabled then the threads working area is filled with a byte
+ *          value when a thread is created. This can be useful for the
+ *          runtime measurement of the used stack.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_FILL_THREADS                 FALSE
+
+/**
+ * @brief   Debug option, threads profiling.
+ * @details If enabled then a field is added to the @p thread_t structure that
+ *          counts the system ticks occurred while executing the thread.
+ *
+ * @note    The default is @p FALSE.
+ * @note    This debug option is not currently compatible with the
+ *          tickless mode.
+ */
+#define CH_DBG_THREADS_PROFILING            FALSE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Kernel hooks
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Threads descriptor structure extension.
+ * @details User fields added to the end of the @p thread_t structure.
+ */
+#define CH_CFG_THREAD_EXTRA_FIELDS                                          \
+  /* Add threads custom fields here.*/
+
+/**
+ * @brief   Threads initialization hook.
+ * @details User initialization code added to the @p chThdInit() API.
+ *
+ * @note    It is invoked from within @p chThdInit() and implicitly from all
+ *          the threads creation APIs.
+ */
+#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
+  /* Add threads initialization code here.*/                                \
+}
+
+/**
+ * @brief   Threads finalization hook.
+ * @details User finalization code added to the @p chThdExit() API.
+ */
+#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
+  /* Add threads finalization code here.*/                                  \
+}
+
+/**
+ * @brief   Context switch hook.
+ * @details This hook is invoked just before switching between threads.
+ */
+#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \
+  /* Context switch code here.*/                                            \
+}
+
+/**
+ * @brief   ISR enter hook.
+ */
+#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
+  /* IRQ prologue code here.*/                                              \
+}
+
+/**
+ * @brief   ISR exit hook.
+ */
+#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
+  /* IRQ epilogue code here.*/                                              \
+}
+
+/**
+ * @brief   Idle thread enter hook.
+ * @note    This hook is invoked within a critical zone, no OS functions
+ *          should be invoked from here.
+ * @note    This macro can be used to activate a power saving mode.
+ */
+#define CH_CFG_IDLE_ENTER_HOOK() {                                          \
+  /* Idle-enter code here.*/                                                \
+}
+
+/**
+ * @brief   Idle thread leave hook.
+ * @note    This hook is invoked within a critical zone, no OS functions
+ *          should be invoked from here.
+ * @note    This macro can be used to deactivate a power saving mode.
+ */
+#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
+  /* Idle-leave code here.*/                                                \
+}
+
+/**
+ * @brief   Idle Loop hook.
+ * @details This hook is continuously invoked by the idle thread loop.
+ */
+#define CH_CFG_IDLE_LOOP_HOOK() {                                           \
+  /* Idle loop code here.*/                                                 \
+}
+
+/**
+ * @brief   System tick event hook.
+ * @details This hook is invoked in the system tick handler immediately
+ *          after processing the virtual timers queue.
+ */
+#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \
+  /* System tick event code here.*/                                         \
+}
+
+/**
+ * @brief   System halt hook.
+ * @details This hook is invoked in case to a system halting error before
+ *          the system is halted.
+ */
+#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
+  /* System halt code here.*/                                               \
+}
+
+/**
+ * @brief   Trace hook.
+ * @details This hook is invoked each time a new record is written in the
+ *          trace buffer.
+ */
+#define CH_CFG_TRACE_HOOK(tep) {                                            \
+  /* Trace code here.*/                                                     \
+}
+
+/** @} */
+
+/*===========================================================================*/
+/* Port-specific settings (override port settings defaulted in chcore.h).    */
+/*===========================================================================*/
+
+#endif  /* CHCONF_H */
+
+/** @} */
diff --git a/keyboards/chibios_test/stm32_f072_onekey/config.h b/keyboards/chibios_test/stm32_f072_onekey/config.h
new file mode 100644 (file)
index 0000000..bbaf0dc
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef KEYBOARDS_CHIBIOS_TEST_STM32_F072_ONEKEY_CONFIG_H_
+#define KEYBOARDS_CHIBIOS_TEST_STM32_F072_ONEKEY_CONFIG_H_
+
+#include "../config.h"
+
+
+#endif /* KEYBOARDS_CHIBIOS_TEST_STM32_F072_ONEKEY_CONFIG_H_ */
diff --git a/keyboards/chibios_test/stm32_f072_onekey/halconf.h b/keyboards/chibios_test/stm32_f072_onekey/halconf.h
new file mode 100644 (file)
index 0000000..1a450d6
--- /dev/null
@@ -0,0 +1,353 @@
+/*
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+/**
+ * @file    templates/halconf.h
+ * @brief   HAL configuration header.
+ * @details HAL configuration file, this file allows to enable or disable the
+ *          various device drivers from your application. You may also use
+ *          this file in order to override the device drivers default settings.
+ *
+ * @addtogroup HAL_CONF
+ * @{
+ */
+
+#ifndef _HALCONF_H_
+#define _HALCONF_H_
+
+#include "mcuconf.h"
+
+/**
+ * @brief   Enables the PAL subsystem.
+ */
+#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
+#define HAL_USE_PAL                 TRUE
+#endif
+
+/**
+ * @brief   Enables the ADC subsystem.
+ */
+#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
+#define HAL_USE_ADC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the CAN subsystem.
+ */
+#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
+#define HAL_USE_CAN                 FALSE
+#endif
+
+/**
+ * @brief   Enables the DAC subsystem.
+ */
+#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
+#define HAL_USE_DAC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the EXT subsystem.
+ */
+#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
+#define HAL_USE_EXT                 FALSE
+#endif
+
+/**
+ * @brief   Enables the GPT subsystem.
+ */
+#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
+#define HAL_USE_GPT                 FALSE
+#endif
+
+/**
+ * @brief   Enables the I2C subsystem.
+ */
+#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
+#define HAL_USE_I2C                 FALSE
+#endif
+
+/**
+ * @brief   Enables the I2S subsystem.
+ */
+#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
+#define HAL_USE_I2S                 FALSE
+#endif
+
+/**
+ * @brief   Enables the ICU subsystem.
+ */
+#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
+#define HAL_USE_ICU                 FALSE
+#endif
+
+/**
+ * @brief   Enables the MAC subsystem.
+ */
+#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
+#define HAL_USE_MAC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the MMC_SPI subsystem.
+ */
+#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
+#define HAL_USE_MMC_SPI             FALSE
+#endif
+
+/**
+ * @brief   Enables the PWM subsystem.
+ */
+#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
+#define HAL_USE_PWM                 FALSE
+#endif
+
+/**
+ * @brief   Enables the RTC subsystem.
+ */
+#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
+#define HAL_USE_RTC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the SDC subsystem.
+ */
+#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
+#define HAL_USE_SDC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the SERIAL subsystem.
+ */
+#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
+#define HAL_USE_SERIAL              FALSE
+#endif
+
+/**
+ * @brief   Enables the SERIAL over USB subsystem.
+ */
+#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
+#define HAL_USE_SERIAL_USB          FALSE
+#endif
+
+/**
+ * @brief   Enables the SPI subsystem.
+ */
+#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
+#define HAL_USE_SPI                 FALSE
+#endif
+
+/**
+ * @brief   Enables the UART subsystem.
+ */
+#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
+#define HAL_USE_UART                FALSE
+#endif
+
+/**
+ * @brief   Enables the USB subsystem.
+ */
+#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
+#define HAL_USE_USB                 TRUE
+#endif
+
+/**
+ * @brief   Enables the WDG subsystem.
+ */
+#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
+#define HAL_USE_WDG                 FALSE
+#endif
+
+/*===========================================================================*/
+/* ADC driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables synchronous APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
+#define ADC_USE_WAIT                TRUE
+#endif
+
+/**
+ * @brief   Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
+#define ADC_USE_MUTUAL_EXCLUSION    TRUE
+#endif
+
+/*===========================================================================*/
+/* CAN driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Sleep mode related APIs inclusion switch.
+ */
+#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
+#define CAN_USE_SLEEP_MODE          TRUE
+#endif
+
+/*===========================================================================*/
+/* I2C driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables the mutual exclusion APIs on the I2C bus.
+ */
+#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
+#define I2C_USE_MUTUAL_EXCLUSION    TRUE
+#endif
+
+/*===========================================================================*/
+/* MAC driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables an event sources for incoming packets.
+ */
+#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
+#define MAC_USE_ZERO_COPY           FALSE
+#endif
+
+/**
+ * @brief   Enables an event sources for incoming packets.
+ */
+#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
+#define MAC_USE_EVENTS              TRUE
+#endif
+
+/*===========================================================================*/
+/* MMC_SPI driver related settings.                                          */
+/*===========================================================================*/
+
+/**
+ * @brief   Delays insertions.
+ * @details If enabled this options inserts delays into the MMC waiting
+ *          routines releasing some extra CPU time for the threads with
+ *          lower priority, this may slow down the driver a bit however.
+ *          This option is recommended also if the SPI driver does not
+ *          use a DMA channel and heavily loads the CPU.
+ */
+#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
+#define MMC_NICE_WAITING            TRUE
+#endif
+
+/*===========================================================================*/
+/* SDC driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Number of initialization attempts before rejecting the card.
+ * @note    Attempts are performed at 10mS intervals.
+ */
+#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
+#define SDC_INIT_RETRY              100
+#endif
+
+/**
+ * @brief   Include support for MMC cards.
+ * @note    MMC support is not yet implemented so this option must be kept
+ *          at @p FALSE.
+ */
+#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
+#define SDC_MMC_SUPPORT             FALSE
+#endif
+
+/**
+ * @brief   Delays insertions.
+ * @details If enabled this options inserts delays into the MMC waiting
+ *          routines releasing some extra CPU time for the threads with
+ *          lower priority, this may slow down the driver a bit however.
+ */
+#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
+#define SDC_NICE_WAITING            TRUE
+#endif
+
+/*===========================================================================*/
+/* SERIAL driver related settings.                                           */
+/*===========================================================================*/
+
+/**
+ * @brief   Default bit rate.
+ * @details Configuration parameter, this is the baud rate selected for the
+ *          default configuration.
+ */
+#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
+#define SERIAL_DEFAULT_BITRATE      38400
+#endif
+
+/**
+ * @brief   Serial buffers size.
+ * @details Configuration parameter, you can change the depth of the queue
+ *          buffers depending on the requirements of your application.
+ * @note    The default is 64 bytes for both the transmission and receive
+ *          buffers.
+ */
+#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
+#define SERIAL_BUFFERS_SIZE         16
+#endif
+
+/*===========================================================================*/
+/* SERIAL_USB driver related setting.                                        */
+/*===========================================================================*/
+
+/**
+ * @brief   Serial over USB buffers size.
+ * @details Configuration parameter, the buffer size must be a multiple of
+ *          the USB data endpoint maximum packet size.
+ * @note    The default is 64 bytes for both the transmission and receive
+ *          buffers.
+ */
+#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
+#define SERIAL_USB_BUFFERS_SIZE     256
+#endif
+
+/*===========================================================================*/
+/* SPI driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables synchronous APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
+#define SPI_USE_WAIT                TRUE
+#endif
+
+/**
+ * @brief   Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
+#define SPI_USE_MUTUAL_EXCLUSION    TRUE
+#endif
+
+/*===========================================================================*/
+/* USB driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables synchronous APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
+#define USB_USE_WAIT                TRUE
+#endif
+
+#endif /* _HALCONF_H_ */
+
+/** @} */
diff --git a/keyboards/chibios_test/stm32_f072_onekey/led.c b/keyboards/chibios_test/stm32_f072_onekey/led.c
new file mode 100644 (file)
index 0000000..18edb8b
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+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/>.
+*/
+
+#include "hal.h"
+
+#include "led.h"
+
+
+void led_set(uint8_t usb_led)
+{
+    (void)usb_led;
+    if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
+        // output high
+        palSetPadMode(GPIOC, GPIOC_LED_GREEN, PAL_MODE_OUTPUT_PUSHPULL);
+        palSetPad(GPIOC, GPIOC_LED_GREEN);
+    } else {
+        // Hi-Z
+        palSetPadMode(GPIOC, GPIOC_LED_GREEN, PAL_MODE_INPUT);
+    }
+}
diff --git a/keyboards/chibios_test/stm32_f072_onekey/matrix.c b/keyboards/chibios_test/stm32_f072_onekey/matrix.c
new file mode 100644 (file)
index 0000000..a05b38c
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+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/>.
+*/
+
+#include "ch.h"
+#include "hal.h"
+
+/*
+ * scan matrix
+ */
+#include "print.h"
+#include "debug.h"
+#include "util.h"
+#include "matrix.h"
+#include "wait.h"
+
+#ifndef DEBOUNCE
+#   define DEBOUNCE 5
+#endif
+static uint8_t debouncing = DEBOUNCE;
+
+/* matrix state(1:on, 0:off) */
+static matrix_row_t matrix[MATRIX_ROWS];
+static matrix_row_t matrix_debouncing[MATRIX_ROWS];
+
+static matrix_row_t read_cols(void);
+static void init_cols(void);
+static void unselect_rows(void);
+static void select_row(uint8_t row);
+
+
+inline
+uint8_t matrix_rows(void)
+{
+    return MATRIX_ROWS;
+}
+
+inline
+uint8_t matrix_cols(void)
+{
+    return MATRIX_COLS;
+}
+
+#define LED_ON()    do { palSetPad(GPIOC, GPIOC_LED_BLUE) ;} while (0)
+#define LED_OFF()   do { palClearPad(GPIOC, GPIOC_LED_BLUE); } while (0)
+#define LED_TGL()   do { palTogglePad(GPIOC, GPIOC_LED_BLUE); } while (0)
+
+void matrix_init(void)
+{
+    // initialize row and col
+    unselect_rows();
+    init_cols();
+
+    // initialize matrix state: all keys off
+    for (uint8_t i=0; i < MATRIX_ROWS; i++) {
+        matrix[i] = 0;
+        matrix_debouncing[i] = 0;
+    }
+
+    //debug
+    debug_matrix = true;
+    LED_ON();
+    wait_ms(500);
+    LED_OFF();
+}
+
+uint8_t matrix_scan(void)
+{
+    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+        select_row(i);
+        wait_us(30);  // without this wait read unstable value.
+        matrix_row_t cols = read_cols();
+        if (matrix_debouncing[i] != cols) {
+            matrix_debouncing[i] = cols;
+            if (debouncing) {
+                debug("bounce!: "); debug_hex(debouncing); debug("\n");
+            }
+            debouncing = DEBOUNCE;
+        }
+        unselect_rows();
+    }
+
+    if (debouncing) {
+        if (--debouncing) {
+            wait_ms(1);
+        } else {
+            for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+                matrix[i] = matrix_debouncing[i];
+            }
+        }
+    }
+
+    return 1;
+}
+
+inline
+bool matrix_is_on(uint8_t row, uint8_t col)
+{
+    return (matrix[row] & ((matrix_row_t)1<<col));
+}
+
+inline
+matrix_row_t matrix_get_row(uint8_t row)
+{
+    return matrix[row];
+}
+
+void matrix_print(void)
+{
+    print("\nr/c 0123456789ABCDEF\n");
+    for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
+        phex(row); print(": ");
+        pbin_reverse16(matrix_get_row(row));
+        print("\n");
+    }
+}
+
+/* Column pin configuration
+ */
+static void  init_cols(void)
+{
+    // don't need pullup/down, since it's pulled down in hardware
+    palSetPadMode(GPIOA, GPIOA_BUTTON, PAL_MODE_INPUT);
+}
+
+/* Returns status of switches(1:on, 0:off) */
+static matrix_row_t read_cols(void)
+{
+    return ((palReadPad(GPIOA, GPIOA_BUTTON)==PAL_LOW) ? 0 : (1<<0));
+    // | ((palReadPad(...)==PAL_HIGH) ? 0 : (1<<1))
+}
+
+/* Row pin configuration
+ */
+static void unselect_rows(void)
+{
+    // palSetPadMode(GPIOA, GPIOA_PIN10, PAL_MODE_INPUT); // hi-Z
+}
+
+static void select_row(uint8_t row)
+{
+    (void)row;
+    // Output low to select
+    // switch (row) {
+    //     case 0:
+    //         palSetPadMode(GPIOA, GPIOA_PIN10, PAL_MODE_OUTPUT_PUSHPULL);
+    //         palSetPad(GPIOA, GPIOA_PIN10, PAL_LOW);
+    //         break;
+    // }
+}
diff --git a/keyboards/chibios_test/stm32_f072_onekey/mcuconf.h b/keyboards/chibios_test/stm32_f072_onekey/mcuconf.h
new file mode 100644 (file)
index 0000000..3d877aa
--- /dev/null
@@ -0,0 +1,171 @@
+/*\r
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
+\r
+    Licensed under the Apache License, Version 2.0 (the "License");\r
+    you may not use this file except in compliance with the License.\r
+    You may obtain a copy of the License at\r
+\r
+        http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+    Unless required by applicable law or agreed to in writing, software\r
+    distributed under the License is distributed on an "AS IS" BASIS,\r
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+    See the License for the specific language governing permissions and\r
+    limitations under the License.\r
+*/\r
+\r
+#ifndef _MCUCONF_H_\r
+#define _MCUCONF_H_\r
+\r
+/*\r
+ * STM32F0xx drivers configuration.\r
+ * The following settings override the default settings present in\r
+ * the various device driver implementation headers.\r
+ * Note that the settings for each driver only have effect if the whole\r
+ * driver is enabled in halconf.h.\r
+ *\r
+ * IRQ priorities:\r
+ * 3...0       Lowest...Highest.\r
+ *\r
+ * DMA priorities:\r
+ * 0...3        Lowest...Highest.\r
+ */\r
+\r
+#define STM32F0xx_MCUCONF\r
+\r
+/*\r
+ * HAL driver system settings.\r
+ */\r
+#define STM32_NO_INIT                       FALSE\r
+#define STM32_PVD_ENABLE                    FALSE\r
+#define STM32_PLS                           STM32_PLS_LEV0\r
+#define STM32_HSI_ENABLED                   TRUE\r
+#define STM32_HSI14_ENABLED                 TRUE\r
+#define STM32_HSI48_ENABLED                 FALSE\r
+#define STM32_LSI_ENABLED                   TRUE\r
+#define STM32_HSE_ENABLED                   FALSE\r
+#define STM32_LSE_ENABLED                   FALSE\r
+#define STM32_SW                            STM32_SW_PLL\r
+#define STM32_PLLSRC                        STM32_PLLSRC_HSI_DIV2\r
+#define STM32_PREDIV_VALUE                  1\r
+#define STM32_PLLMUL_VALUE                  12\r
+#define STM32_HPRE                          STM32_HPRE_DIV1\r
+#define STM32_PPRE                          STM32_PPRE_DIV1\r
+#define STM32_ADCSW                         STM32_ADCSW_HSI14\r
+#define STM32_ADCPRE                        STM32_ADCPRE_DIV4\r
+#define STM32_MCOSEL                        STM32_MCOSEL_NOCLOCK\r
+#define STM32_ADCPRE                        STM32_ADCPRE_DIV4\r
+#define STM32_ADCSW                         STM32_ADCSW_HSI14\r
+#define STM32_USBSW                         STM32_USBSW_HSI48\r
+#define STM32_CECSW                         STM32_CECSW_HSI\r
+#define STM32_I2C1SW                        STM32_I2C1SW_HSI\r
+#define STM32_USART1SW                      STM32_USART1SW_PCLK\r
+#define STM32_RTCSEL                        STM32_RTCSEL_LSI\r
+\r
+/*\r
+ * ADC driver system settings.\r
+ */\r
+#define STM32_ADC_USE_ADC1                  FALSE\r
+#define STM32_ADC_ADC1_DMA_PRIORITY         2\r
+#define STM32_ADC_IRQ_PRIORITY              2\r
+#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY     2\r
+\r
+/*\r
+ * EXT driver system settings.\r
+ */\r
+#define STM32_EXT_EXTI0_1_IRQ_PRIORITY      3\r
+#define STM32_EXT_EXTI2_3_IRQ_PRIORITY      3\r
+#define STM32_EXT_EXTI4_15_IRQ_PRIORITY     3\r
+#define STM32_EXT_EXTI16_IRQ_PRIORITY       3\r
+#define STM32_EXT_EXTI17_IRQ_PRIORITY       3\r
+\r
+/*\r
+ * GPT driver system settings.\r
+ */\r
+#define STM32_GPT_USE_TIM1                  FALSE\r
+#define STM32_GPT_USE_TIM2                  FALSE\r
+#define STM32_GPT_USE_TIM3                  FALSE\r
+#define STM32_GPT_USE_TIM14                 FALSE\r
+#define STM32_GPT_TIM1_IRQ_PRIORITY         2\r
+#define STM32_GPT_TIM2_IRQ_PRIORITY         2\r
+#define STM32_GPT_TIM3_IRQ_PRIORITY         2\r
+#define STM32_GPT_TIM14_IRQ_PRIORITY        2\r
+\r
+/*\r
+ * I2C driver system settings.\r
+ */\r
+#define STM32_I2C_USE_I2C1                  FALSE\r
+#define STM32_I2C_USE_I2C2                  FALSE\r
+#define STM32_I2C_BUSY_TIMEOUT              50\r
+#define STM32_I2C_I2C1_IRQ_PRIORITY         3\r
+#define STM32_I2C_I2C2_IRQ_PRIORITY         3\r
+#define STM32_I2C_USE_DMA                   TRUE\r
+#define STM32_I2C_I2C1_DMA_PRIORITY         1\r
+#define STM32_I2C_I2C2_DMA_PRIORITY         1\r
+#define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")\r
+\r
+/*\r
+ * ICU driver system settings.\r
+ */\r
+#define STM32_ICU_USE_TIM1                  FALSE\r
+#define STM32_ICU_USE_TIM2                  FALSE\r
+#define STM32_ICU_USE_TIM3                  FALSE\r
+#define STM32_ICU_TIM1_IRQ_PRIORITY         3\r
+#define STM32_ICU_TIM2_IRQ_PRIORITY         3\r
+#define STM32_ICU_TIM3_IRQ_PRIORITY         3\r
+\r
+/*\r
+ * PWM driver system settings.\r
+ */\r
+#define STM32_PWM_USE_ADVANCED              FALSE\r
+#define STM32_PWM_USE_TIM1                  FALSE\r
+#define STM32_PWM_USE_TIM2                  FALSE\r
+#define STM32_PWM_USE_TIM3                  FALSE\r
+#define STM32_PWM_TIM1_IRQ_PRIORITY         3\r
+#define STM32_PWM_TIM2_IRQ_PRIORITY         3\r
+#define STM32_PWM_TIM3_IRQ_PRIORITY         3\r
+\r
+/*\r
+ * SERIAL driver system settings.\r
+ */\r
+#define STM32_SERIAL_USE_USART1             FALSE\r
+#define STM32_SERIAL_USE_USART2             FALSE\r
+#define STM32_SERIAL_USART1_PRIORITY        3\r
+#define STM32_SERIAL_USART2_PRIORITY        3\r
+\r
+/*\r
+ * SPI driver system settings.\r
+ */\r
+#define STM32_SPI_USE_SPI1                  FALSE\r
+#define STM32_SPI_USE_SPI2                  FALSE\r
+#define STM32_SPI_SPI1_DMA_PRIORITY         1\r
+#define STM32_SPI_SPI2_DMA_PRIORITY         1\r
+#define STM32_SPI_SPI1_IRQ_PRIORITY         2\r
+#define STM32_SPI_SPI2_IRQ_PRIORITY         2\r
+#define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")\r
+\r
+/*\r
+ * ST driver system settings.\r
+ */\r
+#define STM32_ST_IRQ_PRIORITY               2\r
+#define STM32_ST_USE_TIMER                  2\r
+\r
+/*\r
+ * UART driver system settings.\r
+ */\r
+#define STM32_UART_USE_USART1               FALSE\r
+#define STM32_UART_USE_USART2               FALSE\r
+#define STM32_UART_USART1_IRQ_PRIORITY      3\r
+#define STM32_UART_USART2_IRQ_PRIORITY      3\r
+#define STM32_UART_USART1_DMA_PRIORITY      0\r
+#define STM32_UART_USART2_DMA_PRIORITY      0\r
+#define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")\r
+\r
+/*\r
+ * USB driver system settings.\r
+ */\r
+#define STM32_USB_USE_USB1                  TRUE\r
+#define STM32_USB_LOW_POWER_ON_SUSPEND      FALSE\r
+#define STM32_USB_USB1_LP_IRQ_PRIORITY      3\r
+\r
+#endif /* _MCUCONF_H_ */\r
diff --git a/keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.c b/keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.c
new file mode 100644 (file)
index 0000000..820d062
--- /dev/null
@@ -0,0 +1 @@
+#include "stm32_f072_onekey.h"
diff --git a/keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.h b/keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.h
new file mode 100644 (file)
index 0000000..0455ad3
--- /dev/null
@@ -0,0 +1,5 @@
+#ifndef STM32_F072_ONEKEY_H
+#define STM32_F072_ONEKEY_H
+#include "chibios_test.h"
+#endif
+
diff --git a/keyboards/chibios_test/stm32_f103_onekey/Makefile b/keyboards/chibios_test/stm32_f103_onekey/Makefile
new file mode 100644 (file)
index 0000000..307ca5b
--- /dev/null
@@ -0,0 +1,52 @@
+# project specific files
+SRC =  matrix.c \
+           led.c
+
+# GENERIC STM32F103C8T6 board - stm32duino bootloader
+OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000
+MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
+BOARD = GENERIC_STM32_F103
+
+# GENERIC STM32F103C8T6 board - no bootloader (programmer over serial or SWD)
+# OPT_DEFS =
+# MCU_LDSCRIPT = STM32F103x8
+# BOARD = GENERIC_STM32_F103
+
+# MAPLE MINI
+# OPT_DEFS = -DCORTEX_VTOR_INIT=0x5000
+# MCU_LDSCRIPT = STM32F103xB_maplemini_bootloader
+# BOARD = MAPLEMINI_STM32_F103
+
+## chip/board settings
+# the next two should match the directories in
+#  <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
+MCU_FAMILY = STM32
+MCU_SERIES = STM32F1xx
+# linker script to use
+# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
+#  or <this_dir>/ld/
+# startup code to use
+# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
+MCU_STARTUP = stm32f1xx
+# it should exist either in <chibios>/os/hal/boards/
+#  or <this_dir>/boards
+# Cortex version
+# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
+MCU  = cortex-m3
+# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
+ARMV = 7
+# If you want to be able to jump to bootloader from firmware on STM32 MCUs,
+# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in
+# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have
+# a custom board definition that you plan to reuse).
+# If you're not setting it here, leave it commented out.
+# It is chip dependent, the correct number can be looked up here (page 175):
+# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
+# This also requires a patch to chibios:
+#   <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
+#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
+
+
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
diff --git a/keyboards/chibios_test/stm32_f103_onekey/bootloader_defs.h b/keyboards/chibios_test/stm32_f103_onekey/bootloader_defs.h
new file mode 100644 (file)
index 0000000..0f45203
--- /dev/null
@@ -0,0 +1,10 @@
+/* Address for jumping to bootloader on STM32 chips. */
+/* It is chip dependent, the correct number can be looked up here (page 175):
+ * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
+ * This also requires a patch to chibios:
+ *  <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
+ */
+
+// STM32F103* does NOT have an USB bootloader in ROM (only serial),
+//  so setting anything here does not make much sense
+// #define STM32_BOOTLOADER_ADDRESS 0x1FFFC800
diff --git a/keyboards/chibios_test/stm32_f103_onekey/chconf.h b/keyboards/chibios_test/stm32_f103_onekey/chconf.h
new file mode 100644 (file)
index 0000000..dfb1f9d
--- /dev/null
@@ -0,0 +1,524 @@
+/*
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+/**
+ * @file    templates/chconf.h
+ * @brief   Configuration file template.
+ * @details A copy of this file must be placed in each project directory, it
+ *          contains the application specific kernel settings.
+ *
+ * @addtogroup config
+ * @details Kernel related settings and hooks.
+ * @{
+ */
+
+#ifndef CHCONF_H
+#define CHCONF_H
+
+#define _CHIBIOS_RT_CONF_
+
+/*===========================================================================*/
+/**
+ * @name System timers settings
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   System time counter resolution.
+ * @note    Allowed values are 16 or 32 bits.
+ */
+#define CH_CFG_ST_RESOLUTION                16
+
+/**
+ * @brief   System tick frequency.
+ * @details Frequency of the system timer that drives the system ticks. This
+ *          setting also defines the system tick time unit.
+ */
+#define CH_CFG_ST_FREQUENCY                 2000
+
+/**
+ * @brief   Time delta constant for the tick-less mode.
+ * @note    If this value is zero then the system uses the classic
+ *          periodic tick. This value represents the minimum number
+ *          of ticks that is safe to specify in a timeout directive.
+ *          The value one is not valid, timeouts are rounded up to
+ *          this value.
+ */
+#define CH_CFG_ST_TIMEDELTA                 2
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Kernel parameters and options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Round robin interval.
+ * @details This constant is the number of system ticks allowed for the
+ *          threads before preemption occurs. Setting this value to zero
+ *          disables the preemption for threads with equal priority and the
+ *          round robin becomes cooperative. Note that higher priority
+ *          threads can still preempt, the kernel is always preemptive.
+ * @note    Disabling the round robin preemption makes the kernel more compact
+ *          and generally faster.
+ * @note    The round robin preemption is not supported in tickless mode and
+ *          must be set to zero in that case.
+ */
+#define CH_CFG_TIME_QUANTUM                 0
+
+/**
+ * @brief   Managed RAM size.
+ * @details Size of the RAM area to be managed by the OS. If set to zero
+ *          then the whole available RAM is used. The core memory is made
+ *          available to the heap allocator and/or can be used directly through
+ *          the simplified core memory allocator.
+ *
+ * @note    In order to let the OS manage the whole RAM the linker script must
+ *          provide the @p __heap_base__ and @p __heap_end__ symbols.
+ * @note    Requires @p CH_CFG_USE_MEMCORE.
+ */
+#define CH_CFG_MEMCORE_SIZE                 0
+
+/**
+ * @brief   Idle thread automatic spawn suppression.
+ * @details When this option is activated the function @p chSysInit()
+ *          does not spawn the idle thread. The application @p main()
+ *          function becomes the idle thread and must implement an
+ *          infinite loop.
+ */
+#define CH_CFG_NO_IDLE_THREAD               FALSE
+
+/* Use __WFI in the idle thread for waiting. Does lower the power
+ * consumption. */
+#define CORTEX_ENABLE_WFI_IDLE              TRUE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Performance options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   OS optimization.
+ * @details If enabled then time efficient rather than space efficient code
+ *          is used when two possible implementations exist.
+ *
+ * @note    This is not related to the compiler optimization options.
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_OPTIMIZE_SPEED               TRUE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Subsystem options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Time Measurement APIs.
+ * @details If enabled then the time measurement APIs are included in
+ *          the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_TM                       FALSE
+
+/**
+ * @brief   Threads registry APIs.
+ * @details If enabled then the registry APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_REGISTRY                 TRUE
+
+/**
+ * @brief   Threads synchronization APIs.
+ * @details If enabled then the @p chThdWait() function is included in
+ *          the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_WAITEXIT                 TRUE
+
+/**
+ * @brief   Semaphores APIs.
+ * @details If enabled then the Semaphores APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_SEMAPHORES               TRUE
+
+/**
+ * @brief   Semaphores queuing mode.
+ * @details If enabled then the threads are enqueued on semaphores by
+ *          priority rather than in FIFO order.
+ *
+ * @note    The default is @p FALSE. Enable this if you have special
+ *          requirements.
+ * @note    Requires @p CH_CFG_USE_SEMAPHORES.
+ */
+#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE
+
+/**
+ * @brief   Mutexes APIs.
+ * @details If enabled then the mutexes APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MUTEXES                  TRUE
+
+/**
+ * @brief   Enables recursive behavior on mutexes.
+ * @note    Recursive mutexes are heavier and have an increased
+ *          memory footprint.
+ *
+ * @note    The default is @p FALSE.
+ * @note    Requires @p CH_CFG_USE_MUTEXES.
+ */
+#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE
+
+/**
+ * @brief   Conditional Variables APIs.
+ * @details If enabled then the conditional variables APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_MUTEXES.
+ */
+#define CH_CFG_USE_CONDVARS                 TRUE
+
+/**
+ * @brief   Conditional Variables APIs with timeout.
+ * @details If enabled then the conditional variables APIs with timeout
+ *          specification are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_CONDVARS.
+ */
+#define CH_CFG_USE_CONDVARS_TIMEOUT         FALSE
+
+/**
+ * @brief   Events Flags APIs.
+ * @details If enabled then the event flags APIs are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_EVENTS                   TRUE
+
+/**
+ * @brief   Events Flags APIs with timeout.
+ * @details If enabled then the events APIs with timeout specification
+ *          are included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_EVENTS.
+ */
+#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE
+
+/**
+ * @brief   Synchronous Messages APIs.
+ * @details If enabled then the synchronous messages APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MESSAGES                 TRUE
+
+/**
+ * @brief   Synchronous Messages queuing mode.
+ * @details If enabled then messages are served by priority rather than in
+ *          FIFO order.
+ *
+ * @note    The default is @p FALSE. Enable this if you have special
+ *          requirements.
+ * @note    Requires @p CH_CFG_USE_MESSAGES.
+ */
+#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE
+
+/**
+ * @brief   Mailboxes APIs.
+ * @details If enabled then the asynchronous messages (mailboxes) APIs are
+ *          included in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_SEMAPHORES.
+ */
+#define CH_CFG_USE_MAILBOXES                TRUE
+
+/**
+ * @brief   Core Memory Manager APIs.
+ * @details If enabled then the core memory manager APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MEMCORE                  TRUE
+
+/**
+ * @brief   Heap Allocator APIs.
+ * @details If enabled then the memory heap allocator APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
+ *          @p CH_CFG_USE_SEMAPHORES.
+ * @note    Mutexes are recommended.
+ */
+#define CH_CFG_USE_HEAP                     TRUE
+
+/**
+ * @brief   Memory Pools Allocator APIs.
+ * @details If enabled then the memory pools allocator APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ */
+#define CH_CFG_USE_MEMPOOLS                 FALSE
+
+/**
+ * @brief   Dynamic Threads APIs.
+ * @details If enabled then the dynamic threads creation APIs are included
+ *          in the kernel.
+ *
+ * @note    The default is @p TRUE.
+ * @note    Requires @p CH_CFG_USE_WAITEXIT.
+ * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
+ */
+#define CH_CFG_USE_DYNAMIC                  FALSE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Debug options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Debug option, kernel statistics.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_STATISTICS                   FALSE
+
+/**
+ * @brief   Debug option, system state check.
+ * @details If enabled the correct call protocol for system APIs is checked
+ *          at runtime.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_SYSTEM_STATE_CHECK           FALSE
+
+/**
+ * @brief   Debug option, parameters checks.
+ * @details If enabled then the checks on the API functions input
+ *          parameters are activated.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_ENABLE_CHECKS                FALSE
+
+/**
+ * @brief   Debug option, consistency checks.
+ * @details If enabled then all the assertions in the kernel code are
+ *          activated. This includes consistency checks inside the kernel,
+ *          runtime anomalies and port-defined checks.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_ENABLE_ASSERTS               FALSE
+
+/**
+ * @brief   Debug option, trace buffer.
+ * @details If enabled then the trace buffer is activated.
+ *
+ * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
+ */
+#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
+
+/**
+ * @brief   Trace buffer entries.
+ * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
+ *          different from @p CH_DBG_TRACE_MASK_DISABLED.
+ */
+#define CH_DBG_TRACE_BUFFER_SIZE            128
+
+/**
+ * @brief   Debug option, stack checks.
+ * @details If enabled then a runtime stack check is performed.
+ *
+ * @note    The default is @p FALSE.
+ * @note    The stack check is performed in a architecture/port dependent way.
+ *          It may not be implemented or some ports.
+ * @note    The default failure mode is to halt the system with the global
+ *          @p panic_msg variable set to @p NULL.
+ */
+#define CH_DBG_ENABLE_STACK_CHECK           FALSE
+
+/**
+ * @brief   Debug option, stacks initialization.
+ * @details If enabled then the threads working area is filled with a byte
+ *          value when a thread is created. This can be useful for the
+ *          runtime measurement of the used stack.
+ *
+ * @note    The default is @p FALSE.
+ */
+#define CH_DBG_FILL_THREADS                 FALSE
+
+/**
+ * @brief   Debug option, threads profiling.
+ * @details If enabled then a field is added to the @p thread_t structure that
+ *          counts the system ticks occurred while executing the thread.
+ *
+ * @note    The default is @p FALSE.
+ * @note    This debug option is not currently compatible with the
+ *          tickless mode.
+ */
+#define CH_DBG_THREADS_PROFILING            FALSE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Kernel hooks
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief   Threads descriptor structure extension.
+ * @details User fields added to the end of the @p thread_t structure.
+ */
+#define CH_CFG_THREAD_EXTRA_FIELDS                                          \
+  /* Add threads custom fields here.*/
+
+/**
+ * @brief   Threads initialization hook.
+ * @details User initialization code added to the @p chThdInit() API.
+ *
+ * @note    It is invoked from within @p chThdInit() and implicitly from all
+ *          the threads creation APIs.
+ */
+#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
+  /* Add threads initialization code here.*/                                \
+}
+
+/**
+ * @brief   Threads finalization hook.
+ * @details User finalization code added to the @p chThdExit() API.
+ */
+#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
+  /* Add threads finalization code here.*/                                  \
+}
+
+/**
+ * @brief   Context switch hook.
+ * @details This hook is invoked just before switching between threads.
+ */
+#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \
+  /* Context switch code here.*/                                            \
+}
+
+/**
+ * @brief   ISR enter hook.
+ */
+#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
+  /* IRQ prologue code here.*/                                              \
+}
+
+/**
+ * @brief   ISR exit hook.
+ */
+#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
+  /* IRQ epilogue code here.*/                                              \
+}
+
+/**
+ * @brief   Idle thread enter hook.
+ * @note    This hook is invoked within a critical zone, no OS functions
+ *          should be invoked from here.
+ * @note    This macro can be used to activate a power saving mode.
+ */
+#define CH_CFG_IDLE_ENTER_HOOK() {                                          \
+  /* Idle-enter code here.*/                                                \
+}
+
+/**
+ * @brief   Idle thread leave hook.
+ * @note    This hook is invoked within a critical zone, no OS functions
+ *          should be invoked from here.
+ * @note    This macro can be used to deactivate a power saving mode.
+ */
+#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
+  /* Idle-leave code here.*/                                                \
+}
+
+/**
+ * @brief   Idle Loop hook.
+ * @details This hook is continuously invoked by the idle thread loop.
+ */
+#define CH_CFG_IDLE_LOOP_HOOK() {                                           \
+  /* Idle loop code here.*/                                                 \
+}
+
+/**
+ * @brief   System tick event hook.
+ * @details This hook is invoked in the system tick handler immediately
+ *          after processing the virtual timers queue.
+ */
+#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \
+  /* System tick event code here.*/                                         \
+}
+
+/**
+ * @brief   System halt hook.
+ * @details This hook is invoked in case to a system halting error before
+ *          the system is halted.
+ */
+#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
+  /* System halt code here.*/                                               \
+}
+
+/**
+ * @brief   Trace hook.
+ * @details This hook is invoked each time a new record is written in the
+ *          trace buffer.
+ */
+#define CH_CFG_TRACE_HOOK(tep) {                                            \
+  /* Trace code here.*/                                                     \
+}
+
+/** @} */
+
+/*===========================================================================*/
+/* Port-specific settings (override port settings defaulted in chcore.h).    */
+/*===========================================================================*/
+
+#endif  /* CHCONF_H */
+
+/** @} */
diff --git a/keyboards/chibios_test/stm32_f103_onekey/config.h b/keyboards/chibios_test/stm32_f103_onekey/config.h
new file mode 100644 (file)
index 0000000..de0b906
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef KEYBOARDS_CHIBIOS_TEST_STM32_F103_ONEKEY_CONFIG_H_
+#define KEYBOARDS_CHIBIOS_TEST_STM32_F103_ONEKEY_CONFIG_H_
+
+#include "../config.h"
+
+#endif /* KEYBOARDS_CHIBIOS_TEST_STM32_F103_ONEKEY_CONFIG_H_ */
diff --git a/keyboards/chibios_test/stm32_f103_onekey/flash.sh b/keyboards/chibios_test/stm32_f103_onekey/flash.sh
new file mode 100755 (executable)
index 0000000..15501df
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/bash
+Arduino_STM32_usb_hid/tools/linux/maple_upload ttyACM0 2 1EAF:0003 build/ch.bin
diff --git a/keyboards/chibios_test/stm32_f103_onekey/halconf.h b/keyboards/chibios_test/stm32_f103_onekey/halconf.h
new file mode 100644 (file)
index 0000000..1a450d6
--- /dev/null
@@ -0,0 +1,353 @@
+/*
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+/**
+ * @file    templates/halconf.h
+ * @brief   HAL configuration header.
+ * @details HAL configuration file, this file allows to enable or disable the
+ *          various device drivers from your application. You may also use
+ *          this file in order to override the device drivers default settings.
+ *
+ * @addtogroup HAL_CONF
+ * @{
+ */
+
+#ifndef _HALCONF_H_
+#define _HALCONF_H_
+
+#include "mcuconf.h"
+
+/**
+ * @brief   Enables the PAL subsystem.
+ */
+#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
+#define HAL_USE_PAL                 TRUE
+#endif
+
+/**
+ * @brief   Enables the ADC subsystem.
+ */
+#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
+#define HAL_USE_ADC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the CAN subsystem.
+ */
+#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
+#define HAL_USE_CAN                 FALSE
+#endif
+
+/**
+ * @brief   Enables the DAC subsystem.
+ */
+#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
+#define HAL_USE_DAC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the EXT subsystem.
+ */
+#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
+#define HAL_USE_EXT                 FALSE
+#endif
+
+/**
+ * @brief   Enables the GPT subsystem.
+ */
+#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
+#define HAL_USE_GPT                 FALSE
+#endif
+
+/**
+ * @brief   Enables the I2C subsystem.
+ */
+#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
+#define HAL_USE_I2C                 FALSE
+#endif
+
+/**
+ * @brief   Enables the I2S subsystem.
+ */
+#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
+#define HAL_USE_I2S                 FALSE
+#endif
+
+/**
+ * @brief   Enables the ICU subsystem.
+ */
+#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
+#define HAL_USE_ICU                 FALSE
+#endif
+
+/**
+ * @brief   Enables the MAC subsystem.
+ */
+#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
+#define HAL_USE_MAC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the MMC_SPI subsystem.
+ */
+#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
+#define HAL_USE_MMC_SPI             FALSE
+#endif
+
+/**
+ * @brief   Enables the PWM subsystem.
+ */
+#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
+#define HAL_USE_PWM                 FALSE
+#endif
+
+/**
+ * @brief   Enables the RTC subsystem.
+ */
+#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
+#define HAL_USE_RTC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the SDC subsystem.
+ */
+#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
+#define HAL_USE_SDC                 FALSE
+#endif
+
+/**
+ * @brief   Enables the SERIAL subsystem.
+ */
+#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
+#define HAL_USE_SERIAL              FALSE
+#endif
+
+/**
+ * @brief   Enables the SERIAL over USB subsystem.
+ */
+#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
+#define HAL_USE_SERIAL_USB          FALSE
+#endif
+
+/**
+ * @brief   Enables the SPI subsystem.
+ */
+#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
+#define HAL_USE_SPI                 FALSE
+#endif
+
+/**
+ * @brief   Enables the UART subsystem.
+ */
+#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
+#define HAL_USE_UART                FALSE
+#endif
+
+/**
+ * @brief   Enables the USB subsystem.
+ */
+#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
+#define HAL_USE_USB                 TRUE
+#endif
+
+/**
+ * @brief   Enables the WDG subsystem.
+ */
+#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
+#define HAL_USE_WDG                 FALSE
+#endif
+
+/*===========================================================================*/
+/* ADC driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables synchronous APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
+#define ADC_USE_WAIT                TRUE
+#endif
+
+/**
+ * @brief   Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
+#define ADC_USE_MUTUAL_EXCLUSION    TRUE
+#endif
+
+/*===========================================================================*/
+/* CAN driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Sleep mode related APIs inclusion switch.
+ */
+#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
+#define CAN_USE_SLEEP_MODE          TRUE
+#endif
+
+/*===========================================================================*/
+/* I2C driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables the mutual exclusion APIs on the I2C bus.
+ */
+#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
+#define I2C_USE_MUTUAL_EXCLUSION    TRUE
+#endif
+
+/*===========================================================================*/
+/* MAC driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables an event sources for incoming packets.
+ */
+#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
+#define MAC_USE_ZERO_COPY           FALSE
+#endif
+
+/**
+ * @brief   Enables an event sources for incoming packets.
+ */
+#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
+#define MAC_USE_EVENTS              TRUE
+#endif
+
+/*===========================================================================*/
+/* MMC_SPI driver related settings.                                          */
+/*===========================================================================*/
+
+/**
+ * @brief   Delays insertions.
+ * @details If enabled this options inserts delays into the MMC waiting
+ *          routines releasing some extra CPU time for the threads with
+ *          lower priority, this may slow down the driver a bit however.
+ *          This option is recommended also if the SPI driver does not
+ *          use a DMA channel and heavily loads the CPU.
+ */
+#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
+#define MMC_NICE_WAITING            TRUE
+#endif
+
+/*===========================================================================*/
+/* SDC driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Number of initialization attempts before rejecting the card.
+ * @note    Attempts are performed at 10mS intervals.
+ */
+#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
+#define SDC_INIT_RETRY              100
+#endif
+
+/**
+ * @brief   Include support for MMC cards.
+ * @note    MMC support is not yet implemented so this option must be kept
+ *          at @p FALSE.
+ */
+#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
+#define SDC_MMC_SUPPORT             FALSE
+#endif
+
+/**
+ * @brief   Delays insertions.
+ * @details If enabled this options inserts delays into the MMC waiting
+ *          routines releasing some extra CPU time for the threads with
+ *          lower priority, this may slow down the driver a bit however.
+ */
+#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
+#define SDC_NICE_WAITING            TRUE
+#endif
+
+/*===========================================================================*/
+/* SERIAL driver related settings.                                           */
+/*===========================================================================*/
+
+/**
+ * @brief   Default bit rate.
+ * @details Configuration parameter, this is the baud rate selected for the
+ *          default configuration.
+ */
+#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
+#define SERIAL_DEFAULT_BITRATE      38400
+#endif
+
+/**
+ * @brief   Serial buffers size.
+ * @details Configuration parameter, you can change the depth of the queue
+ *          buffers depending on the requirements of your application.
+ * @note    The default is 64 bytes for both the transmission and receive
+ *          buffers.
+ */
+#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
+#define SERIAL_BUFFERS_SIZE         16
+#endif
+
+/*===========================================================================*/
+/* SERIAL_USB driver related setting.                                        */
+/*===========================================================================*/
+
+/**
+ * @brief   Serial over USB buffers size.
+ * @details Configuration parameter, the buffer size must be a multiple of
+ *          the USB data endpoint maximum packet size.
+ * @note    The default is 64 bytes for both the transmission and receive
+ *          buffers.
+ */
+#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
+#define SERIAL_USB_BUFFERS_SIZE     256
+#endif
+
+/*===========================================================================*/
+/* SPI driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables synchronous APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
+#define SPI_USE_WAIT                TRUE
+#endif
+
+/**
+ * @brief   Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
+#define SPI_USE_MUTUAL_EXCLUSION    TRUE
+#endif
+
+/*===========================================================================*/
+/* USB driver related settings.                                              */
+/*===========================================================================*/
+
+/**
+ * @brief   Enables synchronous APIs.
+ * @note    Disabling this option saves both code and data space.
+ */
+#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
+#define USB_USE_WAIT                TRUE
+#endif
+
+#endif /* _HALCONF_H_ */
+
+/** @} */
diff --git a/keyboards/chibios_test/stm32_f103_onekey/led.c b/keyboards/chibios_test/stm32_f103_onekey/led.c
new file mode 100644 (file)
index 0000000..f5c55f7
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+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/>.
+*/
+
+#include "hal.h"
+#include "led.h"
+
+
+void led_set(uint8_t usb_led)
+{
+    if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
+       /* generic STM32F103C8T6 board */
+#ifdef BOARD_GENERIC_STM32_F103
+        palClearPad(GPIOC, 13);
+#endif
+        /* Maple Mini */
+#ifdef BOARD_MAPLEMINI_STM32_F103
+        palSetPad(GPIOB, 1);
+#endif
+    } else {
+       /* generic STM32F103C8T6 board */
+#ifdef BOARD_GENERIC_STM32_F103
+       palSetPad(GPIOC, 13);
+#endif
+        /* Maple Mini */
+#ifdef BOARD_MAPLEMINI_STM32_F103
+        palClearPad(GPIOB,1);
+#endif
+    }
+}
diff --git a/keyboards/chibios_test/stm32_f103_onekey/matrix.c b/keyboards/chibios_test/stm32_f103_onekey/matrix.c
new file mode 100644 (file)
index 0000000..ea9d8d0
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+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/>.
+*/
+
+#include "ch.h"
+#include "hal.h"
+
+/*
+ * scan matrix
+ */
+#include "print.h"
+#include "debug.h"
+#include "util.h"
+#include "matrix.h"
+#include "wait.h"
+
+#ifndef DEBOUNCE
+#   define DEBOUNCE 5
+#endif
+static uint8_t debouncing = DEBOUNCE;
+
+/* matrix state(1:on, 0:off) */
+static matrix_row_t matrix[MATRIX_ROWS];
+static matrix_row_t matrix_debouncing[MATRIX_ROWS];
+
+static matrix_row_t read_cols(void);
+static void init_cols(void);
+static void unselect_rows(void);
+static void select_row(uint8_t row);
+
+
+inline
+uint8_t matrix_rows(void)
+{
+    return MATRIX_ROWS;
+}
+
+inline
+uint8_t matrix_cols(void)
+{
+    return MATRIX_COLS;
+}
+
+/* generic STM32F103C8T6 board */
+#ifdef BOARD_GENERIC_STM32_F103
+#define LED_ON()    do { palClearPad(GPIOC, GPIOC_LED) ;} while (0)
+#define LED_OFF()   do { palSetPad(GPIOC, GPIOC_LED); } while (0)
+#define LED_TGL()   do { palTogglePad(GPIOC, GPIOC_LED); } while (0)
+#endif
+
+/* Maple Mini */
+#ifdef BOARD_MAPLEMINI_STM32_F103
+#define LED_ON()    do { palSetPad(GPIOB, 1) ;} while (0)
+#define LED_OFF()   do { palClearPad(GPIOB, 1); } while (0)
+#define LED_TGL()   do { palTogglePad(GPIOB, 1); } while (0)
+#endif
+
+void matrix_init(void)
+{
+    // initialize row and col
+    unselect_rows();
+    init_cols();
+
+    // initialize matrix state: all keys off
+    for (uint8_t i=0; i < MATRIX_ROWS; i++) {
+        matrix[i] = 0;
+        matrix_debouncing[i] = 0;
+    }
+
+    //debug
+    debug_matrix = true;
+    LED_ON();
+    wait_ms(500);
+    LED_OFF();
+}
+
+uint8_t matrix_scan(void)
+{
+    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+        select_row(i);
+        wait_us(30);  // without this wait read unstable value.
+        matrix_row_t cols = read_cols();
+        if (matrix_debouncing[i] != cols) {
+            matrix_debouncing[i] = cols;
+            if (debouncing) {
+                debug("bounce!: "); debug_hex(debouncing); debug("\n");
+            }
+            debouncing = DEBOUNCE;
+        }
+        unselect_rows();
+    }
+
+    if (debouncing) {
+        if (--debouncing) {
+            wait_ms(1);
+        } else {
+            for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+                matrix[i] = matrix_debouncing[i];
+            }
+        }
+    }
+
+    return 1;
+}
+
+inline
+bool matrix_is_on(uint8_t row, uint8_t col)
+{
+    return (matrix[row] & ((matrix_row_t)1<<col));
+}
+
+inline
+matrix_row_t matrix_get_row(uint8_t row)
+{
+    return matrix[row];
+}
+
+void matrix_print(void)
+{
+    print("\nr/c 0123456789ABCDEF\n");
+    for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
+        phex(row); print(": ");
+        pbin_reverse16(matrix_get_row(row));
+        print("\n");
+    }
+}
+
+/* Column pin configuration
+ */
+static void  init_cols(void)
+{
+#ifdef BOARD_MAPLEMINI_STM32_F103
+    // don't need pullup/down, since it's pulled down in hardware
+    palSetPadMode(GPIOB, 8, PAL_MODE_INPUT);
+#else
+    palSetPadMode(GPIOB, 8, PAL_MODE_INPUT_PULLDOWN);
+#endif
+}
+
+/* Returns status of switches(1:on, 0:off) */
+static matrix_row_t read_cols(void)
+{
+    return ((palReadPad(GPIOB, 8)==PAL_LOW) ? 0 : (1<<0));
+    // | ((palReadPad(...)==PAL_HIGH) ? 0 : (1<<1))
+}
+
+/* Row pin configuration
+ */
+static void unselect_rows(void)
+{
+    // palSetPadMode(GPIOA, GPIOA_PIN10, PAL_MODE_INPUT); // hi-Z
+}
+
+static void select_row(uint8_t row)
+{
+    (void)row;
+    // Output low to select
+    // switch (row) {
+    //     case 0:
+    //         palSetPadMode(GPIOA, GPIOA_PIN10, PAL_MODE_OUTPUT_PUSHPULL);
+    //         palSetPad(GPIOA, GPIOA_PIN10, PAL_LOW);
+    //         break;
+    // }
+}
diff --git a/keyboards/chibios_test/stm32_f103_onekey/mcuconf.h b/keyboards/chibios_test/stm32_f103_onekey/mcuconf.h
new file mode 100644 (file)
index 0000000..626332a
--- /dev/null
@@ -0,0 +1,209 @@
+/*\r
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
+\r
+    Licensed under the Apache License, Version 2.0 (the "License");\r
+    you may not use this file except in compliance with the License.\r
+    You may obtain a copy of the License at\r
+\r
+        http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+    Unless required by applicable law or agreed to in writing, software\r
+    distributed under the License is distributed on an "AS IS" BASIS,\r
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+    See the License for the specific language governing permissions and\r
+    limitations under the License.\r
+*/\r
+\r
+#ifndef _MCUCONF_H_\r
+#define _MCUCONF_H_\r
+\r
+#define STM32F103_MCUCONF\r
+\r
+/*\r
+ * STM32F103 drivers configuration.\r
+ * The following settings override the default settings present in\r
+ * the various device driver implementation headers.\r
+ * Note that the settings for each driver only have effect if the whole\r
+ * driver is enabled in halconf.h.\r
+ *\r
+ * IRQ priorities:\r
+ * 15...0       Lowest...Highest.\r
+ *\r
+ * DMA priorities:\r
+ * 0...3        Lowest...Highest.\r
+ */\r
+\r
+/*\r
+ * HAL driver system settings.\r
+ */\r
+#define STM32_NO_INIT                       FALSE\r
+#define STM32_HSI_ENABLED                   TRUE\r
+#define STM32_LSI_ENABLED                   FALSE\r
+#define STM32_HSE_ENABLED                   TRUE\r
+#define STM32_LSE_ENABLED                   FALSE\r
+#define STM32_SW                            STM32_SW_PLL\r
+#define STM32_PLLSRC                        STM32_PLLSRC_HSE\r
+#define STM32_PLLXTPRE                      STM32_PLLXTPRE_DIV1\r
+#define STM32_PLLMUL_VALUE                  9\r
+#define STM32_HPRE                          STM32_HPRE_DIV1\r
+#define STM32_PPRE1                         STM32_PPRE1_DIV2\r
+#define STM32_PPRE2                         STM32_PPRE2_DIV2\r
+#define STM32_ADCPRE                        STM32_ADCPRE_DIV4\r
+#define STM32_USB_CLOCK_REQUIRED            TRUE\r
+#define STM32_USBPRE                        STM32_USBPRE_DIV1P5\r
+#define STM32_MCOSEL                        STM32_MCOSEL_NOCLOCK\r
+#define STM32_RTCSEL                        STM32_RTCSEL_HSEDIV\r
+#define STM32_PVD_ENABLE                    FALSE\r
+#define STM32_PLS                           STM32_PLS_LEV0\r
+\r
+/*\r
+ * ADC driver system settings.\r
+ */\r
+#define STM32_ADC_USE_ADC1                  FALSE\r
+#define STM32_ADC_ADC1_DMA_PRIORITY         2\r
+#define STM32_ADC_ADC1_IRQ_PRIORITY         6\r
+\r
+/*\r
+ * CAN driver system settings.\r
+ */\r
+#define STM32_CAN_USE_CAN1                  FALSE\r
+#define STM32_CAN_CAN1_IRQ_PRIORITY         11\r
+\r
+/*\r
+ * EXT driver system settings.\r
+ */\r
+#define STM32_EXT_EXTI0_IRQ_PRIORITY        6\r
+#define STM32_EXT_EXTI1_IRQ_PRIORITY        6\r
+#define STM32_EXT_EXTI2_IRQ_PRIORITY        6\r
+#define STM32_EXT_EXTI3_IRQ_PRIORITY        6\r
+#define STM32_EXT_EXTI4_IRQ_PRIORITY        6\r
+#define STM32_EXT_EXTI5_9_IRQ_PRIORITY      6\r
+#define STM32_EXT_EXTI10_15_IRQ_PRIORITY    6\r
+#define STM32_EXT_EXTI16_IRQ_PRIORITY       6\r
+#define STM32_EXT_EXTI17_IRQ_PRIORITY       6\r
+#define STM32_EXT_EXTI18_IRQ_PRIORITY       6\r
+#define STM32_EXT_EXTI19_IRQ_PRIORITY       6\r
+\r
+/*\r
+ * GPT driver system settings.\r
+ */\r
+#define STM32_GPT_USE_TIM1                  FALSE\r
+#define STM32_GPT_USE_TIM2                  FALSE\r
+#define STM32_GPT_USE_TIM3                  FALSE\r
+#define STM32_GPT_USE_TIM4                  FALSE\r
+#define STM32_GPT_USE_TIM5                  FALSE\r
+#define STM32_GPT_USE_TIM8                  FALSE\r
+#define STM32_GPT_TIM1_IRQ_PRIORITY         7\r
+#define STM32_GPT_TIM2_IRQ_PRIORITY         7\r
+#define STM32_GPT_TIM3_IRQ_PRIORITY         7\r
+#define STM32_GPT_TIM4_IRQ_PRIORITY         7\r
+#define STM32_GPT_TIM5_IRQ_PRIORITY         7\r
+#define STM32_GPT_TIM8_IRQ_PRIORITY         7\r
+\r
+/*\r
+ * I2C driver system settings.\r
+ */\r
+#define STM32_I2C_USE_I2C1                  FALSE\r
+#define STM32_I2C_USE_I2C2                  FALSE\r
+#define STM32_I2C_BUSY_TIMEOUT              50\r
+#define STM32_I2C_I2C1_IRQ_PRIORITY         5\r
+#define STM32_I2C_I2C2_IRQ_PRIORITY         5\r
+#define STM32_I2C_I2C1_DMA_PRIORITY         3\r
+#define STM32_I2C_I2C2_DMA_PRIORITY         3\r
+#define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")\r
+\r
+/*\r
+ * ICU driver system settings.\r
+ */\r
+#define STM32_ICU_USE_TIM1                  FALSE\r
+#define STM32_ICU_USE_TIM2                  FALSE\r
+#define STM32_ICU_USE_TIM3                  FALSE\r
+#define STM32_ICU_USE_TIM4                  FALSE\r
+#define STM32_ICU_USE_TIM5                  FALSE\r
+#define STM32_ICU_USE_TIM8                  FALSE\r
+#define STM32_ICU_TIM1_IRQ_PRIORITY         7\r
+#define STM32_ICU_TIM2_IRQ_PRIORITY         7\r
+#define STM32_ICU_TIM3_IRQ_PRIORITY         7\r
+#define STM32_ICU_TIM4_IRQ_PRIORITY         7\r
+#define STM32_ICU_TIM5_IRQ_PRIORITY         7\r
+#define STM32_ICU_TIM8_IRQ_PRIORITY         7\r
+\r
+/*\r
+ * PWM driver system settings.\r
+ */\r
+#define STM32_PWM_USE_ADVANCED              FALSE\r
+#define STM32_PWM_USE_TIM1                  FALSE\r
+#define STM32_PWM_USE_TIM2                  FALSE\r
+#define STM32_PWM_USE_TIM3                  FALSE\r
+#define STM32_PWM_USE_TIM4                  FALSE\r
+#define STM32_PWM_USE_TIM5                  FALSE\r
+#define STM32_PWM_USE_TIM8                  FALSE\r
+#define STM32_PWM_TIM1_IRQ_PRIORITY         7\r
+#define STM32_PWM_TIM2_IRQ_PRIORITY         7\r
+#define STM32_PWM_TIM3_IRQ_PRIORITY         7\r
+#define STM32_PWM_TIM4_IRQ_PRIORITY         7\r
+#define STM32_PWM_TIM5_IRQ_PRIORITY         7\r
+#define STM32_PWM_TIM8_IRQ_PRIORITY         7\r
+\r
+/*\r
+ * RTC driver system settings.\r
+ */\r
+#define STM32_RTC_IRQ_PRIORITY              15\r
+\r
+/*\r
+ * SERIAL driver system settings.\r
+ */\r
+#define STM32_SERIAL_USE_USART1             FALSE\r
+#define STM32_SERIAL_USE_USART2             FALSE\r
+#define STM32_SERIAL_USE_USART3             FALSE\r
+#define STM32_SERIAL_USE_UART4              FALSE\r
+#define STM32_SERIAL_USE_UART5              FALSE\r
+#define STM32_SERIAL_USART1_PRIORITY        12\r
+#define STM32_SERIAL_USART2_PRIORITY        12\r
+#define STM32_SERIAL_USART3_PRIORITY        12\r
+#define STM32_SERIAL_UART4_PRIORITY         12\r
+#define STM32_SERIAL_UART5_PRIORITY         12\r
+\r
+/*\r
+ * SPI driver system settings.\r
+ */\r
+#define STM32_SPI_USE_SPI1                  FALSE\r
+#define STM32_SPI_USE_SPI2                  FALSE\r
+#define STM32_SPI_USE_SPI3                  FALSE\r
+#define STM32_SPI_SPI1_DMA_PRIORITY         1\r
+#define STM32_SPI_SPI2_DMA_PRIORITY         1\r
+#define STM32_SPI_SPI3_DMA_PRIORITY         1\r
+#define STM32_SPI_SPI1_IRQ_PRIORITY         10\r
+#define STM32_SPI_SPI2_IRQ_PRIORITY         10\r
+#define STM32_SPI_SPI3_IRQ_PRIORITY         10\r
+#define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")\r
+\r
+/*\r
+ * ST driver system settings.\r
+ */\r
+#define STM32_ST_IRQ_PRIORITY               8\r
+#define STM32_ST_USE_TIMER                  2\r
+\r
+/*\r
+ * UART driver system settings.\r
+ */\r
+#define STM32_UART_USE_USART1               FALSE\r
+#define STM32_UART_USE_USART2               FALSE\r
+#define STM32_UART_USE_USART3               FALSE\r
+#define STM32_UART_USART1_IRQ_PRIORITY      12\r
+#define STM32_UART_USART2_IRQ_PRIORITY      12\r
+#define STM32_UART_USART3_IRQ_PRIORITY      12\r
+#define STM32_UART_USART1_DMA_PRIORITY      0\r
+#define STM32_UART_USART2_DMA_PRIORITY      0\r
+#define STM32_UART_USART3_DMA_PRIORITY      0\r
+#define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")\r
+\r
+/*\r
+ * USB driver system settings.\r
+ */\r
+#define STM32_USB_USE_USB1                  TRUE\r
+#define STM32_USB_LOW_POWER_ON_SUSPEND      FALSE\r
+#define STM32_USB_USB1_HP_IRQ_PRIORITY      13\r
+#define STM32_USB_USB1_LP_IRQ_PRIORITY      14\r
+\r
+#endif /* _MCUCONF_H_ */\r
diff --git a/keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.c b/keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.c
new file mode 100644 (file)
index 0000000..7fa99bb
--- /dev/null
@@ -0,0 +1 @@
+#include "stm32_f103_onekey.h"
diff --git a/keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.h b/keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.h
new file mode 100644 (file)
index 0000000..89a62b2
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef STM32_F103_ONEKEY_H
+#define STM32_F103_ONEKEY_H
+#include "chibios_test.h"
+#endif
diff --git a/keyboards/chibios_test/teensy_lc_onekey/Makefile b/keyboards/chibios_test/teensy_lc_onekey/Makefile
new file mode 100644 (file)
index 0000000..43ea9d8
--- /dev/null
@@ -0,0 +1,49 @@
+# project specific files
+SRC =  matrix.c \
+           led.c
+
+## chip/board settings
+# - the next two should match the directories in
+#   <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
+# - For Teensies, FAMILY = KINETIS and SERIES is either
+#   KL2x (LC) or K20x (3.0,3.1,3.2).
+MCU_FAMILY = KINETIS
+MCU_SERIES = KL2x
+
+# Linker script to use
+# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
+#   or <this_dir>/ld/
+# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
+# - LDSCRIPT =
+#   - MKL26Z64 for Teensy LC
+#   - MK20DX128 for Teensy 3.0
+#   - MK20DX256 for Teensy 3.1 and 3.2
+MCU_LDSCRIPT = MKL26Z64
+
+# Startup code to use
+#  - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
+# - STARTUP =
+#   - kl2x for Teensy LC
+#   - k20x5 for Teensy 3.0
+#   - k20x7 for Teensy 3.1 and 3.2
+MCU_STARTUP = kl2x
+
+# Board: it should exist either in <chibios>/os/hal/boards/
+#  or <this_dir>/boards
+# - BOARD =
+#   - PJRC_TEENSY_LC for Teensy LC
+#   - PJRC_TEENSY_3 for Teensy 3.0
+#   - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
+BOARD = PJRC_TEENSY_LC
+
+# Cortex version
+# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4
+MCU  = cortex-m0plus
+
+# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
+# I.e. 6 for Teensy LC; 7 for Teensy 3.x
+ARMV = 6
+
+ifndef QUANTUM_DIR
+       include ../../../Makefile
+endif
\ No newline at end of file
diff --git a/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.0 b/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.0
new file mode 100644 (file)
index 0000000..dbf12c3
--- /dev/null
@@ -0,0 +1,77 @@
+# Target file name (without extension).
+PROJECT = ch
+
+# Directory common source files exist
+TMK_DIR = ../../tmk_core
+
+# Directory keyboard dependent files exist
+TARGET_DIR = .
+
+# project specific files
+SRC =  matrix.c \
+           led.c
+
+ifdef KEYMAP
+    SRC := keymap_$(KEYMAP).c $(SRC)
+else
+    SRC := keymap_plain.c $(SRC)
+endif
+
+CONFIG_H = config.h
+
+## chip/board settings
+# - the next two should match the directories in
+#   <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
+# - For Teensies, FAMILY = KINETIS and SERIES is either
+#   KL2x (LC) or K20x (3.0,3.1,3.2).
+MCU_FAMILY = KINETIS
+MCU_SERIES = K20x
+
+# Linker script to use
+# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
+#   or <this_dir>/ld/
+# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
+# - LDSCRIPT =
+#   - MKL26Z64 for Teensy LC
+#   - MK20DX128 for Teensy 3.0
+#   - MK20DX256 for Teensy 3.1 and 3.2
+MCU_LDSCRIPT = MK20DX128
+
+# Startup code to use
+#  - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
+# - STARTUP =
+#   - kl2x for Teensy LC
+#   - k20x5 for Teensy 3.0
+#   - k20x7 for Teensy 3.1 and 3.2
+MCU_STARTUP = k20x5
+
+# Board: it should exist either in <chibios>/os/hal/boards/
+#  or <this_dir>/boards
+# - BOARD =
+#   - PJRC_TEENSY_LC for Teensy LC
+#   - PJRC_TEENSY_3 for Teensy 3.0
+#   - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
+BOARD = PJRC_TEENSY_3
+
+# Cortex version
+# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
+MCU  = cortex-m4
+
+# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
+# I.e. 6 for Teensy LC; 7 for Teensy 3.x
+ARMV = 7
+
+# Build Options
+#   comment out to disable the options.
+#
+BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
+## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
+MOUSEKEY_ENABLE = yes  # Mouse keys
+EXTRAKEY_ENABLE = yes  # Audio control and System control
+CONSOLE_ENABLE = yes   # Console for debug
+COMMAND_ENABLE = yes    # Commands for debug and configuration
+SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
+NKRO_ENABLE = yes          # USB Nkey Rollover
+
+include $(TMK_DIR)/tool/chibios/common.mk
+include $(TMK_DIR)/tool/chibios/chibios.mk
diff --git a/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.2 b/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.2
new file mode 100644 (file)
index 0000000..41bfa41
--- /dev/null
@@ -0,0 +1,77 @@
+# Target file name (without extension).
+PROJECT = ch
+
+# Directory common source files exist
+TMK_DIR = ../../tmk_core
+
+# Directory keyboard dependent files exist
+TARGET_DIR = .
+
+# project specific files
+SRC =  matrix.c \
+           led.c
+
+ifdef KEYMAP
+    SRC := keymap_$(KEYMAP).c $(SRC)
+else
+    SRC := keymap_plain.c $(SRC)
+endif
+
+CONFIG_H = config.h
+
+## chip/board settings
+# - the next two should match the directories in
+#   <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
+# - For Teensies, FAMILY = KINETIS and SERIES is either
+#   KL2x (LC) or K20x (3.0,3.1,3.2).
+MCU_FAMILY = KINETIS
+MCU_SERIES = K20x
+
+# Linker script to use
+# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
+#   or <this_dir>/ld/
+# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
+# - LDSCRIPT =
+#   - MKL26Z64 for Teensy LC
+#   - MK20DX128 for Teensy 3.0
+#   - MK20DX256 for Teensy 3.1 and 3.2
+MCU_LDSCRIPT = MK20DX256
+
+# Startup code to use
+#  - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
+# - STARTUP =
+#   - kl2x for Teensy LC
+#   - k20x5 for Teensy 3.0
+#   - k20x7 for Teensy 3.1 and 3.2
+MCU_STARTUP = k20x7
+
+# Board: it should exist either in <chibios>/os/hal/boards/
+#  or <this_dir>/boards
+# - BOARD =
+#   - PJRC_TEENSY_LC for Teensy LC
+#   - PJRC_TEENSY_3 for Teensy 3.0
+#   - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
+BOARD = PJRC_TEENSY_3_1
+
+# Cortex version
+# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
+MCU  = cortex-m4
+
+# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
+# I.e. 6 for Teensy LC; 7 for Teensy 3.x
+ARMV = 7
+
+# Build Options
+#   comment out to disable the options.
+#
+BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
+## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
+MOUSEKEY_ENABLE = yes  # Mouse keys
+EXTRAKEY_ENABLE = yes  # Audio control and System control
+CONSOLE_ENABLE = yes   # Console for debug
+COMMAND_ENABLE = yes    # Commands for debug and configuration
+SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
+NKRO_ENABLE = yes          # USB Nkey Rollover
+
+include $(TMK_DIR)/tool/chibios/common.mk
+include $(TMK_DIR)/tool/chibios/chibios.mk
diff --git a/keyboards/chibios_test/teensy_lc_onekey/chconf.h b/keyboards/chibios_test/teensy_lc_onekey/chconf.h
new file mode 100644 (file)
index 0000000..cb36996
--- /dev/null
@@ -0,0 +1,524 @@
+/*\r
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
+\r
+    Licensed under the Apache License, Version 2.0 (the "License");\r
+    you may not use this file except in compliance with the License.\r
+    You may obtain a copy of the License at\r
+\r
+        http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+    Unless required by applicable law or agreed to in writing, software\r
+    distributed under the License is distributed on an "AS IS" BASIS,\r
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+    See the License for the specific language governing permissions and\r
+    limitations under the License.\r
+*/\r
+\r
+/**\r
+ * @file    templates/chconf.h\r
+ * @brief   Configuration file template.\r
+ * @details A copy of this file must be placed in each project directory, it\r
+ *          contains the application specific kernel settings.\r
+ *\r
+ * @addtogroup config\r
+ * @details Kernel related settings and hooks.\r
+ * @{\r
+ */\r
+\r
+#ifndef CHCONF_H\r
+#define CHCONF_H\r
+\r
+#define _CHIBIOS_RT_CONF_\r
+\r
+/*===========================================================================*/\r
+/**\r
+ * @name System timers settings\r
+ * @{\r
+ */\r
+/*===========================================================================*/\r
+\r
+/**\r
+ * @brief   System time counter resolution.\r
+ * @note    Allowed values are 16 or 32 bits.\r
+ */\r
+#define CH_CFG_ST_RESOLUTION                32\r
+\r
+/**\r
+ * @brief   System tick frequency.\r
+ * @details Frequency of the system timer that drives the system ticks. This\r
+ *          setting also defines the system tick time unit.\r
+ */\r
+#define CH_CFG_ST_FREQUENCY                 1000\r
+\r
+/**\r
+ * @brief   Time delta constant for the tick-less mode.\r
+ * @note    If this value is zero then the system uses the classic\r
+ *          periodic tick. This value represents the minimum number\r
+ *          of ticks that is safe to specify in a timeout directive.\r
+ *          The value one is not valid, timeouts are rounded up to\r
+ *          this value.\r
+ */\r
+#define CH_CFG_ST_TIMEDELTA                 0\r
+\r
+/** @} */\r
+\r
+/*===========================================================================*/\r
+/**\r
+ * @name Kernel parameters and options\r
+ * @{\r
+ */\r
+/*===========================================================================*/\r
+\r
+/**\r
+ * @brief   Round robin interval.\r
+ * @details This constant is the number of system ticks allowed for the\r
+ *          threads before preemption occurs. Setting this value to zero\r
+ *          disables the preemption for threads with equal priority and the\r
+ *          round robin becomes cooperative. Note that higher priority\r
+ *          threads can still preempt, the kernel is always preemptive.\r
+ * @note    Disabling the round robin preemption makes the kernel more compact\r
+ *          and generally faster.\r
+ * @note    The round robin preemption is not supported in tickless mode and\r
+ *          must be set to zero in that case.\r
+ */\r
+#define CH_CFG_TIME_QUANTUM                 20\r
+\r
+/**\r
+ * @brief   Managed RAM size.\r
+ * @details Size of the RAM area to be managed by the OS. If set to zero\r
+ *          then the whole available RAM is used. The core memory is made\r
+ *          available to the heap allocator and/or can be used directly through\r
+ *          the simplified core memory allocator.\r
+ *\r
+ * @note    In order to let the OS manage the whole RAM the linker script must\r
+ *          provide the @p __heap_base__ and @p __heap_end__ symbols.\r
+ * @note    Requires @p CH_CFG_USE_MEMCORE.\r
+ */\r
+#define CH_CFG_MEMCORE_SIZE                 0\r
+\r
+/**\r
+ * @brief   Idle thread automatic spawn suppression.\r
+ * @details When this option is activated the function @p chSysInit()\r
+ *          does not spawn the idle thread. The application @p main()\r
+ *          function becomes the idle thread and must implement an\r
+ *          infinite loop.\r
+ */\r
+#define CH_CFG_NO_IDLE_THREAD               FALSE\r
+\r
+/* Use __WFI in the idle thread for waiting. Does lower the power\r
+ * consumption. */\r
+#define CORTEX_ENABLE_WFI_IDLE              TRUE\r
+\r
+/** @} */\r
+\r
+/*===========================================================================*/\r
+/**\r
+ * @name Performance options\r
+ * @{\r
+ */\r
+/*===========================================================================*/\r
+\r
+/**\r
+ * @brief   OS optimization.\r
+ * @details If enabled then time efficient rather than space efficient code\r
+ *          is used when two possible implementations exist.\r
+ *\r
+ * @note    This is not related to the compiler optimization options.\r
+ * @note    The default is @p TRUE.\r
+ */\r
+#define CH_CFG_OPTIMIZE_SPEED               TRUE\r
+\r
+/** @} */\r
+\r
+/*===========================================================================*/\r
+/**\r
+ * @name Subsystem options\r
+ * @{\r
+ */\r
+/*===========================================================================*/\r
+\r
+/**\r
+ * @brief   Time Measurement APIs.\r
+ * @details If enabled then the time measurement APIs are included in\r
+ *          the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ */\r
+#define CH_CFG_USE_TM                       FALSE\r
+\r
+/**\r
+ * @brief   Threads registry APIs.\r
+ * @details If enabled then the registry APIs are included in the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ */\r
+#define CH_CFG_USE_REGISTRY                 TRUE\r
+\r
+/**\r
+ * @brief   Threads synchronization APIs.\r
+ * @details If enabled then the @p chThdWait() function is included in\r
+ *          the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ */\r
+#define CH_CFG_USE_WAITEXIT                 TRUE\r
+\r
+/**\r
+ * @brief   Semaphores APIs.\r
+ * @details If enabled then the Semaphores APIs are included in the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ */\r
+#define CH_CFG_USE_SEMAPHORES               TRUE\r
+\r
+/**\r
+ * @brief   Semaphores queuing mode.\r
+ * @details If enabled then the threads are enqueued on semaphores by\r
+ *          priority rather than in FIFO order.\r
+ *\r
+ * @note    The default is @p FALSE. Enable this if you have special\r
+ *          requirements.\r
+ * @note    Requires @p CH_CFG_USE_SEMAPHORES.\r
+ */\r
+#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE\r
+\r
+/**\r
+ * @brief   Mutexes APIs.\r
+ * @details If enabled then the mutexes APIs are included in the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ */\r
+#define CH_CFG_USE_MUTEXES                  TRUE\r
+\r
+/**\r
+ * @brief   Enables recursive behavior on mutexes.\r
+ * @note    Recursive mutexes are heavier and have an increased\r
+ *          memory footprint.\r
+ *\r
+ * @note    The default is @p FALSE.\r
+ * @note    Requires @p CH_CFG_USE_MUTEXES.\r
+ */\r
+#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE\r
+\r
+/**\r
+ * @brief   Conditional Variables APIs.\r
+ * @details If enabled then the conditional variables APIs are included\r
+ *          in the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ * @note    Requires @p CH_CFG_USE_MUTEXES.\r
+ */\r
+#define CH_CFG_USE_CONDVARS                 TRUE\r
+\r
+/**\r
+ * @brief   Conditional Variables APIs with timeout.\r
+ * @details If enabled then the conditional variables APIs with timeout\r
+ *          specification are included in the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ * @note    Requires @p CH_CFG_USE_CONDVARS.\r
+ */\r
+#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE\r
+\r
+/**\r
+ * @brief   Events Flags APIs.\r
+ * @details If enabled then the event flags APIs are included in the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ */\r
+#define CH_CFG_USE_EVENTS                   TRUE\r
+\r
+/**\r
+ * @brief   Events Flags APIs with timeout.\r
+ * @details If enabled then the events APIs with timeout specification\r
+ *          are included in the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ * @note    Requires @p CH_CFG_USE_EVENTS.\r
+ */\r
+#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE\r
+\r
+/**\r
+ * @brief   Synchronous Messages APIs.\r
+ * @details If enabled then the synchronous messages APIs are included\r
+ *          in the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ */\r
+#define CH_CFG_USE_MESSAGES                 TRUE\r
+\r
+/**\r
+ * @brief   Synchronous Messages queuing mode.\r
+ * @details If enabled then messages are served by priority rather than in\r
+ *          FIFO order.\r
+ *\r
+ * @note    The default is @p FALSE. Enable this if you have special\r
+ *          requirements.\r
+ * @note    Requires @p CH_CFG_USE_MESSAGES.\r
+ */\r
+#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE\r
+\r
+/**\r
+ * @brief   Mailboxes APIs.\r
+ * @details If enabled then the asynchronous messages (mailboxes) APIs are\r
+ *          included in the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ * @note    Requires @p CH_CFG_USE_SEMAPHORES.\r
+ */\r
+#define CH_CFG_USE_MAILBOXES                TRUE\r
+\r
+/**\r
+ * @brief   Core Memory Manager APIs.\r
+ * @details If enabled then the core memory manager APIs are included\r
+ *          in the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ */\r
+#define CH_CFG_USE_MEMCORE                  TRUE\r
+\r
+/**\r
+ * @brief   Heap Allocator APIs.\r
+ * @details If enabled then the memory heap allocator APIs are included\r
+ *          in the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or\r
+ *          @p CH_CFG_USE_SEMAPHORES.\r
+ * @note    Mutexes are recommended.\r
+ */\r
+#define CH_CFG_USE_HEAP                     TRUE\r
+\r
+/**\r
+ * @brief   Memory Pools Allocator APIs.\r
+ * @details If enabled then the memory pools allocator APIs are included\r
+ *          in the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ */\r
+#define CH_CFG_USE_MEMPOOLS                 TRUE\r
+\r
+/**\r
+ * @brief   Dynamic Threads APIs.\r
+ * @details If enabled then the dynamic threads creation APIs are included\r
+ *          in the kernel.\r
+ *\r
+ * @note    The default is @p TRUE.\r
+ * @note    Requires @p CH_CFG_USE_WAITEXIT.\r
+ * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.\r
+ */\r
+#define CH_CFG_USE_DYNAMIC                  TRUE\r
+\r
+/** @} */\r
+\r
+/*===========================================================================*/\r
+/**\r
+ * @name Debug options\r
+ * @{\r
+ */\r
+/*===========================================================================*/\r
+\r
+/**\r
+ * @brief   Debug option, kernel statistics.\r
+ *\r
+ * @note    The default is @p FALSE.\r
+ */\r
+#define CH_DBG_STATISTICS                   FALSE\r
+\r
+/**\r
+ * @brief   Debug option, system state check.\r
+ * @details If enabled the correct call protocol for system APIs is checked\r
+ *          at runtime.\r
+ *\r
+ * @note    The default is @p FALSE.\r
+ */\r
+#define CH_DBG_SYSTEM_STATE_CHECK           TRUE\r
+\r
+/**\r
+ * @brief   Debug option, parameters checks.\r
+ * @details If enabled then the checks on the API functions input\r
+ *          parameters are activated.\r
+ *\r
+ * @note    The default is @p FALSE.\r
+ */\r
+#define CH_DBG_ENABLE_CHECKS                TRUE\r
+\r
+/**\r
+ * @brief   Debug option, consistency checks.\r
+ * @details If enabled then all the assertions in the kernel code are\r
+ *          activated. This includes consistency checks inside the kernel,\r
+ *          runtime anomalies and port-defined checks.\r
+ *\r
+ * @note    The default is @p FALSE.\r
+ */\r
+#define CH_DBG_ENABLE_ASSERTS               TRUE\r
+\r
+/**\r
+ * @brief   Debug option, trace buffer.\r
+ * @details If enabled then the trace buffer is activated.\r
+ *\r
+ * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.\r
+ */\r
+#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED\r
+\r
+/**\r
+ * @brief   Trace buffer entries.\r
+ * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is\r
+ *          different from @p CH_DBG_TRACE_MASK_DISABLED.\r
+ */\r
+#define CH_DBG_TRACE_BUFFER_SIZE            128\r
+\r
+/**\r
+ * @brief   Debug option, stack checks.\r
+ * @details If enabled then a runtime stack check is performed.\r
+ *\r
+ * @note    The default is @p FALSE.\r
+ * @note    The stack check is performed in a architecture/port dependent way.\r
+ *          It may not be implemented or some ports.\r
+ * @note    The default failure mode is to halt the system with the global\r
+ *          @p panic_msg variable set to @p NULL.\r
+ */\r
+#define CH_DBG_ENABLE_STACK_CHECK           TRUE\r
+\r
+/**\r
+ * @brief   Debug option, stacks initialization.\r
+ * @details If enabled then the threads working area is filled with a byte\r
+ *          value when a thread is created. This can be useful for the\r
+ *          runtime measurement of the used stack.\r
+ *\r
+ * @note    The default is @p FALSE.\r
+ */\r
+#define CH_DBG_FILL_THREADS                 TRUE\r
+\r
+/**\r
+ * @brief   Debug option, threads profiling.\r
+ * @details If enabled then a field is added to the @p thread_t structure that\r
+ *          counts the system ticks occurred while executing the thread.\r
+ *\r
+ * @note    The default is @p FALSE.\r
+ * @note    This debug option is not currently compatible with the\r
+ *          tickless mode.\r
+ */\r
+#define CH_DBG_THREADS_PROFILING            FALSE\r
+\r
+/** @} */\r
+\r
+/*===========================================================================*/\r
+/**\r
+ * @name Kernel hooks\r
+ * @{\r
+ */\r
+/*===========================================================================*/\r
+\r
+/**\r
+ * @brief   Threads descriptor structure extension.\r
+ * @details User fields added to the end of the @p thread_t structure.\r
+ */\r
+#define CH_CFG_THREAD_EXTRA_FIELDS                                          \\r
+  /* Add threads custom fields here.*/\r
+\r
+/**\r
+ * @brief   Threads initialization hook.\r
+ * @details User initialization code added to the @p chThdInit() API.\r
+ *\r
+ * @note    It is invoked from within @p chThdInit() and implicitly from all\r
+ *          the threads creation APIs.\r
+ */\r
+#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \\r
+  /* Add threads initialization code here.*/                                \\r
+}\r
+\r
+/**\r
+ * @brief   Threads finalization hook.\r
+ * @details User finalization code added to the @p chThdExit() API.\r
+ */\r
+#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \\r
+  /* Add threads finalization code here.*/                                  \\r
+}\r
+\r
+/**\r
+ * @brief   Context switch hook.\r
+ * @details This hook is invoked just before switching between threads.\r
+ */\r
+#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \\r
+  /* Context switch code here.*/                                            \\r
+}\r
+\r
+/**\r
+ * @brief   ISR enter hook.\r
+ */\r
+#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \\r
+  /* IRQ prologue code here.*/                                              \\r
+}\r
+\r
+/**\r
+ * @brief   ISR exit hook.\r
+ */\r
+#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \\r
+  /* IRQ epilogue code here.*/                                              \\r
+}\r
+\r
+/**\r
+ * @brief   Idle thread enter hook.\r
+ * @note    This hook is invoked within a critical zone, no OS functions\r
+ *          should be invoked from here.\r
+ * @note    This macro can be used to activate a power saving mode.\r
+ */\r
+#define CH_CFG_IDLE_ENTER_HOOK() {                                          \\r
+  /* Idle-enter code here.*/                                                \\r
+}\r
+\r
+/**\r
+ * @brief   Idle thread leave hook.\r
+ * @note    This hook is invoked within a critical zone, no OS functions\r
+ *          should be invoked from here.\r
+ * @note    This macro can be used to deactivate a power saving mode.\r
+ */\r
+#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \\r
+  /* Idle-leave code here.*/                                                \\r
+}\r
+\r
+/**\r
+ * @brief   Idle Loop hook.\r
+ * @details This hook is continuously invoked by the idle thread loop.\r
+ */\r
+#define CH_CFG_IDLE_LOOP_HOOK() {                                           \\r
+  /* Idle loop code here.*/                                                 \\r
+}\r
+\r
+/**\r
+ * @brief   System tick event hook.\r
+ * @details This hook is invoked in the system tick handler immediately\r
+ *          after processing the virtual timers queue.\r
+ */\r
+#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \\r
+  /* System tick event code here.*/                                         \\r
+}\r
+\r
+/**\r
+ * @brief   System halt hook.\r
+ * @details This hook is invoked in case to a system halting error before\r
+ *          the system is halted.\r
+ */\r
+#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \\r
+  /* System halt code here.*/                                               \\r
+}\r
+\r
+/**\r
+ * @brief   Trace hook.\r
+ * @details This hook is invoked each time a new record is written in the\r
+ *          trace buffer.\r
+ */\r
+#define CH_CFG_TRACE_HOOK(tep) {                                            \\r
+  /* Trace code here.*/                                                     \\r
+}\r
+\r
+/** @} */\r
+\r
+/*===========================================================================*/\r
+/* Port-specific settings (override port settings defaulted in chcore.h).    */\r
+/*===========================================================================*/\r
+\r
+#endif  /* CHCONF_H */\r
+\r
+/** @} */\r
diff --git a/keyboards/chibios_test/teensy_lc_onekey/config.h b/keyboards/chibios_test/teensy_lc_onekey/config.h
new file mode 100644 (file)
index 0000000..d9eb05d
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef KEYBOARDS_CHIBIOS_TEST_TEENSY_LC_ONEKEY_CONFIG_H_
+#define KEYBOARDS_CHIBIOS_TEST_TEENSY_LC_ONEKEY_CONFIG_H_
+
+#include "../config.h"
+
+#endif /* KEYBOARDS_CHIBIOS_TEST_TEENSY_LC_ONEKEY_CONFIG_H_ */
diff --git a/keyboards/chibios_test/teensy_lc_onekey/halconf.h b/keyboards/chibios_test/teensy_lc_onekey/halconf.h
new file mode 100644 (file)
index 0000000..b1d2cd5
--- /dev/null
@@ -0,0 +1,187 @@
+/*\r
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
+\r
+    Licensed under the Apache License, Version 2.0 (the "License");\r
+    you may not use this file except in compliance with the License.\r
+    You may obtain a copy of the License at\r
+\r
+        http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+    Unless required by applicable law or agreed to in writing, software\r
+    distributed under the License is distributed on an "AS IS" BASIS,\r
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+    See the License for the specific language governing permissions and\r
+    limitations under the License.\r
+*/\r
+\r
+/**\r
+ * @file    templates/halconf.h\r
+ * @brief   HAL configuration header.\r
+ * @details HAL configuration file, this file allows to enable or disable the\r
+ *          various device drivers from your application. You may also use\r
+ *          this file in order to override the device drivers default settings.\r
+ *\r
+ * @addtogroup HAL_CONF\r
+ * @{\r
+ */\r
+\r
+#ifndef _HALCONF_H_\r
+#define _HALCONF_H_\r
+\r
+#include "mcuconf.h"\r
+\r
+/**\r
+ * @brief   Enables the PAL subsystem.\r
+ */\r
+#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)\r
+#define HAL_USE_PAL                 TRUE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the ADC subsystem.\r
+ */\r
+#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)\r
+#define HAL_USE_ADC                 FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the CAN subsystem.\r
+ */\r
+#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)\r
+#define HAL_USE_CAN                 FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the DAC subsystem.\r
+ */\r
+#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)\r
+#define HAL_USE_DAC                 FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the EXT subsystem.\r
+ */\r
+#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)\r
+#define HAL_USE_EXT                 FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the GPT subsystem.\r
+ */\r
+#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)\r
+#define HAL_USE_GPT                 FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the I2C subsystem.\r
+ */\r
+#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)\r
+#define HAL_USE_I2C                 FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the I2S subsystem.\r
+ */\r
+#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)\r
+#define HAL_USE_I2S                 FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the ICU subsystem.\r
+ */\r
+#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)\r
+#define HAL_USE_ICU                 FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the MAC subsystem.\r
+ */\r
+#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)\r
+#define HAL_USE_MAC                 FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the MMC_SPI subsystem.\r
+ */\r
+#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)\r
+#define HAL_USE_MMC_SPI             FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the PWM subsystem.\r
+ */\r
+#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)\r
+#define HAL_USE_PWM                 FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the RTC subsystem.\r
+ */\r
+#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)\r
+#define HAL_USE_RTC                 FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the SDC subsystem.\r
+ */\r
+#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)\r
+#define HAL_USE_SDC                 FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the SERIAL subsystem.\r
+ */\r
+#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)\r
+#define HAL_USE_SERIAL              FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the SERIAL over USB subsystem.\r
+ */\r
+#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)\r
+#define HAL_USE_SERIAL_USB          FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the SPI subsystem.\r
+ */\r
+#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)\r
+#define HAL_USE_SPI                 FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the UART subsystem.\r
+ */\r
+#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)\r
+#define HAL_USE_UART                FALSE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the USB subsystem.\r
+ */\r
+#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)\r
+#define HAL_USE_USB                 TRUE\r
+#endif\r
+\r
+/**\r
+ * @brief   Enables the WDG subsystem.\r
+ */\r
+#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)\r
+#define HAL_USE_WDG                 FALSE\r
+#endif\r
+\r
+/*===========================================================================*/\r
+/* USB driver related settings.                                              */\r
+/*===========================================================================*/\r
+\r
+/**\r
+ * @brief   Enables synchronous APIs.\r
+ * @note    Disabling this option saves both code and data space.\r
+ */\r
+#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)\r
+#define USB_USE_WAIT                TRUE\r
+#endif\r
+\r
+#endif /* _HALCONF_H_ */\r
+\r
+/** @} */\r
diff --git a/keyboards/chibios_test/teensy_lc_onekey/instructions.md b/keyboards/chibios_test/teensy_lc_onekey/instructions.md
new file mode 100644 (file)
index 0000000..16886a0
--- /dev/null
@@ -0,0 +1,82 @@
+# Teensy LC, 3.0, 3.1, 3.2 support
+
+These ARM Teensies are now supported through [ChibiOS](http://chibios.org).
+
+You'll need to install an ARM toolchain, for instance from [gcc ARM embedded](https://launchpad.net/gcc-arm-embedded) website, or using your favourite package manager. After installing, you should be able to run `arm-none-eabi-gcc -v` in the command prompt and get sensible output. This toolchain is used instead of `avr-gcc`, which is only for AVR chips. Naturally you'll also need the usual development tools (e.g. `make`), just as in the AVR setting.
+
+Next, you'll need ChibiOS. For Teensies, you'll need code from two repositories: [chibios-main](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS). If you're not using git, you can just download a [zip of chibios from here](https://github.com/ChibiOS/ChibiOS/archive/a7df9a891067621e8e1a5c2a2c0ceada82403afe.zip), unpack the zip, and rename/move the unpacked directory (named `ChibiOS-<long_hash_here>`) to `tmk_core/tool/chibios/chibios` (so that the file `tmk_core/tool/chibios/chibios/license.txt` exists). Now the same procedure with a [zip of chibios-contrib from here](https://github.com/ChibiOS/ChibiOS-Contrib/archive/e1311c4db6cd366cf760673f769e925741ac0ad3.zip): unpack and move `ChibiOS-Contrib-<long_hash_here>` to `tmk_core/tool/chibios/chibios-contrib`.
+
+(If you're using git, you can just clone the two repos: [chibios](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS-Contrib). However - be warned that things may be somewhat out-of-sync (updates at different rates), so you may need to hunt a bit for the right commits.)
+
+(Why do we need chibios-contrib? Well, the main repo focuses on STM32 chips, and Freescale/NXP Kinetis chips are supported via the Contrib repository.)
+
+This should be it. Running `make` in `keyboard/teensy_lc_onekey` should create a working firmware in `build/`, called `ch.hex`.
+
+For more notes about the ChibiOS backend in TMK, see `tmk_core/protocol/chibios/README.md`.
+
+## About this onekey example
+
+It's set up for Teensy LC. To use 3.x, you'll need to edit the `Makefile` (and comment out one line in `mcuconf.h`). A sample makefile for Teensy 3.0 is provided as `Makefile.3.0`, can be used without renaming with `make -f Makefile.3.0`. Similarly for Teensy 3.2, there's `Makefile.3.2`.
+
+## Credits
+
+TMK itself is written by hasu, original sources [here](https://github.com/tmk/tmk_keyboard).
+
+The USB support for Kinetis MCUs is due to RedoX. His ChibiOS fork is also [on github](https://github.com/RedoXyde/ChibiOS); but it doesn't include Teensy LC definitions.
+
+## Features that are not implemented yet
+
+Currently only the more fancy suspend features are not there (power saving during suspend). The rest should work fine (reports either way are welcome).
+
+# Matrix programming notes
+
+The notes below explain what commands can be used to examine and set the status of Teensy pins.
+
+## ChibiOS pin manipulation basics
+
+### Pins
+
+Each pin sits on a "port", each of which comprises at most 32 individual pins.
+So for instance "PTC5" from Kinetis manual/datasheet refers to port C (or GPIOA), pin 5. Most functions dealing with pins take 2 parameters which specify the pin -- the first being the port, the second being the pin number.
+
+Within ChibiOS, there are definitions which simplify this a bit for the Teensies. `TEENSY_PINn_IOPORT` represents the port of the MCU's pin connected Teensy's PIN `n`, and `TEENSY_PINn` represents its MCU's pin number.
+
+### Mode
+
+A MCU pin can be in several modes. The basic command to set a pin mode is
+
+        palSetPadMode(TEENSY_PINn_IOPORT, TEENSY_PINn, PAL_MODE_INPUT_PULLUP);
+
+The last parameter is the mode. For keyboards, the usual ones that are used are `PAL_MODE_INPUT_PULLUP` (input with a pullup), `PAL_MODE_INPUT_PULLDOWN` (input with a pulldown), `PAL_MODE_INPUT` (input floating, a.k.a. Hi-Z), `PAL_MODE_OUTPUT_PUSHPULL` (output in the Arduino sense -- can be then set HIGH or LOW).
+
+### Setting
+
+Pins are set HIGH (after they've been put into `OUTPUT_PUSHPULL` mode) by
+
+        palSetPad(TEENSY_PINn_IOPORT, TEENSY_PINn);
+
+or set LOW by
+
+        palClearPad(TEENSY_PINn_IOPORT, TEENSY_PINn);
+
+Toggling can be done with
+
+        palTogglePad(TEENSY_PINn_IOPORT, TEENSY_PINn);
+
+Alternatively, you can use
+
+        palWritePad(TEENSY_PINn_IOPORT, TEENSY_PINn, bit);
+
+where `bit` is either `PAL_LOW` or `PAL_HIGH` (i.e. `0` or `1`).
+
+### Reading
+
+Reading pin status is done with
+
+        palReadPad(TEENSY_PINn_IOPORT, TEENSY_PINn);
+
+The function returns either `PAL_HIGH` (actually `1`) or `PAL_LOW` (actually `0`).
+
+### Further docs
+
+All the commands that are available for pin manipulation through ChibiOS HAL are documented in [ChibiOS PAL driver docs](http://chibios.sourceforge.net/docs3/hal/group___p_a_l.html).
diff --git a/keyboards/chibios_test/teensy_lc_onekey/led.c b/keyboards/chibios_test/teensy_lc_onekey/led.c
new file mode 100644 (file)
index 0000000..dfa60c1
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+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/>.
+*/
+
+#include "hal.h"
+
+#include "led.h"
+
+
+void led_set(uint8_t usb_led) {
+    if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
+        // output high
+        palSetPadMode(TEENSY_PIN13_IOPORT, TEENSY_PIN13, PAL_MODE_OUTPUT_PUSHPULL);
+        palSetPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13);
+    } else {
+        // Hi-Z
+        palSetPadMode(TEENSY_PIN13_IOPORT, TEENSY_PIN13, PAL_MODE_INPUT);
+    }
+}
diff --git a/keyboards/chibios_test/teensy_lc_onekey/matrix.c b/keyboards/chibios_test/teensy_lc_onekey/matrix.c
new file mode 100644 (file)
index 0000000..7dab04f
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+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/>.
+*/
+
+#include "ch.h"
+#include "hal.h"
+
+/*
+ * scan matrix
+ */
+#include "print.h"
+#include "debug.h"
+#include "util.h"
+#include "matrix.h"
+#include "wait.h"
+
+#ifndef DEBOUNCE
+#   define DEBOUNCE 5
+#endif
+static uint8_t debouncing = DEBOUNCE;
+
+/* matrix state(1:on, 0:off) */
+static matrix_row_t matrix[MATRIX_ROWS];
+static matrix_row_t matrix_debouncing[MATRIX_ROWS];
+
+static matrix_row_t read_cols(void);
+static void init_cols(void);
+static void unselect_rows(void);
+static void select_row(uint8_t row);
+
+
+inline
+uint8_t matrix_rows(void)
+{
+    return MATRIX_ROWS;
+}
+
+inline
+uint8_t matrix_cols(void)
+{
+    return MATRIX_COLS;
+}
+
+#define LED_ON()    do { palSetPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13) ;} while (0)
+#define LED_OFF()   do { palClearPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13); } while (0)
+#define LED_TGL()   do { palTogglePad(TEENSY_PIN13_IOPORT, TEENSY_PIN13); } while (0)
+
+void matrix_init(void)
+{
+    // initialize row and col
+    unselect_rows();
+    init_cols();
+
+    // initialize matrix state: all keys off
+    for (uint8_t i=0; i < MATRIX_ROWS; i++) {
+        matrix[i] = 0;
+        matrix_debouncing[i] = 0;
+    }
+
+    //debug
+    debug_matrix = true;
+    LED_ON();
+    wait_ms(500);
+    LED_OFF();
+}
+
+uint8_t matrix_scan(void)
+{
+    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+        select_row(i);
+        wait_us(30);  // without this wait read unstable value.
+        matrix_row_t cols = read_cols();
+        if (matrix_debouncing[i] != cols) {
+            matrix_debouncing[i] = cols;
+            if (debouncing) {
+                debug("bounce!: "); debug_hex(debouncing); debug("\n");
+            }
+            debouncing = DEBOUNCE;
+        }
+        unselect_rows();
+    }
+
+    if (debouncing) {
+        if (--debouncing) {
+            wait_ms(1);
+        } else {
+            for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+                matrix[i] = matrix_debouncing[i];
+            }
+        }
+    }
+
+    return 1;
+}
+
+inline
+bool matrix_is_on(uint8_t row, uint8_t col)
+{
+    return (matrix[row] & ((matrix_row_t)1<<col));
+}
+
+inline
+matrix_row_t matrix_get_row(uint8_t row)
+{
+    return matrix[row];
+}
+
+void matrix_print(void)
+{
+    print("\nr/c 0123456789ABCDEF\n");
+    for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
+        phex(row); print(": ");
+        pbin_reverse16(matrix_get_row(row));
+        print("\n");
+    }
+}
+
+/* Column pin configuration
+ */
+static void  init_cols(void)
+{
+    // internal pull-up
+    palSetPadMode(TEENSY_PIN2_IOPORT, TEENSY_PIN2, PAL_MODE_INPUT_PULLUP);
+}
+
+/* Returns status of switches(1:on, 0:off) */
+static matrix_row_t read_cols(void)
+{
+    return ((palReadPad(TEENSY_PIN2_IOPORT, TEENSY_PIN2)==PAL_HIGH) ? 0 : (1<<0));
+    // | ((palReadPad(...)==PAL_HIGH) ? 0 : (1<<1))
+}
+
+/* Row pin configuration
+ */
+static void unselect_rows(void)
+{
+    palSetPadMode(TEENSY_PIN5_IOPORT, TEENSY_PIN5, PAL_MODE_INPUT); // hi-Z
+}
+
+static void select_row(uint8_t row)
+{
+    (void)row;
+    // Output low to select
+    switch (row) {
+        case 0:
+            palSetPadMode(TEENSY_PIN5_IOPORT, TEENSY_PIN5, PAL_MODE_OUTPUT_PUSHPULL);
+            palClearPad(TEENSY_PIN5_IOPORT, TEENSY_PIN5);
+            break;
+    }
+}
diff --git a/keyboards/chibios_test/teensy_lc_onekey/mcuconf.h b/keyboards/chibios_test/teensy_lc_onekey/mcuconf.h
new file mode 100644 (file)
index 0000000..c636590
--- /dev/null
@@ -0,0 +1,55 @@
+/*\r
+    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
+\r
+    Licensed under the Apache License, Version 2.0 (the "License");\r
+    you may not use this file except in compliance with the License.\r
+    You may obtain a copy of the License at\r
+\r
+        http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+    Unless required by applicable law or agreed to in writing, software\r
+    distributed under the License is distributed on an "AS IS" BASIS,\r
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+    See the License for the specific language governing permissions and\r
+    limitations under the License.\r
+*/\r
+\r
+#ifndef _MCUCONF_H_\r
+#define _MCUCONF_H_\r
+\r
+#define KL2x_MCUCONF\r
+\r
+/*\r
+ * HAL driver system settings.\r
+ */\r
+#if 1\r
+/* PEE mode - 48MHz system clock driven by (16 MHz) external crystal. */\r
+#define KINETIS_MCG_MODE            KINETIS_MCG_MODE_PEE\r
+#define KINETIS_PLLCLK_FREQUENCY    96000000UL\r
+#define KINETIS_SYSCLK_FREQUENCY    48000000UL\r
+#endif\r
+\r
+#if 0\r
+/* crystal-less FEI mode - 48 MHz with internal 32.768 kHz crystal */\r
+#define KINETIS_MCG_MODE            KINETIS_MCG_MODE_FEI\r
+#define KINETIS_MCG_FLL_DMX32       1           /* Fine-tune for 32.768 kHz */\r
+#define KINETIS_MCG_FLL_DRS         1           /* 1464x FLL factor */\r
+#define KINETIS_SYSCLK_FREQUENCY    47972352UL  /* 32.768 kHz * 1464 (~48 MHz) */\r
+#define KINETIS_CLKDIV1_OUTDIV1     1           /* do not divide system clock */\r
+#endif\r
+\r
+/*\r
+ * SERIAL driver system settings.\r
+ */\r
+#define KINETIS_SERIAL_USE_UART0              TRUE\r
+\r
+/*\r
+ * USB driver settings\r
+ */\r
+#define KINETIS_USB_USE_USB0                  TRUE\r
+/* Need to redefine this, since the default is for K20x */\r
+/* This is for Teensy LC; you should comment it out (or change to 5)\r
+ * for Teensy 3.x */\r
+#define KINETIS_USB_USB0_IRQ_PRIORITY         2\r
+\r
+#endif /* _MCUCONF_H_ */\r
diff --git a/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.c b/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.c
new file mode 100644 (file)
index 0000000..b6c4327
--- /dev/null
@@ -0,0 +1 @@
+#include "teensy_lc_onekey.h"
diff --git a/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h b/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h
new file mode 100644 (file)
index 0000000..ea1c84e
--- /dev/null
@@ -0,0 +1,4 @@
+#ifndef TEENSY_LC_ONEKEY_H
+#define TEENSY_LC_ONEKEY_H
+#include "chibios_test.h"
+#endif
index 6a391ffb541977ff07993ae63dbe9ab233e7535b..2bb56731b27caf46b35c832c1788d3e71e7c1e3a 100644 (file)
@@ -27,7 +27,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define DEVICE_VER      0x0001
 #define MANUFACTURER    ErgoDox EZ
 #define PRODUCT         ErgoDox EZ
-#define DESCRIPTION     t.m.k. keyboard firmware for Ergodox
+#define DESCRIPTION     QMK keyboard firmware for Ergodox EZ
 
 /* key matrix size */
 #define MATRIX_ROWS 14
@@ -40,12 +40,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #define TAPPING_TOGGLE  1
 
-#define COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
-#define ROWS (int []){ D0, D5, B5, B6 }
-
-/* COL2ROW or ROW2COL */
-#define DIODE_DIRECTION COL2ROW
-
 /* define if matrix has ghost */
 //#define MATRIX_HAS_GHOST
 
@@ -53,7 +47,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define BACKLIGHT_LEVELS 3
 
 /* Set 0 if debouncing isn't needed */
-#define DEBOUNCE    2
+#define DEBOUNCE    5
 #define TAPPING_TERM    200
 #define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
 
index b87fddbad7ed482d624e3c3a8456c14eb153e6dd..9c1efa1d05acb4bee691f771c943316b57ac93bf 100644 (file)
@@ -27,7 +27,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <stdint.h>
 #include <stdbool.h>
 #include <avr/io.h>
-#include <util/delay.h>
+#include "wait.h"
 #include "action_layer.h"
 #include "print.h"
 #include "debug.h"
@@ -166,6 +166,7 @@ uint8_t matrix_scan(void)
 
     for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
         select_row(i);
+        wait_us(30);  // without this wait read unstable value.
         matrix_row_t cols = read_cols(i);
         if (matrix_debouncing[i] != cols) {
             matrix_debouncing[i] = cols;
@@ -179,7 +180,7 @@ uint8_t matrix_scan(void)
 
     if (debouncing) {
         if (--debouncing) {
-            _delay_ms(1);
+            wait_us(1);
         } else {
             for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
                 matrix[i] = matrix_debouncing[i];
@@ -267,7 +268,6 @@ static matrix_row_t read_cols(uint8_t row)
             return data;
         }
     } else {
-        _delay_us(30);  // without this wait read unstable value.
         // read from teensy
         return
             (PINF&(1<<0) ? 0 : (1<<0)) |
index f7e4e2fe292efb156a33040b9de36e9c6c508cac..b8b2beda485e42ccefb62c7dabbeeaf69ba05744 100644 (file)
@@ -21,5 +21,5 @@ SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
 NKRO_ENABLE ?= yes           # USB Nkey Rollover
 
 ifndef QUANTUM_DIR
-       include ../../Makefile
+       include ../../../../Makefile
 endif
diff --git a/keyboards/kc60/keymaps/wigguno/Makefile b/keyboards/kc60/keymaps/wigguno/Makefile
new file mode 100644 (file)
index 0000000..0d7d918
--- /dev/null
@@ -0,0 +1,24 @@
+
+
+# Build Options
+#   change yes to no to disable
+#
+BOOTMAGIC_ENABLE ?= yes      # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE ?= no        # Mouse keys(+4700)
+EXTRAKEY_ENABLE ?= yes       # Audio control and System control(+450)
+CONSOLE_ENABLE ?= no         # Console for debug(+400)
+COMMAND_ENABLE ?= no         # 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 ?= no       # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE ?= yes           # USB Nkey Rollover
+BACKLIGHT_ENABLE ?= yes      # Enable keyboard backlight functionality
+MIDI_ENABLE ?= no            # MIDI controls
+UNICODE_ENABLE ?= no         # Unicode
+BLUETOOTH_ENABLE ?= no       # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE ?= no           # Audio output on port C6
+
+ifndef QUANTUM_DIR
+       include ../../../../Makefile
+endif
diff --git a/keyboards/kc60/keymaps/wigguno/keymap.c b/keyboards/kc60/keymaps/wigguno/keymap.c
new file mode 100644 (file)
index 0000000..50b1d0f
--- /dev/null
@@ -0,0 +1,62 @@
+// This keymap was designed to close to the default kc60 layout, with some useful changes, such as adding media keys.
+// It also moves the reset key off the base layer, as in the default kc60 layout for this firmware.
+// I have swapped FN and RGUI as my rainbow keyset has them in the opposite order. 
+
+#include "kc60.h"
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+       
+   /* Basic QWERTY
+       * ,-----------------------------------------------------------.
+       * |Esc | 1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backsp |
+       * |-----------------------------------------------------------|
+       * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \  |
+       * |-----------------------------------------------------------|
+       * |CAPS   |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return |
+       * |-----------------------------------------------------------|
+       * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift     |
+       * |-----------------------------------------------------------|
+       * |Ctrl|Gui |Alt |      Space            |Alt |FN  |Gui |Ctrl |
+       * `-----------------------------------------------------------'
+       */
+  [0] = KEYMAP( 
+      KC_ESC,   KC_1,     KC_2,     KC_3,     KC_4,     KC_5,     KC_6,     KC_7,     KC_8,     KC_9,     KC_0,     KC_MINS,  KC_EQL,   KC_BSPC,   \
+      KC_TAB,   KC_Q,     KC_W,     KC_E,     KC_R,     KC_T,     KC_Y,     KC_U,     KC_I,     KC_O,     KC_P,     KC_LBRC,  KC_RBRC,  KC_BSLS,   \
+      KC_CAPS,  KC_A,     KC_S,     KC_D,     KC_F,     KC_G,     KC_H,     KC_J,     KC_K,     KC_L,     KC_SCLN,  KC_QUOT,  KC_NO,    KC_ENT,    \
+      KC_LSFT,  KC_NO,    KC_Z,     KC_X,     KC_C,     KC_V,     KC_B,     KC_N,     KC_M,     KC_COMM,  KC_DOT,   KC_SLSH,  KC_NO,    KC_RSFT,   \
+      KC_LCTL,  KC_LGUI,  KC_LALT,                      KC_SPC,                                           KC_RALT,  MO(1),    KC_RGUI,  KC_RCTL    \
+      ),
+               
+   /*
+       * ,-----------------------------------------------------------.
+       * | `  |F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Del   |
+       * |-----------------------------------------------------------|
+       * |     |   | Up|   |   |   |   |   |   |   | PS|   |   |     |
+       * |-----------------------------------------------------------|
+       * |       |Lft|Dwn|Rgt|   |BL-|BL+|   |   |   |   |   |       |
+       * |-----------------------------------------------------------|
+       * |        |Prv| PP|Nxt|   |   |   |   |Hom|End|   |          |
+       * |-----------------------------------------------------------|
+       * | Rst|    |    |          BL           |    |    |    |     |
+       * `-----------------------------------------------------------'
+       * PS = Print Screen
+       * PP = Play/Pause
+       */
+  [1] = KEYMAP( /* Function Layer */
+      KC_GRV,   KC_F1,    KC_F2,    KC_F3,    KC_F4,    KC_F5,    KC_F6,    KC_F7,    KC_F8,    KC_F9,    KC_F10,   KC_F11,   KC_F12,   KC_DELETE, \
+      KC_TRNS,  KC_TRNS,  KC_UP,    KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_PSCR,  KC_TRNS,  KC_TRNS,  KC_TRNS,   \
+      KC_TRNS,  KC_LEFT,  KC_DOWN,  KC_RGHT,  KC_TRNS,  BL_DEC,   BL_INC,   KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,   \
+      KC_TRNS,  KC_TRNS,  KC_MPRV,  KC_MPLY,  KC_MNXT,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_HOME,  KC_END,   KC_TRNS,  KC_TRNS,  KC_TRNS,   \
+      RESET,    KC_TRNS,  KC_TRNS,                      BL_TOGG,                                          KC_TRNS,  KC_TRNS,  KC_TRNS,  KC_TRNS    \
+      ),
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+
+};
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+  // MACRODOWN only works in this function
+  return MACRO_NONE;
+};
diff --git a/keyboards/kc60/keymaps/wigguno/readme.md b/keyboards/kc60/keymaps/wigguno/readme.md
new file mode 100644 (file)
index 0000000..55a9f60
--- /dev/null
@@ -0,0 +1,14 @@
+Wigguno's KC60 Layout
+======================
+
+## Quantum MK Firmware
+For the full Quantum feature list, see [the parent readme.md](/readme.md).
+
+## Changes from default QMK layout
+The default QMK layout for KC60 does not have a function layer. It also has the bootloader-mode reset key bound. This keymap fixes both of these by adding a sensible function layer (including moving the reset key onto it, far away from the FN key).
+
+### Changes from the default KC60 layout
+The default KC60 layout is good, but it was missing media keys. I've added previous, play/pause and next. I've also removed some of the keys from the function layer I didn't use.
+
+### Build
+To enable NKRO you must be in the keymaps/wigguno directory when running make.
index d97e4d9f8a08d052f7eea73c2f3487ccbf5bee6a..891c4441627079e6ecf5ca4e2256b8facf7595f2 100644 (file)
@@ -21,5 +21,5 @@ SLEEP_LED_ENABLE ?= no       # Breathing sleep LED during USB suspend
 NKRO_ENABLE ?= no            # USB Nkey Rollover
 
 ifndef QUANTUM_DIR
-       include ../../Makefile
+       include ../../../../Makefile
 endif
index 9b4b33f82147291b1a76f415632257c505cf1cff..5f71ae7d19ab1850766e0029b5e3c41f0715e162 100644 (file)
@@ -197,8 +197,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
         #endif
         persistant_default_layer_set(1UL<<_QWERTY);
       }
-      break;
       return false;
+      break;
     case COLEMAK:
       if (record->event.pressed) {
         #ifdef AUDIO_ENABLE
@@ -206,8 +206,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
         #endif
         persistant_default_layer_set(1UL<<_COLEMAK);
       }
-      break;
       return false;
+      break;
     case DVORAK:
       if (record->event.pressed) {
         #ifdef AUDIO_ENABLE
@@ -215,8 +215,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
         #endif
         persistant_default_layer_set(1UL<<_DVORAK);
       }
-      break;
       return false;
+      break;
     case LOWER:
       if (record->event.pressed) {
         layer_on(_LOWER);
@@ -225,8 +225,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
         layer_off(_LOWER);
         update_tri_layer(_LOWER, _RAISE, _ADJUST);
       }
-      break;
       return false;
+      break;
     case RAISE:
       if (record->event.pressed) {
         layer_on(_RAISE);
@@ -235,8 +235,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
         layer_off(_RAISE);
         update_tri_layer(_LOWER, _RAISE, _ADJUST);
       }
-      break;
       return false;
+      break;
     case BACKLIT:
       if (record->event.pressed) {
         register_code(KC_RSFT);
@@ -246,8 +246,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
       } else {
         unregister_code(KC_RSFT);
       }
-      break;
       return false;
+      break;
     case PLOVER:
       if (record->event.pressed) {
         #ifdef AUDIO_ENABLE
@@ -265,8 +265,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
         keymap_config.nkro = 1;
         eeconfig_update_keymap(keymap_config.raw);
       }
-      break;
       return false;
+      break;
     case EXT_PLV:
       if (record->event.pressed) {
         #ifdef AUDIO_ENABLE
@@ -274,8 +274,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
         #endif
         layer_off(_PLOVER);
       }
-      break;
       return false;
+      break;
   }
   return true;
 }
index 6d8ef634dd70b708f654ee3da0894ae28967e44c..9a957f7ee186a58285bf88e1b337ba93d7cf92c6 100644 (file)
@@ -191,8 +191,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
             #endif
             persistant_default_layer_set(1UL<<_QWERTY);
           }
-          break;
           return false;
+          break;
         case COLEMAK:
           if (record->event.pressed) {
             #ifdef AUDIO_ENABLE
@@ -200,8 +200,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
             #endif
             persistant_default_layer_set(1UL<<_COLEMAK);
           }
-          break;
           return false;
+          break;
         case DVORAK:
           if (record->event.pressed) {
             #ifdef AUDIO_ENABLE
@@ -209,8 +209,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
             #endif
             persistant_default_layer_set(1UL<<_DVORAK);
           }
-          break;
           return false;
+          break;
         case LOWER:
           if (record->event.pressed) {
             layer_on(_LOWER);
@@ -219,8 +219,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
             layer_off(_LOWER);
             update_tri_layer(_LOWER, _RAISE, _ADJUST);
           }
-          break;
           return false;
+          break;
         case RAISE:
           if (record->event.pressed) {
             layer_on(_RAISE);
@@ -229,8 +229,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
             layer_off(_RAISE);
             update_tri_layer(_LOWER, _RAISE, _ADJUST);
           }
-          break;
           return false;
+          break;
         case BACKLIT:
           if (record->event.pressed) {
             register_code(KC_RSFT);
@@ -240,8 +240,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
           } else {
             unregister_code(KC_RSFT);
           }
-          break;
           return false;
+          break;
       }
     return true;
 };
diff --git a/keyboards/stm32_f072_onekey/Makefile b/keyboards/stm32_f072_onekey/Makefile
deleted file mode 100644 (file)
index 24abcb0..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# project specific files
-SRC =  matrix.c \
-           led.c
-
-## chip/board settings
-# the next two should match the directories in
-#  <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
-MCU_FAMILY = STM32
-MCU_SERIES = STM32F0xx
-# linker script to use
-# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
-#  or <this_dir>/ld/
-MCU_LDSCRIPT = STM32F072xB
-# startup code to use
-# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
-MCU_STARTUP = stm32f0xx
-# it should exist either in <chibios>/os/hal/boards/
-#  or <this_dir>/boards
-BOARD = ST_STM32F072B_DISCOVERY
-# Cortex version
-# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
-MCU  = cortex-m0
-# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
-ARMV = 6
-# If you want to be able to jump to bootloader from firmware on STM32 MCUs,
-# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in
-# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have
-# a custom board definition that you plan to reuse).
-# If you're not setting it here, leave it commented out.
-# It is chip dependent, the correct number can be looked up here (page 175):
-# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
-# This also requires a patch to chibios:
-#   <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
-#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
-
-# Build Options
-#   comment out to disable the options.
-#
-#BOOTMAGIC_ENABLE = yes        # Virtual DIP switch configuration
-MOUSEKEY_ENABLE ?= yes # Mouse keys
-EXTRAKEY_ENABLE ?= yes # Audio control and System control
-CONSOLE_ENABLE ?= yes  # Console for debug
-COMMAND_ENABLE ?= yes    # Commands for debug and configuration
-SLEEP_LED_ENABLE ?= yes  # Breathing sleep LED during USB suspend
-NKRO_ENABLE ?= yes         # USB Nkey Rollover
-CUSTOM_MATRIX ?= yes # Custom matrix file
-
-ifndef QUANTUM_DIR
-       include ../../Makefile
-endif
diff --git a/keyboards/stm32_f072_onekey/bootloader_defs.h b/keyboards/stm32_f072_onekey/bootloader_defs.h
deleted file mode 100644 (file)
index 02c48c4..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Address for jumping to bootloader on STM32 chips. */
-/* It is chip dependent, the correct number can be looked up here (page 175):
- * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
- * This also requires a patch to chibios:
- *  <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
- */
-#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800
diff --git a/keyboards/stm32_f072_onekey/chconf.h b/keyboards/stm32_f072_onekey/chconf.h
deleted file mode 100644 (file)
index 99fa8ce..0000000
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-*/
-
-/**
- * @file    templates/chconf.h
- * @brief   Configuration file template.
- * @details A copy of this file must be placed in each project directory, it
- *          contains the application specific kernel settings.
- *
- * @addtogroup config
- * @details Kernel related settings and hooks.
- * @{
- */
-
-#ifndef CHCONF_H
-#define CHCONF_H
-
-#define _CHIBIOS_RT_CONF_
-
-/*===========================================================================*/
-/**
- * @name System timers settings
- * @{
- */
-/*===========================================================================*/
-
-/**
- * @brief   System time counter resolution.
- * @note    Allowed values are 16 or 32 bits.
- */
-#define CH_CFG_ST_RESOLUTION                32
-
-/**
- * @brief   System tick frequency.
- * @details Frequency of the system timer that drives the system ticks. This
- *          setting also defines the system tick time unit.
- */
-#define CH_CFG_ST_FREQUENCY                 10000
-
-/**
- * @brief   Time delta constant for the tick-less mode.
- * @note    If this value is zero then the system uses the classic
- *          periodic tick. This value represents the minimum number
- *          of ticks that is safe to specify in a timeout directive.
- *          The value one is not valid, timeouts are rounded up to
- *          this value.
- */
-#define CH_CFG_ST_TIMEDELTA                 2
-
-/** @} */
-
-/*===========================================================================*/
-/**
- * @name Kernel parameters and options
- * @{
- */
-/*===========================================================================*/
-
-/**
- * @brief   Round robin interval.
- * @details This constant is the number of system ticks allowed for the
- *          threads before preemption occurs. Setting this value to zero
- *          disables the preemption for threads with equal priority and the
- *          round robin becomes cooperative. Note that higher priority
- *          threads can still preempt, the kernel is always preemptive.
- * @note    Disabling the round robin preemption makes the kernel more compact
- *          and generally faster.
- * @note    The round robin preemption is not supported in tickless mode and
- *          must be set to zero in that case.
- */
-#define CH_CFG_TIME_QUANTUM                 0
-
-/**
- * @brief   Managed RAM size.
- * @details Size of the RAM area to be managed by the OS. If set to zero
- *          then the whole available RAM is used. The core memory is made
- *          available to the heap allocator and/or can be used directly through
- *          the simplified core memory allocator.
- *
- * @note    In order to let the OS manage the whole RAM the linker script must
- *          provide the @p __heap_base__ and @p __heap_end__ symbols.
- * @note    Requires @p CH_CFG_USE_MEMCORE.
- */
-#define CH_CFG_MEMCORE_SIZE                 0
-
-/**
- * @brief   Idle thread automatic spawn suppression.
- * @details When this option is activated the function @p chSysInit()
- *          does not spawn the idle thread. The application @p main()
- *          function becomes the idle thread and must implement an
- *          infinite loop.
- */
-#define CH_CFG_NO_IDLE_THREAD               FALSE
-
-/* Use __WFI in the idle thread for waiting. Does lower the power
- * consumption. */
-#define CORTEX_ENABLE_WFI_IDLE              TRUE
-
-/** @} */
-
-/*===========================================================================*/
-/**
- * @name Performance options
- * @{
- */
-/*===========================================================================*/
-
-/**
- * @brief   OS optimization.
- * @details If enabled then time efficient rather than space efficient code
- *          is used when two possible implementations exist.
- *
- * @note    This is not related to the compiler optimization options.
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_OPTIMIZE_SPEED               FALSE
-
-/** @} */
-
-/*===========================================================================*/
-/**
- * @name Subsystem options
- * @{
- */
-/*===========================================================================*/
-
-/**
- * @brief   Time Measurement APIs.
- * @details If enabled then the time measurement APIs are included in
- *          the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_TM                       FALSE
-
-/**
- * @brief   Threads registry APIs.
- * @details If enabled then the registry APIs are included in the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_REGISTRY                 TRUE
-
-/**
- * @brief   Threads synchronization APIs.
- * @details If enabled then the @p chThdWait() function is included in
- *          the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_WAITEXIT                 TRUE
-
-/**
- * @brief   Semaphores APIs.
- * @details If enabled then the Semaphores APIs are included in the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_SEMAPHORES               TRUE
-
-/**
- * @brief   Semaphores queuing mode.
- * @details If enabled then the threads are enqueued on semaphores by
- *          priority rather than in FIFO order.
- *
- * @note    The default is @p FALSE. Enable this if you have special
- *          requirements.
- * @note    Requires @p CH_CFG_USE_SEMAPHORES.
- */
-#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE
-
-/**
- * @brief   Mutexes APIs.
- * @details If enabled then the mutexes APIs are included in the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_MUTEXES                  TRUE
-
-/**
- * @brief   Enables recursive behavior on mutexes.
- * @note    Recursive mutexes are heavier and have an increased
- *          memory footprint.
- *
- * @note    The default is @p FALSE.
- * @note    Requires @p CH_CFG_USE_MUTEXES.
- */
-#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE
-
-/**
- * @brief   Conditional Variables APIs.
- * @details If enabled then the conditional variables APIs are included
- *          in the kernel.
- *
- * @note    The default is @p TRUE.
- * @note    Requires @p CH_CFG_USE_MUTEXES.
- */
-#define CH_CFG_USE_CONDVARS                 TRUE
-
-/**
- * @brief   Conditional Variables APIs with timeout.
- * @details If enabled then the conditional variables APIs with timeout
- *          specification are included in the kernel.
- *
- * @note    The default is @p TRUE.
- * @note    Requires @p CH_CFG_USE_CONDVARS.
- */
-#define CH_CFG_USE_CONDVARS_TIMEOUT         FALSE
-
-/**
- * @brief   Events Flags APIs.
- * @details If enabled then the event flags APIs are included in the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_EVENTS                   TRUE
-
-/**
- * @brief   Events Flags APIs with timeout.
- * @details If enabled then the events APIs with timeout specification
- *          are included in the kernel.
- *
- * @note    The default is @p TRUE.
- * @note    Requires @p CH_CFG_USE_EVENTS.
- */
-#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE
-
-/**
- * @brief   Synchronous Messages APIs.
- * @details If enabled then the synchronous messages APIs are included
- *          in the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_MESSAGES                 TRUE
-
-/**
- * @brief   Synchronous Messages queuing mode.
- * @details If enabled then messages are served by priority rather than in
- *          FIFO order.
- *
- * @note    The default is @p FALSE. Enable this if you have special
- *          requirements.
- * @note    Requires @p CH_CFG_USE_MESSAGES.
- */
-#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE
-
-/**
- * @brief   Mailboxes APIs.
- * @details If enabled then the asynchronous messages (mailboxes) APIs are
- *          included in the kernel.
- *
- * @note    The default is @p TRUE.
- * @note    Requires @p CH_CFG_USE_SEMAPHORES.
- */
-#define CH_CFG_USE_MAILBOXES                TRUE
-
-/**
- * @brief   Core Memory Manager APIs.
- * @details If enabled then the core memory manager APIs are included
- *          in the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_MEMCORE                  FALSE
-
-/**
- * @brief   Heap Allocator APIs.
- * @details If enabled then the memory heap allocator APIs are included
- *          in the kernel.
- *
- * @note    The default is @p TRUE.
- * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
- *          @p CH_CFG_USE_SEMAPHORES.
- * @note    Mutexes are recommended.
- */
-#define CH_CFG_USE_HEAP                     FALSE
-
-/**
- * @brief   Memory Pools Allocator APIs.
- * @details If enabled then the memory pools allocator APIs are included
- *          in the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_MEMPOOLS                 FALSE
-
-/**
- * @brief   Dynamic Threads APIs.
- * @details If enabled then the dynamic threads creation APIs are included
- *          in the kernel.
- *
- * @note    The default is @p TRUE.
- * @note    Requires @p CH_CFG_USE_WAITEXIT.
- * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
- */
-#define CH_CFG_USE_DYNAMIC                  FALSE
-
-/** @} */
-
-/*===========================================================================*/
-/**
- * @name Debug options
- * @{
- */
-/*===========================================================================*/
-
-/**
- * @brief   Debug option, kernel statistics.
- *
- * @note    The default is @p FALSE.
- */
-#define CH_DBG_STATISTICS                   FALSE
-
-/**
- * @brief   Debug option, system state check.
- * @details If enabled the correct call protocol for system APIs is checked
- *          at runtime.
- *
- * @note    The default is @p FALSE.
- */
-#define CH_DBG_SYSTEM_STATE_CHECK           FALSE
-
-/**
- * @brief   Debug option, parameters checks.
- * @details If enabled then the checks on the API functions input
- *          parameters are activated.
- *
- * @note    The default is @p FALSE.
- */
-#define CH_DBG_ENABLE_CHECKS                FALSE
-
-/**
- * @brief   Debug option, consistency checks.
- * @details If enabled then all the assertions in the kernel code are
- *          activated. This includes consistency checks inside the kernel,
- *          runtime anomalies and port-defined checks.
- *
- * @note    The default is @p FALSE.
- */
-#define CH_DBG_ENABLE_ASSERTS               FALSE
-
-/**
- * @brief   Debug option, trace buffer.
- * @details If enabled then the trace buffer is activated.
- *
- * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
- */
-#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
-
-/**
- * @brief   Trace buffer entries.
- * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
- *          different from @p CH_DBG_TRACE_MASK_DISABLED.
- */
-#define CH_DBG_TRACE_BUFFER_SIZE            128
-
-/**
- * @brief   Debug option, stack checks.
- * @details If enabled then a runtime stack check is performed.
- *
- * @note    The default is @p FALSE.
- * @note    The stack check is performed in a architecture/port dependent way.
- *          It may not be implemented or some ports.
- * @note    The default failure mode is to halt the system with the global
- *          @p panic_msg variable set to @p NULL.
- */
-#define CH_DBG_ENABLE_STACK_CHECK           FALSE
-
-/**
- * @brief   Debug option, stacks initialization.
- * @details If enabled then the threads working area is filled with a byte
- *          value when a thread is created. This can be useful for the
- *          runtime measurement of the used stack.
- *
- * @note    The default is @p FALSE.
- */
-#define CH_DBG_FILL_THREADS                 FALSE
-
-/**
- * @brief   Debug option, threads profiling.
- * @details If enabled then a field is added to the @p thread_t structure that
- *          counts the system ticks occurred while executing the thread.
- *
- * @note    The default is @p FALSE.
- * @note    This debug option is not currently compatible with the
- *          tickless mode.
- */
-#define CH_DBG_THREADS_PROFILING            FALSE
-
-/** @} */
-
-/*===========================================================================*/
-/**
- * @name Kernel hooks
- * @{
- */
-/*===========================================================================*/
-
-/**
- * @brief   Threads descriptor structure extension.
- * @details User fields added to the end of the @p thread_t structure.
- */
-#define CH_CFG_THREAD_EXTRA_FIELDS                                          \
-  /* Add threads custom fields here.*/
-
-/**
- * @brief   Threads initialization hook.
- * @details User initialization code added to the @p chThdInit() API.
- *
- * @note    It is invoked from within @p chThdInit() and implicitly from all
- *          the threads creation APIs.
- */
-#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
-  /* Add threads initialization code here.*/                                \
-}
-
-/**
- * @brief   Threads finalization hook.
- * @details User finalization code added to the @p chThdExit() API.
- */
-#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
-  /* Add threads finalization code here.*/                                  \
-}
-
-/**
- * @brief   Context switch hook.
- * @details This hook is invoked just before switching between threads.
- */
-#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \
-  /* Context switch code here.*/                                            \
-}
-
-/**
- * @brief   ISR enter hook.
- */
-#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
-  /* IRQ prologue code here.*/                                              \
-}
-
-/**
- * @brief   ISR exit hook.
- */
-#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
-  /* IRQ epilogue code here.*/                                              \
-}
-
-/**
- * @brief   Idle thread enter hook.
- * @note    This hook is invoked within a critical zone, no OS functions
- *          should be invoked from here.
- * @note    This macro can be used to activate a power saving mode.
- */
-#define CH_CFG_IDLE_ENTER_HOOK() {                                          \
-  /* Idle-enter code here.*/                                                \
-}
-
-/**
- * @brief   Idle thread leave hook.
- * @note    This hook is invoked within a critical zone, no OS functions
- *          should be invoked from here.
- * @note    This macro can be used to deactivate a power saving mode.
- */
-#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
-  /* Idle-leave code here.*/                                                \
-}
-
-/**
- * @brief   Idle Loop hook.
- * @details This hook is continuously invoked by the idle thread loop.
- */
-#define CH_CFG_IDLE_LOOP_HOOK() {                                           \
-  /* Idle loop code here.*/                                                 \
-}
-
-/**
- * @brief   System tick event hook.
- * @details This hook is invoked in the system tick handler immediately
- *          after processing the virtual timers queue.
- */
-#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \
-  /* System tick event code here.*/                                         \
-}
-
-/**
- * @brief   System halt hook.
- * @details This hook is invoked in case to a system halting error before
- *          the system is halted.
- */
-#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
-  /* System halt code here.*/                                               \
-}
-
-/**
- * @brief   Trace hook.
- * @details This hook is invoked each time a new record is written in the
- *          trace buffer.
- */
-#define CH_CFG_TRACE_HOOK(tep) {                                            \
-  /* Trace code here.*/                                                     \
-}
-
-/** @} */
-
-/*===========================================================================*/
-/* Port-specific settings (override port settings defaulted in chcore.h).    */
-/*===========================================================================*/
-
-#endif  /* CHCONF_H */
-
-/** @} */
diff --git a/keyboards/stm32_f072_onekey/config.h b/keyboards/stm32_f072_onekey/config.h
deleted file mode 100644 (file)
index bb5251e..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
-Copyright 2015 Jun Wako <wakojun@gmail.com>
-
-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/>.
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#include "config_common.h"
-
-/* USB Device descriptor parameter */
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x6464
-#define DEVICE_VER      0x0001
-/* in python2: list(u"whatever".encode('utf-16-le')) */
-/*   at most 32 characters or the ugly hack in usb_main.c borks */
-#define MANUFACTURER "TMK"
-#define USBSTR_MANUFACTURER    'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00'
-#define PRODUCT "ChibiOS TMK test"
-#define USBSTR_PRODUCT         'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', 't', '\x00', 'e', '\x00', 's', '\x00', 't', '\x00'
-#define DESCRIPTION "TMK keyboard firmware over ChibiOS"
-
-/* key matrix size */
-#define MATRIX_ROWS 1
-#define MATRIX_COLS 1
-#define DIODE_DIRECTION COL2ROW
-
-/* define if matrix has ghost */
-//#define MATRIX_HAS_GHOST
-
-/* 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 */
-#define IS_COMMAND() ( \
-    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
-)
-
-
-
-/*
- * Feature disable options
- *  These options are also useful to firmware size reduction.
- */
-
-/* disable debug print */
-//#define NO_DEBUG
-
-/* disable print */
-//#define NO_PRINT
-
-/* disable action features */
-//#define NO_ACTION_LAYER
-//#define NO_ACTION_TAPPING
-//#define NO_ACTION_ONESHOT
-//#define NO_ACTION_MACRO
-//#define NO_ACTION_FUNCTION
-
-#endif
diff --git a/keyboards/stm32_f072_onekey/halconf.h b/keyboards/stm32_f072_onekey/halconf.h
deleted file mode 100644 (file)
index 1a450d6..0000000
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-*/
-
-/**
- * @file    templates/halconf.h
- * @brief   HAL configuration header.
- * @details HAL configuration file, this file allows to enable or disable the
- *          various device drivers from your application. You may also use
- *          this file in order to override the device drivers default settings.
- *
- * @addtogroup HAL_CONF
- * @{
- */
-
-#ifndef _HALCONF_H_
-#define _HALCONF_H_
-
-#include "mcuconf.h"
-
-/**
- * @brief   Enables the PAL subsystem.
- */
-#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
-#define HAL_USE_PAL                 TRUE
-#endif
-
-/**
- * @brief   Enables the ADC subsystem.
- */
-#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
-#define HAL_USE_ADC                 FALSE
-#endif
-
-/**
- * @brief   Enables the CAN subsystem.
- */
-#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
-#define HAL_USE_CAN                 FALSE
-#endif
-
-/**
- * @brief   Enables the DAC subsystem.
- */
-#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
-#define HAL_USE_DAC                 FALSE
-#endif
-
-/**
- * @brief   Enables the EXT subsystem.
- */
-#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
-#define HAL_USE_EXT                 FALSE
-#endif
-
-/**
- * @brief   Enables the GPT subsystem.
- */
-#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
-#define HAL_USE_GPT                 FALSE
-#endif
-
-/**
- * @brief   Enables the I2C subsystem.
- */
-#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
-#define HAL_USE_I2C                 FALSE
-#endif
-
-/**
- * @brief   Enables the I2S subsystem.
- */
-#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
-#define HAL_USE_I2S                 FALSE
-#endif
-
-/**
- * @brief   Enables the ICU subsystem.
- */
-#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
-#define HAL_USE_ICU                 FALSE
-#endif
-
-/**
- * @brief   Enables the MAC subsystem.
- */
-#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
-#define HAL_USE_MAC                 FALSE
-#endif
-
-/**
- * @brief   Enables the MMC_SPI subsystem.
- */
-#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
-#define HAL_USE_MMC_SPI             FALSE
-#endif
-
-/**
- * @brief   Enables the PWM subsystem.
- */
-#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
-#define HAL_USE_PWM                 FALSE
-#endif
-
-/**
- * @brief   Enables the RTC subsystem.
- */
-#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
-#define HAL_USE_RTC                 FALSE
-#endif
-
-/**
- * @brief   Enables the SDC subsystem.
- */
-#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
-#define HAL_USE_SDC                 FALSE
-#endif
-
-/**
- * @brief   Enables the SERIAL subsystem.
- */
-#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
-#define HAL_USE_SERIAL              FALSE
-#endif
-
-/**
- * @brief   Enables the SERIAL over USB subsystem.
- */
-#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
-#define HAL_USE_SERIAL_USB          FALSE
-#endif
-
-/**
- * @brief   Enables the SPI subsystem.
- */
-#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
-#define HAL_USE_SPI                 FALSE
-#endif
-
-/**
- * @brief   Enables the UART subsystem.
- */
-#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
-#define HAL_USE_UART                FALSE
-#endif
-
-/**
- * @brief   Enables the USB subsystem.
- */
-#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
-#define HAL_USE_USB                 TRUE
-#endif
-
-/**
- * @brief   Enables the WDG subsystem.
- */
-#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
-#define HAL_USE_WDG                 FALSE
-#endif
-
-/*===========================================================================*/
-/* ADC driver related settings.                                              */
-/*===========================================================================*/
-
-/**
- * @brief   Enables synchronous APIs.
- * @note    Disabling this option saves both code and data space.
- */
-#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
-#define ADC_USE_WAIT                TRUE
-#endif
-
-/**
- * @brief   Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
- * @note    Disabling this option saves both code and data space.
- */
-#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
-#define ADC_USE_MUTUAL_EXCLUSION    TRUE
-#endif
-
-/*===========================================================================*/
-/* CAN driver related settings.                                              */
-/*===========================================================================*/
-
-/**
- * @brief   Sleep mode related APIs inclusion switch.
- */
-#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
-#define CAN_USE_SLEEP_MODE          TRUE
-#endif
-
-/*===========================================================================*/
-/* I2C driver related settings.                                              */
-/*===========================================================================*/
-
-/**
- * @brief   Enables the mutual exclusion APIs on the I2C bus.
- */
-#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
-#define I2C_USE_MUTUAL_EXCLUSION    TRUE
-#endif
-
-/*===========================================================================*/
-/* MAC driver related settings.                                              */
-/*===========================================================================*/
-
-/**
- * @brief   Enables an event sources for incoming packets.
- */
-#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
-#define MAC_USE_ZERO_COPY           FALSE
-#endif
-
-/**
- * @brief   Enables an event sources for incoming packets.
- */
-#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
-#define MAC_USE_EVENTS              TRUE
-#endif
-
-/*===========================================================================*/
-/* MMC_SPI driver related settings.                                          */
-/*===========================================================================*/
-
-/**
- * @brief   Delays insertions.
- * @details If enabled this options inserts delays into the MMC waiting
- *          routines releasing some extra CPU time for the threads with
- *          lower priority, this may slow down the driver a bit however.
- *          This option is recommended also if the SPI driver does not
- *          use a DMA channel and heavily loads the CPU.
- */
-#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
-#define MMC_NICE_WAITING            TRUE
-#endif
-
-/*===========================================================================*/
-/* SDC driver related settings.                                              */
-/*===========================================================================*/
-
-/**
- * @brief   Number of initialization attempts before rejecting the card.
- * @note    Attempts are performed at 10mS intervals.
- */
-#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
-#define SDC_INIT_RETRY              100
-#endif
-
-/**
- * @brief   Include support for MMC cards.
- * @note    MMC support is not yet implemented so this option must be kept
- *          at @p FALSE.
- */
-#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
-#define SDC_MMC_SUPPORT             FALSE
-#endif
-
-/**
- * @brief   Delays insertions.
- * @details If enabled this options inserts delays into the MMC waiting
- *          routines releasing some extra CPU time for the threads with
- *          lower priority, this may slow down the driver a bit however.
- */
-#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
-#define SDC_NICE_WAITING            TRUE
-#endif
-
-/*===========================================================================*/
-/* SERIAL driver related settings.                                           */
-/*===========================================================================*/
-
-/**
- * @brief   Default bit rate.
- * @details Configuration parameter, this is the baud rate selected for the
- *          default configuration.
- */
-#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
-#define SERIAL_DEFAULT_BITRATE      38400
-#endif
-
-/**
- * @brief   Serial buffers size.
- * @details Configuration parameter, you can change the depth of the queue
- *          buffers depending on the requirements of your application.
- * @note    The default is 64 bytes for both the transmission and receive
- *          buffers.
- */
-#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
-#define SERIAL_BUFFERS_SIZE         16
-#endif
-
-/*===========================================================================*/
-/* SERIAL_USB driver related setting.                                        */
-/*===========================================================================*/
-
-/**
- * @brief   Serial over USB buffers size.
- * @details Configuration parameter, the buffer size must be a multiple of
- *          the USB data endpoint maximum packet size.
- * @note    The default is 64 bytes for both the transmission and receive
- *          buffers.
- */
-#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
-#define SERIAL_USB_BUFFERS_SIZE     256
-#endif
-
-/*===========================================================================*/
-/* SPI driver related settings.                                              */
-/*===========================================================================*/
-
-/**
- * @brief   Enables synchronous APIs.
- * @note    Disabling this option saves both code and data space.
- */
-#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
-#define SPI_USE_WAIT                TRUE
-#endif
-
-/**
- * @brief   Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
- * @note    Disabling this option saves both code and data space.
- */
-#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
-#define SPI_USE_MUTUAL_EXCLUSION    TRUE
-#endif
-
-/*===========================================================================*/
-/* USB driver related settings.                                              */
-/*===========================================================================*/
-
-/**
- * @brief   Enables synchronous APIs.
- * @note    Disabling this option saves both code and data space.
- */
-#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
-#define USB_USE_WAIT                TRUE
-#endif
-
-#endif /* _HALCONF_H_ */
-
-/** @} */
diff --git a/keyboards/stm32_f072_onekey/keymaps/default/keymap.c b/keyboards/stm32_f072_onekey/keymaps/default/keymap.c
deleted file mode 100644 (file)
index 6c48149..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
-
-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/>.
-*/
-
-#include "stm32_f072_onekey.h"
-
-const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    {{KC_CAPS}}, // test with KC_CAPS, KC_A, KC_BTLD
-};
-
-const uint16_t fn_actions[] = {
-};
diff --git a/keyboards/stm32_f072_onekey/led.c b/keyboards/stm32_f072_onekey/led.c
deleted file mode 100644 (file)
index 18edb8b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-Copyright 2012 Jun Wako <wakojun@gmail.com>
-
-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/>.
-*/
-
-#include "hal.h"
-
-#include "led.h"
-
-
-void led_set(uint8_t usb_led)
-{
-    (void)usb_led;
-    if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
-        // output high
-        palSetPadMode(GPIOC, GPIOC_LED_GREEN, PAL_MODE_OUTPUT_PUSHPULL);
-        palSetPad(GPIOC, GPIOC_LED_GREEN);
-    } else {
-        // Hi-Z
-        palSetPadMode(GPIOC, GPIOC_LED_GREEN, PAL_MODE_INPUT);
-    }
-}
diff --git a/keyboards/stm32_f072_onekey/matrix.c b/keyboards/stm32_f072_onekey/matrix.c
deleted file mode 100644 (file)
index a05b38c..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
-Copyright 2012 Jun Wako <wakojun@gmail.com>
-
-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/>.
-*/
-
-#include "ch.h"
-#include "hal.h"
-
-/*
- * scan matrix
- */
-#include "print.h"
-#include "debug.h"
-#include "util.h"
-#include "matrix.h"
-#include "wait.h"
-
-#ifndef DEBOUNCE
-#   define DEBOUNCE 5
-#endif
-static uint8_t debouncing = DEBOUNCE;
-
-/* matrix state(1:on, 0:off) */
-static matrix_row_t matrix[MATRIX_ROWS];
-static matrix_row_t matrix_debouncing[MATRIX_ROWS];
-
-static matrix_row_t read_cols(void);
-static void init_cols(void);
-static void unselect_rows(void);
-static void select_row(uint8_t row);
-
-
-inline
-uint8_t matrix_rows(void)
-{
-    return MATRIX_ROWS;
-}
-
-inline
-uint8_t matrix_cols(void)
-{
-    return MATRIX_COLS;
-}
-
-#define LED_ON()    do { palSetPad(GPIOC, GPIOC_LED_BLUE) ;} while (0)
-#define LED_OFF()   do { palClearPad(GPIOC, GPIOC_LED_BLUE); } while (0)
-#define LED_TGL()   do { palTogglePad(GPIOC, GPIOC_LED_BLUE); } while (0)
-
-void matrix_init(void)
-{
-    // initialize row and col
-    unselect_rows();
-    init_cols();
-
-    // initialize matrix state: all keys off
-    for (uint8_t i=0; i < MATRIX_ROWS; i++) {
-        matrix[i] = 0;
-        matrix_debouncing[i] = 0;
-    }
-
-    //debug
-    debug_matrix = true;
-    LED_ON();
-    wait_ms(500);
-    LED_OFF();
-}
-
-uint8_t matrix_scan(void)
-{
-    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-        select_row(i);
-        wait_us(30);  // without this wait read unstable value.
-        matrix_row_t cols = read_cols();
-        if (matrix_debouncing[i] != cols) {
-            matrix_debouncing[i] = cols;
-            if (debouncing) {
-                debug("bounce!: "); debug_hex(debouncing); debug("\n");
-            }
-            debouncing = DEBOUNCE;
-        }
-        unselect_rows();
-    }
-
-    if (debouncing) {
-        if (--debouncing) {
-            wait_ms(1);
-        } else {
-            for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-                matrix[i] = matrix_debouncing[i];
-            }
-        }
-    }
-
-    return 1;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
-    return (matrix[row] & ((matrix_row_t)1<<col));
-}
-
-inline
-matrix_row_t matrix_get_row(uint8_t row)
-{
-    return matrix[row];
-}
-
-void matrix_print(void)
-{
-    print("\nr/c 0123456789ABCDEF\n");
-    for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
-        phex(row); print(": ");
-        pbin_reverse16(matrix_get_row(row));
-        print("\n");
-    }
-}
-
-/* Column pin configuration
- */
-static void  init_cols(void)
-{
-    // don't need pullup/down, since it's pulled down in hardware
-    palSetPadMode(GPIOA, GPIOA_BUTTON, PAL_MODE_INPUT);
-}
-
-/* Returns status of switches(1:on, 0:off) */
-static matrix_row_t read_cols(void)
-{
-    return ((palReadPad(GPIOA, GPIOA_BUTTON)==PAL_LOW) ? 0 : (1<<0));
-    // | ((palReadPad(...)==PAL_HIGH) ? 0 : (1<<1))
-}
-
-/* Row pin configuration
- */
-static void unselect_rows(void)
-{
-    // palSetPadMode(GPIOA, GPIOA_PIN10, PAL_MODE_INPUT); // hi-Z
-}
-
-static void select_row(uint8_t row)
-{
-    (void)row;
-    // Output low to select
-    // switch (row) {
-    //     case 0:
-    //         palSetPadMode(GPIOA, GPIOA_PIN10, PAL_MODE_OUTPUT_PUSHPULL);
-    //         palSetPad(GPIOA, GPIOA_PIN10, PAL_LOW);
-    //         break;
-    // }
-}
diff --git a/keyboards/stm32_f072_onekey/mcuconf.h b/keyboards/stm32_f072_onekey/mcuconf.h
deleted file mode 100644 (file)
index 3d877aa..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-#ifndef _MCUCONF_H_\r
-#define _MCUCONF_H_\r
-\r
-/*\r
- * STM32F0xx drivers configuration.\r
- * The following settings override the default settings present in\r
- * the various device driver implementation headers.\r
- * Note that the settings for each driver only have effect if the whole\r
- * driver is enabled in halconf.h.\r
- *\r
- * IRQ priorities:\r
- * 3...0       Lowest...Highest.\r
- *\r
- * DMA priorities:\r
- * 0...3        Lowest...Highest.\r
- */\r
-\r
-#define STM32F0xx_MCUCONF\r
-\r
-/*\r
- * HAL driver system settings.\r
- */\r
-#define STM32_NO_INIT                       FALSE\r
-#define STM32_PVD_ENABLE                    FALSE\r
-#define STM32_PLS                           STM32_PLS_LEV0\r
-#define STM32_HSI_ENABLED                   TRUE\r
-#define STM32_HSI14_ENABLED                 TRUE\r
-#define STM32_HSI48_ENABLED                 FALSE\r
-#define STM32_LSI_ENABLED                   TRUE\r
-#define STM32_HSE_ENABLED                   FALSE\r
-#define STM32_LSE_ENABLED                   FALSE\r
-#define STM32_SW                            STM32_SW_PLL\r
-#define STM32_PLLSRC                        STM32_PLLSRC_HSI_DIV2\r
-#define STM32_PREDIV_VALUE                  1\r
-#define STM32_PLLMUL_VALUE                  12\r
-#define STM32_HPRE                          STM32_HPRE_DIV1\r
-#define STM32_PPRE                          STM32_PPRE_DIV1\r
-#define STM32_ADCSW                         STM32_ADCSW_HSI14\r
-#define STM32_ADCPRE                        STM32_ADCPRE_DIV4\r
-#define STM32_MCOSEL                        STM32_MCOSEL_NOCLOCK\r
-#define STM32_ADCPRE                        STM32_ADCPRE_DIV4\r
-#define STM32_ADCSW                         STM32_ADCSW_HSI14\r
-#define STM32_USBSW                         STM32_USBSW_HSI48\r
-#define STM32_CECSW                         STM32_CECSW_HSI\r
-#define STM32_I2C1SW                        STM32_I2C1SW_HSI\r
-#define STM32_USART1SW                      STM32_USART1SW_PCLK\r
-#define STM32_RTCSEL                        STM32_RTCSEL_LSI\r
-\r
-/*\r
- * ADC driver system settings.\r
- */\r
-#define STM32_ADC_USE_ADC1                  FALSE\r
-#define STM32_ADC_ADC1_DMA_PRIORITY         2\r
-#define STM32_ADC_IRQ_PRIORITY              2\r
-#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY     2\r
-\r
-/*\r
- * EXT driver system settings.\r
- */\r
-#define STM32_EXT_EXTI0_1_IRQ_PRIORITY      3\r
-#define STM32_EXT_EXTI2_3_IRQ_PRIORITY      3\r
-#define STM32_EXT_EXTI4_15_IRQ_PRIORITY     3\r
-#define STM32_EXT_EXTI16_IRQ_PRIORITY       3\r
-#define STM32_EXT_EXTI17_IRQ_PRIORITY       3\r
-\r
-/*\r
- * GPT driver system settings.\r
- */\r
-#define STM32_GPT_USE_TIM1                  FALSE\r
-#define STM32_GPT_USE_TIM2                  FALSE\r
-#define STM32_GPT_USE_TIM3                  FALSE\r
-#define STM32_GPT_USE_TIM14                 FALSE\r
-#define STM32_GPT_TIM1_IRQ_PRIORITY         2\r
-#define STM32_GPT_TIM2_IRQ_PRIORITY         2\r
-#define STM32_GPT_TIM3_IRQ_PRIORITY         2\r
-#define STM32_GPT_TIM14_IRQ_PRIORITY        2\r
-\r
-/*\r
- * I2C driver system settings.\r
- */\r
-#define STM32_I2C_USE_I2C1                  FALSE\r
-#define STM32_I2C_USE_I2C2                  FALSE\r
-#define STM32_I2C_BUSY_TIMEOUT              50\r
-#define STM32_I2C_I2C1_IRQ_PRIORITY         3\r
-#define STM32_I2C_I2C2_IRQ_PRIORITY         3\r
-#define STM32_I2C_USE_DMA                   TRUE\r
-#define STM32_I2C_I2C1_DMA_PRIORITY         1\r
-#define STM32_I2C_I2C2_DMA_PRIORITY         1\r
-#define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")\r
-\r
-/*\r
- * ICU driver system settings.\r
- */\r
-#define STM32_ICU_USE_TIM1                  FALSE\r
-#define STM32_ICU_USE_TIM2                  FALSE\r
-#define STM32_ICU_USE_TIM3                  FALSE\r
-#define STM32_ICU_TIM1_IRQ_PRIORITY         3\r
-#define STM32_ICU_TIM2_IRQ_PRIORITY         3\r
-#define STM32_ICU_TIM3_IRQ_PRIORITY         3\r
-\r
-/*\r
- * PWM driver system settings.\r
- */\r
-#define STM32_PWM_USE_ADVANCED              FALSE\r
-#define STM32_PWM_USE_TIM1                  FALSE\r
-#define STM32_PWM_USE_TIM2                  FALSE\r
-#define STM32_PWM_USE_TIM3                  FALSE\r
-#define STM32_PWM_TIM1_IRQ_PRIORITY         3\r
-#define STM32_PWM_TIM2_IRQ_PRIORITY         3\r
-#define STM32_PWM_TIM3_IRQ_PRIORITY         3\r
-\r
-/*\r
- * SERIAL driver system settings.\r
- */\r
-#define STM32_SERIAL_USE_USART1             FALSE\r
-#define STM32_SERIAL_USE_USART2             FALSE\r
-#define STM32_SERIAL_USART1_PRIORITY        3\r
-#define STM32_SERIAL_USART2_PRIORITY        3\r
-\r
-/*\r
- * SPI driver system settings.\r
- */\r
-#define STM32_SPI_USE_SPI1                  FALSE\r
-#define STM32_SPI_USE_SPI2                  FALSE\r
-#define STM32_SPI_SPI1_DMA_PRIORITY         1\r
-#define STM32_SPI_SPI2_DMA_PRIORITY         1\r
-#define STM32_SPI_SPI1_IRQ_PRIORITY         2\r
-#define STM32_SPI_SPI2_IRQ_PRIORITY         2\r
-#define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")\r
-\r
-/*\r
- * ST driver system settings.\r
- */\r
-#define STM32_ST_IRQ_PRIORITY               2\r
-#define STM32_ST_USE_TIMER                  2\r
-\r
-/*\r
- * UART driver system settings.\r
- */\r
-#define STM32_UART_USE_USART1               FALSE\r
-#define STM32_UART_USE_USART2               FALSE\r
-#define STM32_UART_USART1_IRQ_PRIORITY      3\r
-#define STM32_UART_USART2_IRQ_PRIORITY      3\r
-#define STM32_UART_USART1_DMA_PRIORITY      0\r
-#define STM32_UART_USART2_DMA_PRIORITY      0\r
-#define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")\r
-\r
-/*\r
- * USB driver system settings.\r
- */\r
-#define STM32_USB_USE_USB1                  TRUE\r
-#define STM32_USB_LOW_POWER_ON_SUSPEND      FALSE\r
-#define STM32_USB_USB1_LP_IRQ_PRIORITY      3\r
-\r
-#endif /* _MCUCONF_H_ */\r
diff --git a/keyboards/stm32_f072_onekey/stm32_f072_onekey.c b/keyboards/stm32_f072_onekey/stm32_f072_onekey.c
deleted file mode 100644 (file)
index 820d062..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "stm32_f072_onekey.h"
diff --git a/keyboards/stm32_f072_onekey/stm32_f072_onekey.h b/keyboards/stm32_f072_onekey/stm32_f072_onekey.h
deleted file mode 100644 (file)
index 1f798c8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifndef STM32_F072_ONEKEY_H
-#define STM32_F072_ONEKEY_H
-#include "quantum.h"
-#endif
-
diff --git a/keyboards/stm32_f103_onekey/Makefile b/keyboards/stm32_f103_onekey/Makefile
deleted file mode 100644 (file)
index 5c1793c..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# project specific files
-SRC =  matrix.c \
-           led.c
-
-# GENERIC STM32F103C8T6 board - stm32duino bootloader
-OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000
-MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
-BOARD = GENERIC_STM32_F103
-
-# GENERIC STM32F103C8T6 board - no bootloader (programmer over serial or SWD)
-# OPT_DEFS =
-# MCU_LDSCRIPT = STM32F103x8
-# BOARD = GENERIC_STM32_F103
-
-# MAPLE MINI
-# OPT_DEFS = -DCORTEX_VTOR_INIT=0x5000
-# MCU_LDSCRIPT = STM32F103xB_maplemini_bootloader
-# BOARD = MAPLEMINI_STM32_F103
-
-## chip/board settings
-# the next two should match the directories in
-#  <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
-MCU_FAMILY = STM32
-MCU_SERIES = STM32F1xx
-# linker script to use
-# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
-#  or <this_dir>/ld/
-# startup code to use
-# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
-MCU_STARTUP = stm32f1xx
-# it should exist either in <chibios>/os/hal/boards/
-#  or <this_dir>/boards
-# Cortex version
-# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
-MCU  = cortex-m3
-# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
-ARMV = 7
-# If you want to be able to jump to bootloader from firmware on STM32 MCUs,
-# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in
-# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have
-# a custom board definition that you plan to reuse).
-# If you're not setting it here, leave it commented out.
-# It is chip dependent, the correct number can be looked up here (page 175):
-# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
-# This also requires a patch to chibios:
-#   <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
-#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
-
-# Build Options
-#   comment out to disable the options.
-#
-#BOOTMAGIC_ENABLE = yes        # Virtual DIP switch configuration
-## BOOTMAGIC is not supported on STM32 chips yet.
-MOUSEKEY_ENABLE ?= yes # Mouse keys
-EXTRAKEY_ENABLE ?= yes # Audio control and System control
-# CONSOLE_ENABLE ?= yes        # Console for debug
-COMMAND_ENABLE ?= yes    # Commands for debug and configuration
-SLEEP_LED_ENABLE ?= no   # Breathing sleep LED during USB suspend
-NKRO_ENABLE ?= yes         # USB Nkey Rollover
-CUSTOM_MATRIX ?= yes # Custom matrix file
-
-ifndef QUANTUM_DIR
-       include ../../Makefile
-endif
diff --git a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c b/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c
deleted file mode 100644 (file)
index 31319ef..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-#include "hal.h"\r
-\r
-/**\r
- * @brief   PAL setup.\r
- * @details Digital I/O ports static configuration as defined in @p board.h.\r
- *          This variable is used by the HAL when initializing the PAL driver.\r
- */\r
-#if HAL_USE_PAL || defined(__DOXYGEN__)\r
-const PALConfig pal_default_config =\r
-{\r
-  {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},\r
-  {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},\r
-  {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},\r
-  {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},\r
-  {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},\r
-};\r
-#endif\r
-\r
-/*\r
- * Early initialization code.\r
- * This initialization must be performed just after stack setup and before\r
- * any other initialization.\r
- */\r
-void __early_init(void) {\r
-\r
-  stm32_clock_init();\r
-}\r
-\r
-/*\r
- * Board-specific initialization code.\r
- */\r
-void boardInit(void) {\r
-}\r
diff --git a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h b/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h
deleted file mode 100644 (file)
index 7253e77..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-#ifndef _BOARD_H_\r
-#define _BOARD_H_\r
-\r
-/*\r
- * Setup for a Generic STM32F103 board.\r
- */\r
-\r
-/*\r
- * Board identifier.\r
- */\r
-#define BOARD_GENERIC_STM32_F103\r
-#define BOARD_NAME              "Generic STM32F103x board"\r
-\r
-/*\r
- * Board frequencies.\r
- */\r
-#define STM32_LSECLK            32768\r
-#define STM32_HSECLK            8000000\r
-\r
-/*\r
- * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.\r
- */\r
-#define STM32F103xB\r
-\r
-/*\r
- * IO pins assignments\r
- */\r
-\r
-/* on-board */\r
-\r
-#define GPIOC_LED               13\r
-#define GPIOD_OSC_IN            0\r
-#define GPIOD_OSC_OUT           1\r
-\r
-/* In case your board has a "USB enable" hardware\r
-   controlled by a pin, define it here. (It could be just\r
-   a 1.5k resistor connected to D+ line.)\r
-*/\r
-/*\r
-#define GPIOB_USB_DISC          10\r
-*/\r
-\r
-/*\r
- * I/O ports initial setup, this configuration is established soon after reset\r
- * in the initialization code.\r
- *\r
- * The digits have the following meaning:\r
- *   0 - Analog input.\r
- *   1 - Push Pull output 10MHz.\r
- *   2 - Push Pull output 2MHz.\r
- *   3 - Push Pull output 50MHz.\r
- *   4 - Digital input.\r
- *   5 - Open Drain output 10MHz.\r
- *   6 - Open Drain output 2MHz.\r
- *   7 - Open Drain output 50MHz.\r
- *   8 - Digital input with PullUp or PullDown resistor depending on ODR.\r
- *   9 - Alternate Push Pull output 10MHz.\r
- *   A - Alternate Push Pull output 2MHz.\r
- *   B - Alternate Push Pull output 50MHz.\r
- *   C - Reserved.\r
- *   D - Alternate Open Drain output 10MHz.\r
- *   E - Alternate Open Drain output 2MHz.\r
- *   F - Alternate Open Drain output 50MHz.\r
- * Please refer to the STM32 Reference Manual for details.\r
- */\r
-\r
-/*\r
- * Port A setup.\r
- * Everything input with pull-up except:\r
- * PA2  - Alternate output  (USART2 TX).\r
- * PA3  - Normal input      (USART2 RX).\r
- * PA9  - Alternate output  (USART1 TX).\r
- * PA10 - Normal input      (USART1 RX).\r
- */\r
-#define VAL_GPIOACRL            0x88884B88      /*  PA7...PA0 */\r
-#define VAL_GPIOACRH            0x888884B8      /* PA15...PA8 */\r
-#define VAL_GPIOAODR            0xFFFFFFFF\r
-\r
-/*\r
- * Port B setup.\r
- * Everything input with pull-up except:\r
- * PB10    - Push Pull output  (USB switch).\r
- */\r
-#define VAL_GPIOBCRL            0x88888888      /*  PB7...PB0 */\r
-#define VAL_GPIOBCRH            0x88888388      /* PB15...PB8 */\r
-#define VAL_GPIOBODR            0xFFFFFFFF\r
-\r
-/*\r
- * Port C setup.\r
- * Everything input with pull-up except:\r
- * PC13    - Push Pull output  (LED).\r
- */\r
-#define VAL_GPIOCCRL            0x88888888      /*  PC7...PC0 */\r
-#define VAL_GPIOCCRH            0x88388888      /* PC15...PC8 */\r
-#define VAL_GPIOCODR            0xFFFFFFFF\r
-\r
-/*\r
- * Port D setup.\r
- * Everything input with pull-up except:\r
- * PD0  - Normal input (XTAL).\r
- * PD1  - Normal input (XTAL).\r
- */\r
-#define VAL_GPIODCRL            0x88888844      /*  PD7...PD0 */\r
-#define VAL_GPIODCRH            0x88888888      /* PD15...PD8 */\r
-#define VAL_GPIODODR            0xFFFFFFFF\r
-\r
-/*\r
- * Port E setup.\r
- * Everything input with pull-up except:\r
- */\r
-#define VAL_GPIOECRL            0x88888888      /*  PE7...PE0 */\r
-#define VAL_GPIOECRH            0x88888888      /* PE15...PE8 */\r
-#define VAL_GPIOEODR            0xFFFFFFFF\r
-\r
-/*\r
- * USB bus activation macro, required by the USB driver.\r
- */\r
-/* The point is that most of the generic STM32F103* boards\r
-   have a 1.5k resistor connected on one end to the D+ line\r
-   and on the other end to some pin. Or even a slightly more\r
-   complicated "USB enable" circuit, controlled by a pin.\r
-   That should go here.\r
-\r
-   However on some boards (e.g. one that I have), there's no\r
-   such hardware. In which case it's better to not do anything.\r
-*/\r
-/*\r
-#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC)\r
-*/\r
-#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT);\r
-\r
-/*\r
- * USB bus de-activation macro, required by the USB driver.\r
- */\r
-/*\r
-#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC)\r
-*/\r
-#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12);\r
-\r
-#if !defined(_FROM_ASM_)\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-  void boardInit(void);\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-#endif /* _FROM_ASM_ */\r
-\r
-#endif /* _BOARD_H_ */\r
diff --git a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk b/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk
deleted file mode 100644 (file)
index d692c0e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# List of all the board related files.\r
-BOARDSRC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103/board.c\r
-\r
-# Required include directories\r
-BOARDINC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103\r
diff --git a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png b/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png
deleted file mode 100644 (file)
index c44a7d9..0000000
Binary files a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png and /dev/null differ
diff --git a/keyboards/stm32_f103_onekey/boards/maple_mini_mapping.png b/keyboards/stm32_f103_onekey/boards/maple_mini_mapping.png
deleted file mode 100644 (file)
index 12cfa81..0000000
Binary files a/keyboards/stm32_f103_onekey/boards/maple_mini_mapping.png and /dev/null differ
diff --git a/keyboards/stm32_f103_onekey/bootloader_defs.h b/keyboards/stm32_f103_onekey/bootloader_defs.h
deleted file mode 100644 (file)
index 0f45203..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Address for jumping to bootloader on STM32 chips. */
-/* It is chip dependent, the correct number can be looked up here (page 175):
- * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
- * This also requires a patch to chibios:
- *  <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
- */
-
-// STM32F103* does NOT have an USB bootloader in ROM (only serial),
-//  so setting anything here does not make much sense
-// #define STM32_BOOTLOADER_ADDRESS 0x1FFFC800
diff --git a/keyboards/stm32_f103_onekey/chconf.h b/keyboards/stm32_f103_onekey/chconf.h
deleted file mode 100644 (file)
index dfb1f9d..0000000
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-*/
-
-/**
- * @file    templates/chconf.h
- * @brief   Configuration file template.
- * @details A copy of this file must be placed in each project directory, it
- *          contains the application specific kernel settings.
- *
- * @addtogroup config
- * @details Kernel related settings and hooks.
- * @{
- */
-
-#ifndef CHCONF_H
-#define CHCONF_H
-
-#define _CHIBIOS_RT_CONF_
-
-/*===========================================================================*/
-/**
- * @name System timers settings
- * @{
- */
-/*===========================================================================*/
-
-/**
- * @brief   System time counter resolution.
- * @note    Allowed values are 16 or 32 bits.
- */
-#define CH_CFG_ST_RESOLUTION                16
-
-/**
- * @brief   System tick frequency.
- * @details Frequency of the system timer that drives the system ticks. This
- *          setting also defines the system tick time unit.
- */
-#define CH_CFG_ST_FREQUENCY                 2000
-
-/**
- * @brief   Time delta constant for the tick-less mode.
- * @note    If this value is zero then the system uses the classic
- *          periodic tick. This value represents the minimum number
- *          of ticks that is safe to specify in a timeout directive.
- *          The value one is not valid, timeouts are rounded up to
- *          this value.
- */
-#define CH_CFG_ST_TIMEDELTA                 2
-
-/** @} */
-
-/*===========================================================================*/
-/**
- * @name Kernel parameters and options
- * @{
- */
-/*===========================================================================*/
-
-/**
- * @brief   Round robin interval.
- * @details This constant is the number of system ticks allowed for the
- *          threads before preemption occurs. Setting this value to zero
- *          disables the preemption for threads with equal priority and the
- *          round robin becomes cooperative. Note that higher priority
- *          threads can still preempt, the kernel is always preemptive.
- * @note    Disabling the round robin preemption makes the kernel more compact
- *          and generally faster.
- * @note    The round robin preemption is not supported in tickless mode and
- *          must be set to zero in that case.
- */
-#define CH_CFG_TIME_QUANTUM                 0
-
-/**
- * @brief   Managed RAM size.
- * @details Size of the RAM area to be managed by the OS. If set to zero
- *          then the whole available RAM is used. The core memory is made
- *          available to the heap allocator and/or can be used directly through
- *          the simplified core memory allocator.
- *
- * @note    In order to let the OS manage the whole RAM the linker script must
- *          provide the @p __heap_base__ and @p __heap_end__ symbols.
- * @note    Requires @p CH_CFG_USE_MEMCORE.
- */
-#define CH_CFG_MEMCORE_SIZE                 0
-
-/**
- * @brief   Idle thread automatic spawn suppression.
- * @details When this option is activated the function @p chSysInit()
- *          does not spawn the idle thread. The application @p main()
- *          function becomes the idle thread and must implement an
- *          infinite loop.
- */
-#define CH_CFG_NO_IDLE_THREAD               FALSE
-
-/* Use __WFI in the idle thread for waiting. Does lower the power
- * consumption. */
-#define CORTEX_ENABLE_WFI_IDLE              TRUE
-
-/** @} */
-
-/*===========================================================================*/
-/**
- * @name Performance options
- * @{
- */
-/*===========================================================================*/
-
-/**
- * @brief   OS optimization.
- * @details If enabled then time efficient rather than space efficient code
- *          is used when two possible implementations exist.
- *
- * @note    This is not related to the compiler optimization options.
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_OPTIMIZE_SPEED               TRUE
-
-/** @} */
-
-/*===========================================================================*/
-/**
- * @name Subsystem options
- * @{
- */
-/*===========================================================================*/
-
-/**
- * @brief   Time Measurement APIs.
- * @details If enabled then the time measurement APIs are included in
- *          the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_TM                       FALSE
-
-/**
- * @brief   Threads registry APIs.
- * @details If enabled then the registry APIs are included in the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_REGISTRY                 TRUE
-
-/**
- * @brief   Threads synchronization APIs.
- * @details If enabled then the @p chThdWait() function is included in
- *          the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_WAITEXIT                 TRUE
-
-/**
- * @brief   Semaphores APIs.
- * @details If enabled then the Semaphores APIs are included in the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_SEMAPHORES               TRUE
-
-/**
- * @brief   Semaphores queuing mode.
- * @details If enabled then the threads are enqueued on semaphores by
- *          priority rather than in FIFO order.
- *
- * @note    The default is @p FALSE. Enable this if you have special
- *          requirements.
- * @note    Requires @p CH_CFG_USE_SEMAPHORES.
- */
-#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE
-
-/**
- * @brief   Mutexes APIs.
- * @details If enabled then the mutexes APIs are included in the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_MUTEXES                  TRUE
-
-/**
- * @brief   Enables recursive behavior on mutexes.
- * @note    Recursive mutexes are heavier and have an increased
- *          memory footprint.
- *
- * @note    The default is @p FALSE.
- * @note    Requires @p CH_CFG_USE_MUTEXES.
- */
-#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE
-
-/**
- * @brief   Conditional Variables APIs.
- * @details If enabled then the conditional variables APIs are included
- *          in the kernel.
- *
- * @note    The default is @p TRUE.
- * @note    Requires @p CH_CFG_USE_MUTEXES.
- */
-#define CH_CFG_USE_CONDVARS                 TRUE
-
-/**
- * @brief   Conditional Variables APIs with timeout.
- * @details If enabled then the conditional variables APIs with timeout
- *          specification are included in the kernel.
- *
- * @note    The default is @p TRUE.
- * @note    Requires @p CH_CFG_USE_CONDVARS.
- */
-#define CH_CFG_USE_CONDVARS_TIMEOUT         FALSE
-
-/**
- * @brief   Events Flags APIs.
- * @details If enabled then the event flags APIs are included in the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_EVENTS                   TRUE
-
-/**
- * @brief   Events Flags APIs with timeout.
- * @details If enabled then the events APIs with timeout specification
- *          are included in the kernel.
- *
- * @note    The default is @p TRUE.
- * @note    Requires @p CH_CFG_USE_EVENTS.
- */
-#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE
-
-/**
- * @brief   Synchronous Messages APIs.
- * @details If enabled then the synchronous messages APIs are included
- *          in the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_MESSAGES                 TRUE
-
-/**
- * @brief   Synchronous Messages queuing mode.
- * @details If enabled then messages are served by priority rather than in
- *          FIFO order.
- *
- * @note    The default is @p FALSE. Enable this if you have special
- *          requirements.
- * @note    Requires @p CH_CFG_USE_MESSAGES.
- */
-#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE
-
-/**
- * @brief   Mailboxes APIs.
- * @details If enabled then the asynchronous messages (mailboxes) APIs are
- *          included in the kernel.
- *
- * @note    The default is @p TRUE.
- * @note    Requires @p CH_CFG_USE_SEMAPHORES.
- */
-#define CH_CFG_USE_MAILBOXES                TRUE
-
-/**
- * @brief   Core Memory Manager APIs.
- * @details If enabled then the core memory manager APIs are included
- *          in the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_MEMCORE                  TRUE
-
-/**
- * @brief   Heap Allocator APIs.
- * @details If enabled then the memory heap allocator APIs are included
- *          in the kernel.
- *
- * @note    The default is @p TRUE.
- * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
- *          @p CH_CFG_USE_SEMAPHORES.
- * @note    Mutexes are recommended.
- */
-#define CH_CFG_USE_HEAP                     TRUE
-
-/**
- * @brief   Memory Pools Allocator APIs.
- * @details If enabled then the memory pools allocator APIs are included
- *          in the kernel.
- *
- * @note    The default is @p TRUE.
- */
-#define CH_CFG_USE_MEMPOOLS                 FALSE
-
-/**
- * @brief   Dynamic Threads APIs.
- * @details If enabled then the dynamic threads creation APIs are included
- *          in the kernel.
- *
- * @note    The default is @p TRUE.
- * @note    Requires @p CH_CFG_USE_WAITEXIT.
- * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
- */
-#define CH_CFG_USE_DYNAMIC                  FALSE
-
-/** @} */
-
-/*===========================================================================*/
-/**
- * @name Debug options
- * @{
- */
-/*===========================================================================*/
-
-/**
- * @brief   Debug option, kernel statistics.
- *
- * @note    The default is @p FALSE.
- */
-#define CH_DBG_STATISTICS                   FALSE
-
-/**
- * @brief   Debug option, system state check.
- * @details If enabled the correct call protocol for system APIs is checked
- *          at runtime.
- *
- * @note    The default is @p FALSE.
- */
-#define CH_DBG_SYSTEM_STATE_CHECK           FALSE
-
-/**
- * @brief   Debug option, parameters checks.
- * @details If enabled then the checks on the API functions input
- *          parameters are activated.
- *
- * @note    The default is @p FALSE.
- */
-#define CH_DBG_ENABLE_CHECKS                FALSE
-
-/**
- * @brief   Debug option, consistency checks.
- * @details If enabled then all the assertions in the kernel code are
- *          activated. This includes consistency checks inside the kernel,
- *          runtime anomalies and port-defined checks.
- *
- * @note    The default is @p FALSE.
- */
-#define CH_DBG_ENABLE_ASSERTS               FALSE
-
-/**
- * @brief   Debug option, trace buffer.
- * @details If enabled then the trace buffer is activated.
- *
- * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
- */
-#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
-
-/**
- * @brief   Trace buffer entries.
- * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
- *          different from @p CH_DBG_TRACE_MASK_DISABLED.
- */
-#define CH_DBG_TRACE_BUFFER_SIZE            128
-
-/**
- * @brief   Debug option, stack checks.
- * @details If enabled then a runtime stack check is performed.
- *
- * @note    The default is @p FALSE.
- * @note    The stack check is performed in a architecture/port dependent way.
- *          It may not be implemented or some ports.
- * @note    The default failure mode is to halt the system with the global
- *          @p panic_msg variable set to @p NULL.
- */
-#define CH_DBG_ENABLE_STACK_CHECK           FALSE
-
-/**
- * @brief   Debug option, stacks initialization.
- * @details If enabled then the threads working area is filled with a byte
- *          value when a thread is created. This can be useful for the
- *          runtime measurement of the used stack.
- *
- * @note    The default is @p FALSE.
- */
-#define CH_DBG_FILL_THREADS                 FALSE
-
-/**
- * @brief   Debug option, threads profiling.
- * @details If enabled then a field is added to the @p thread_t structure that
- *          counts the system ticks occurred while executing the thread.
- *
- * @note    The default is @p FALSE.
- * @note    This debug option is not currently compatible with the
- *          tickless mode.
- */
-#define CH_DBG_THREADS_PROFILING            FALSE
-
-/** @} */
-
-/*===========================================================================*/
-/**
- * @name Kernel hooks
- * @{
- */
-/*===========================================================================*/
-
-/**
- * @brief   Threads descriptor structure extension.
- * @details User fields added to the end of the @p thread_t structure.
- */
-#define CH_CFG_THREAD_EXTRA_FIELDS                                          \
-  /* Add threads custom fields here.*/
-
-/**
- * @brief   Threads initialization hook.
- * @details User initialization code added to the @p chThdInit() API.
- *
- * @note    It is invoked from within @p chThdInit() and implicitly from all
- *          the threads creation APIs.
- */
-#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \
-  /* Add threads initialization code here.*/                                \
-}
-
-/**
- * @brief   Threads finalization hook.
- * @details User finalization code added to the @p chThdExit() API.
- */
-#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
-  /* Add threads finalization code here.*/                                  \
-}
-
-/**
- * @brief   Context switch hook.
- * @details This hook is invoked just before switching between threads.
- */
-#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \
-  /* Context switch code here.*/                                            \
-}
-
-/**
- * @brief   ISR enter hook.
- */
-#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
-  /* IRQ prologue code here.*/                                              \
-}
-
-/**
- * @brief   ISR exit hook.
- */
-#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
-  /* IRQ epilogue code here.*/                                              \
-}
-
-/**
- * @brief   Idle thread enter hook.
- * @note    This hook is invoked within a critical zone, no OS functions
- *          should be invoked from here.
- * @note    This macro can be used to activate a power saving mode.
- */
-#define CH_CFG_IDLE_ENTER_HOOK() {                                          \
-  /* Idle-enter code here.*/                                                \
-}
-
-/**
- * @brief   Idle thread leave hook.
- * @note    This hook is invoked within a critical zone, no OS functions
- *          should be invoked from here.
- * @note    This macro can be used to deactivate a power saving mode.
- */
-#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
-  /* Idle-leave code here.*/                                                \
-}
-
-/**
- * @brief   Idle Loop hook.
- * @details This hook is continuously invoked by the idle thread loop.
- */
-#define CH_CFG_IDLE_LOOP_HOOK() {                                           \
-  /* Idle loop code here.*/                                                 \
-}
-
-/**
- * @brief   System tick event hook.
- * @details This hook is invoked in the system tick handler immediately
- *          after processing the virtual timers queue.
- */
-#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \
-  /* System tick event code here.*/                                         \
-}
-
-/**
- * @brief   System halt hook.
- * @details This hook is invoked in case to a system halting error before
- *          the system is halted.
- */
-#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \
-  /* System halt code here.*/                                               \
-}
-
-/**
- * @brief   Trace hook.
- * @details This hook is invoked each time a new record is written in the
- *          trace buffer.
- */
-#define CH_CFG_TRACE_HOOK(tep) {                                            \
-  /* Trace code here.*/                                                     \
-}
-
-/** @} */
-
-/*===========================================================================*/
-/* Port-specific settings (override port settings defaulted in chcore.h).    */
-/*===========================================================================*/
-
-#endif  /* CHCONF_H */
-
-/** @} */
diff --git a/keyboards/stm32_f103_onekey/config.h b/keyboards/stm32_f103_onekey/config.h
deleted file mode 100644 (file)
index 19b14fe..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-Copyright 2015 Jun Wako <wakojun@gmail.com>
-
-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/>.
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-
-/* USB Device descriptor parameter */
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x6464
-#define DEVICE_VER      0x0001
-/* in python2: list(u"whatever".encode('utf-16-le')) */
-/*   at most 32 characters or the ugly hack in usb_main.c borks */
-#define MANUFACTURER "TMK"
-#define USBSTR_MANUFACTURER    'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00'
-#define PRODUCT "ChibiOS TMK test"
-#define USBSTR_PRODUCT         'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', 't', '\x00', 'e', '\x00', 's', '\x00', 't', '\x00'
-#define DESCRIPTION "TMK keyboard firmware over ChibiOS"
-
-/* key matrix size */
-#define MATRIX_ROWS 1
-#define MATRIX_COLS 1
-#define DIODE_DIRECTION COL2ROW
-
-/* define if matrix has ghost */
-//#define MATRIX_HAS_GHOST
-
-/* 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 */
-#define IS_COMMAND() ( \
-    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
-)
-
-
-
-/*
- * Feature disable options
- *  These options are also useful to firmware size reduction.
- */
-
-/* disable debug print */
-//#define NO_DEBUG
-
-/* disable print */
-//#define NO_PRINT
-
-/* disable action features */
-//#define NO_ACTION_LAYER
-//#define NO_ACTION_TAPPING
-//#define NO_ACTION_ONESHOT
-//#define NO_ACTION_MACRO
-//#define NO_ACTION_FUNCTION
-
-#endif
diff --git a/keyboards/stm32_f103_onekey/flash.sh b/keyboards/stm32_f103_onekey/flash.sh
deleted file mode 100755 (executable)
index 15501df..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-Arduino_STM32_usb_hid/tools/linux/maple_upload ttyACM0 2 1EAF:0003 build/ch.bin
diff --git a/keyboards/stm32_f103_onekey/halconf.h b/keyboards/stm32_f103_onekey/halconf.h
deleted file mode 100644 (file)
index 1a450d6..0000000
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-*/
-
-/**
- * @file    templates/halconf.h
- * @brief   HAL configuration header.
- * @details HAL configuration file, this file allows to enable or disable the
- *          various device drivers from your application. You may also use
- *          this file in order to override the device drivers default settings.
- *
- * @addtogroup HAL_CONF
- * @{
- */
-
-#ifndef _HALCONF_H_
-#define _HALCONF_H_
-
-#include "mcuconf.h"
-
-/**
- * @brief   Enables the PAL subsystem.
- */
-#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
-#define HAL_USE_PAL                 TRUE
-#endif
-
-/**
- * @brief   Enables the ADC subsystem.
- */
-#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
-#define HAL_USE_ADC                 FALSE
-#endif
-
-/**
- * @brief   Enables the CAN subsystem.
- */
-#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
-#define HAL_USE_CAN                 FALSE
-#endif
-
-/**
- * @brief   Enables the DAC subsystem.
- */
-#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
-#define HAL_USE_DAC                 FALSE
-#endif
-
-/**
- * @brief   Enables the EXT subsystem.
- */
-#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
-#define HAL_USE_EXT                 FALSE
-#endif
-
-/**
- * @brief   Enables the GPT subsystem.
- */
-#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
-#define HAL_USE_GPT                 FALSE
-#endif
-
-/**
- * @brief   Enables the I2C subsystem.
- */
-#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
-#define HAL_USE_I2C                 FALSE
-#endif
-
-/**
- * @brief   Enables the I2S subsystem.
- */
-#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
-#define HAL_USE_I2S                 FALSE
-#endif
-
-/**
- * @brief   Enables the ICU subsystem.
- */
-#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
-#define HAL_USE_ICU                 FALSE
-#endif
-
-/**
- * @brief   Enables the MAC subsystem.
- */
-#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
-#define HAL_USE_MAC                 FALSE
-#endif
-
-/**
- * @brief   Enables the MMC_SPI subsystem.
- */
-#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
-#define HAL_USE_MMC_SPI             FALSE
-#endif
-
-/**
- * @brief   Enables the PWM subsystem.
- */
-#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
-#define HAL_USE_PWM                 FALSE
-#endif
-
-/**
- * @brief   Enables the RTC subsystem.
- */
-#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
-#define HAL_USE_RTC                 FALSE
-#endif
-
-/**
- * @brief   Enables the SDC subsystem.
- */
-#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
-#define HAL_USE_SDC                 FALSE
-#endif
-
-/**
- * @brief   Enables the SERIAL subsystem.
- */
-#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
-#define HAL_USE_SERIAL              FALSE
-#endif
-
-/**
- * @brief   Enables the SERIAL over USB subsystem.
- */
-#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
-#define HAL_USE_SERIAL_USB          FALSE
-#endif
-
-/**
- * @brief   Enables the SPI subsystem.
- */
-#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
-#define HAL_USE_SPI                 FALSE
-#endif
-
-/**
- * @brief   Enables the UART subsystem.
- */
-#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
-#define HAL_USE_UART                FALSE
-#endif
-
-/**
- * @brief   Enables the USB subsystem.
- */
-#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
-#define HAL_USE_USB                 TRUE
-#endif
-
-/**
- * @brief   Enables the WDG subsystem.
- */
-#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
-#define HAL_USE_WDG                 FALSE
-#endif
-
-/*===========================================================================*/
-/* ADC driver related settings.                                              */
-/*===========================================================================*/
-
-/**
- * @brief   Enables synchronous APIs.
- * @note    Disabling this option saves both code and data space.
- */
-#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
-#define ADC_USE_WAIT                TRUE
-#endif
-
-/**
- * @brief   Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
- * @note    Disabling this option saves both code and data space.
- */
-#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
-#define ADC_USE_MUTUAL_EXCLUSION    TRUE
-#endif
-
-/*===========================================================================*/
-/* CAN driver related settings.                                              */
-/*===========================================================================*/
-
-/**
- * @brief   Sleep mode related APIs inclusion switch.
- */
-#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
-#define CAN_USE_SLEEP_MODE          TRUE
-#endif
-
-/*===========================================================================*/
-/* I2C driver related settings.                                              */
-/*===========================================================================*/
-
-/**
- * @brief   Enables the mutual exclusion APIs on the I2C bus.
- */
-#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
-#define I2C_USE_MUTUAL_EXCLUSION    TRUE
-#endif
-
-/*===========================================================================*/
-/* MAC driver related settings.                                              */
-/*===========================================================================*/
-
-/**
- * @brief   Enables an event sources for incoming packets.
- */
-#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
-#define MAC_USE_ZERO_COPY           FALSE
-#endif
-
-/**
- * @brief   Enables an event sources for incoming packets.
- */
-#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
-#define MAC_USE_EVENTS              TRUE
-#endif
-
-/*===========================================================================*/
-/* MMC_SPI driver related settings.                                          */
-/*===========================================================================*/
-
-/**
- * @brief   Delays insertions.
- * @details If enabled this options inserts delays into the MMC waiting
- *          routines releasing some extra CPU time for the threads with
- *          lower priority, this may slow down the driver a bit however.
- *          This option is recommended also if the SPI driver does not
- *          use a DMA channel and heavily loads the CPU.
- */
-#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
-#define MMC_NICE_WAITING            TRUE
-#endif
-
-/*===========================================================================*/
-/* SDC driver related settings.                                              */
-/*===========================================================================*/
-
-/**
- * @brief   Number of initialization attempts before rejecting the card.
- * @note    Attempts are performed at 10mS intervals.
- */
-#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
-#define SDC_INIT_RETRY              100
-#endif
-
-/**
- * @brief   Include support for MMC cards.
- * @note    MMC support is not yet implemented so this option must be kept
- *          at @p FALSE.
- */
-#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
-#define SDC_MMC_SUPPORT             FALSE
-#endif
-
-/**
- * @brief   Delays insertions.
- * @details If enabled this options inserts delays into the MMC waiting
- *          routines releasing some extra CPU time for the threads with
- *          lower priority, this may slow down the driver a bit however.
- */
-#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
-#define SDC_NICE_WAITING            TRUE
-#endif
-
-/*===========================================================================*/
-/* SERIAL driver related settings.                                           */
-/*===========================================================================*/
-
-/**
- * @brief   Default bit rate.
- * @details Configuration parameter, this is the baud rate selected for the
- *          default configuration.
- */
-#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
-#define SERIAL_DEFAULT_BITRATE      38400
-#endif
-
-/**
- * @brief   Serial buffers size.
- * @details Configuration parameter, you can change the depth of the queue
- *          buffers depending on the requirements of your application.
- * @note    The default is 64 bytes for both the transmission and receive
- *          buffers.
- */
-#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
-#define SERIAL_BUFFERS_SIZE         16
-#endif
-
-/*===========================================================================*/
-/* SERIAL_USB driver related setting.                                        */
-/*===========================================================================*/
-
-/**
- * @brief   Serial over USB buffers size.
- * @details Configuration parameter, the buffer size must be a multiple of
- *          the USB data endpoint maximum packet size.
- * @note    The default is 64 bytes for both the transmission and receive
- *          buffers.
- */
-#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
-#define SERIAL_USB_BUFFERS_SIZE     256
-#endif
-
-/*===========================================================================*/
-/* SPI driver related settings.                                              */
-/*===========================================================================*/
-
-/**
- * @brief   Enables synchronous APIs.
- * @note    Disabling this option saves both code and data space.
- */
-#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
-#define SPI_USE_WAIT                TRUE
-#endif
-
-/**
- * @brief   Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
- * @note    Disabling this option saves both code and data space.
- */
-#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
-#define SPI_USE_MUTUAL_EXCLUSION    TRUE
-#endif
-
-/*===========================================================================*/
-/* USB driver related settings.                                              */
-/*===========================================================================*/
-
-/**
- * @brief   Enables synchronous APIs.
- * @note    Disabling this option saves both code and data space.
- */
-#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
-#define USB_USE_WAIT                TRUE
-#endif
-
-#endif /* _HALCONF_H_ */
-
-/** @} */
diff --git a/keyboards/stm32_f103_onekey/keymaps/default/keymap.c b/keyboards/stm32_f103_onekey/keymaps/default/keymap.c
deleted file mode 100644 (file)
index c3b0f08..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
-
-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/>.
-*/
-
-#include "stm32_f103_onekey.h"
-
-const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    {{KC_CAPS}}, // test with KC_CAPS, KC_A, KC_BTLD
-};
-
-const uint16_t fn_actions[] = {
-};
diff --git a/keyboards/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld
deleted file mode 100644 (file)
index 0061332..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*\r
-    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-/*\r
- * ST32F103xB memory setup for use with the maplemini bootloader.\r
- * You will have to\r
- *     #define CORTEX_VTOR_INIT 0x5000\r
- * in your projects chconf.h\r
- */\r
-MEMORY\r
-{\r
-    flash0  : org = 0x08002000, len = 128k - 0x2000\r
-    flash1  : org = 0x00000000, len = 0\r
-    flash2  : org = 0x00000000, len = 0\r
-    flash3  : org = 0x00000000, len = 0\r
-    flash4  : org = 0x00000000, len = 0\r
-    flash5  : org = 0x00000000, len = 0\r
-    flash6  : org = 0x00000000, len = 0\r
-    flash7  : org = 0x00000000, len = 0\r
-    ram0    : org = 0x20000000, len = 20k\r
-    ram1    : org = 0x00000000, len = 0\r
-    ram2    : org = 0x00000000, len = 0\r
-    ram3    : org = 0x00000000, len = 0\r
-    ram4    : org = 0x00000000, len = 0\r
-    ram5    : org = 0x00000000, len = 0\r
-    ram6    : org = 0x00000000, len = 0\r
-    ram7    : org = 0x00000000, len = 0\r
-}\r
-\r
-/* For each data/text section two region are defined, a virtual region\r
-   and a load region (_LMA suffix).*/\r
-\r
-/* Flash region to be used for exception vectors.*/\r
-REGION_ALIAS("VECTORS_FLASH", flash0);\r
-REGION_ALIAS("VECTORS_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for constructors and destructors.*/\r
-REGION_ALIAS("XTORS_FLASH", flash0);\r
-REGION_ALIAS("XTORS_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for code text.*/\r
-REGION_ALIAS("TEXT_FLASH", flash0);\r
-REGION_ALIAS("TEXT_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for read only data.*/\r
-REGION_ALIAS("RODATA_FLASH", flash0);\r
-REGION_ALIAS("RODATA_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for various.*/\r
-REGION_ALIAS("VARIOUS_FLASH", flash0);\r
-REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for RAM(n) initialization data.*/\r
-REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);\r
-\r
-/* RAM region to be used for Main stack. This stack accommodates the processing\r
-   of all exceptions and interrupts.*/\r
-REGION_ALIAS("MAIN_STACK_RAM", ram0);\r
-\r
-/* RAM region to be used for the process stack. This is the stack used by\r
-   the main() function.*/\r
-REGION_ALIAS("PROCESS_STACK_RAM", ram0);\r
-\r
-/* RAM region to be used for data segment.*/\r
-REGION_ALIAS("DATA_RAM", ram0);\r
-REGION_ALIAS("DATA_RAM_LMA", flash0);\r
-\r
-/* RAM region to be used for BSS segment.*/\r
-REGION_ALIAS("BSS_RAM", ram0);\r
-\r
-/* RAM region to be used for the default heap.*/\r
-REGION_ALIAS("HEAP_RAM", ram0);\r
-\r
-/* Generic rules inclusion.*/\r
-INCLUDE rules.ld\r
diff --git a/keyboards/stm32_f103_onekey/led.c b/keyboards/stm32_f103_onekey/led.c
deleted file mode 100644 (file)
index f5c55f7..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-Copyright 2012 Jun Wako <wakojun@gmail.com>
-
-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/>.
-*/
-
-#include "hal.h"
-#include "led.h"
-
-
-void led_set(uint8_t usb_led)
-{
-    if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
-       /* generic STM32F103C8T6 board */
-#ifdef BOARD_GENERIC_STM32_F103
-        palClearPad(GPIOC, 13);
-#endif
-        /* Maple Mini */
-#ifdef BOARD_MAPLEMINI_STM32_F103
-        palSetPad(GPIOB, 1);
-#endif
-    } else {
-       /* generic STM32F103C8T6 board */
-#ifdef BOARD_GENERIC_STM32_F103
-       palSetPad(GPIOC, 13);
-#endif
-        /* Maple Mini */
-#ifdef BOARD_MAPLEMINI_STM32_F103
-        palClearPad(GPIOB,1);
-#endif
-    }
-}
diff --git a/keyboards/stm32_f103_onekey/matrix.c b/keyboards/stm32_f103_onekey/matrix.c
deleted file mode 100644 (file)
index ea9d8d0..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
-Copyright 2012 Jun Wako <wakojun@gmail.com>
-
-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/>.
-*/
-
-#include "ch.h"
-#include "hal.h"
-
-/*
- * scan matrix
- */
-#include "print.h"
-#include "debug.h"
-#include "util.h"
-#include "matrix.h"
-#include "wait.h"
-
-#ifndef DEBOUNCE
-#   define DEBOUNCE 5
-#endif
-static uint8_t debouncing = DEBOUNCE;
-
-/* matrix state(1:on, 0:off) */
-static matrix_row_t matrix[MATRIX_ROWS];
-static matrix_row_t matrix_debouncing[MATRIX_ROWS];
-
-static matrix_row_t read_cols(void);
-static void init_cols(void);
-static void unselect_rows(void);
-static void select_row(uint8_t row);
-
-
-inline
-uint8_t matrix_rows(void)
-{
-    return MATRIX_ROWS;
-}
-
-inline
-uint8_t matrix_cols(void)
-{
-    return MATRIX_COLS;
-}
-
-/* generic STM32F103C8T6 board */
-#ifdef BOARD_GENERIC_STM32_F103
-#define LED_ON()    do { palClearPad(GPIOC, GPIOC_LED) ;} while (0)
-#define LED_OFF()   do { palSetPad(GPIOC, GPIOC_LED); } while (0)
-#define LED_TGL()   do { palTogglePad(GPIOC, GPIOC_LED); } while (0)
-#endif
-
-/* Maple Mini */
-#ifdef BOARD_MAPLEMINI_STM32_F103
-#define LED_ON()    do { palSetPad(GPIOB, 1) ;} while (0)
-#define LED_OFF()   do { palClearPad(GPIOB, 1); } while (0)
-#define LED_TGL()   do { palTogglePad(GPIOB, 1); } while (0)
-#endif
-
-void matrix_init(void)
-{
-    // initialize row and col
-    unselect_rows();
-    init_cols();
-
-    // initialize matrix state: all keys off
-    for (uint8_t i=0; i < MATRIX_ROWS; i++) {
-        matrix[i] = 0;
-        matrix_debouncing[i] = 0;
-    }
-
-    //debug
-    debug_matrix = true;
-    LED_ON();
-    wait_ms(500);
-    LED_OFF();
-}
-
-uint8_t matrix_scan(void)
-{
-    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-        select_row(i);
-        wait_us(30);  // without this wait read unstable value.
-        matrix_row_t cols = read_cols();
-        if (matrix_debouncing[i] != cols) {
-            matrix_debouncing[i] = cols;
-            if (debouncing) {
-                debug("bounce!: "); debug_hex(debouncing); debug("\n");
-            }
-            debouncing = DEBOUNCE;
-        }
-        unselect_rows();
-    }
-
-    if (debouncing) {
-        if (--debouncing) {
-            wait_ms(1);
-        } else {
-            for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-                matrix[i] = matrix_debouncing[i];
-            }
-        }
-    }
-
-    return 1;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
-    return (matrix[row] & ((matrix_row_t)1<<col));
-}
-
-inline
-matrix_row_t matrix_get_row(uint8_t row)
-{
-    return matrix[row];
-}
-
-void matrix_print(void)
-{
-    print("\nr/c 0123456789ABCDEF\n");
-    for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
-        phex(row); print(": ");
-        pbin_reverse16(matrix_get_row(row));
-        print("\n");
-    }
-}
-
-/* Column pin configuration
- */
-static void  init_cols(void)
-{
-#ifdef BOARD_MAPLEMINI_STM32_F103
-    // don't need pullup/down, since it's pulled down in hardware
-    palSetPadMode(GPIOB, 8, PAL_MODE_INPUT);
-#else
-    palSetPadMode(GPIOB, 8, PAL_MODE_INPUT_PULLDOWN);
-#endif
-}
-
-/* Returns status of switches(1:on, 0:off) */
-static matrix_row_t read_cols(void)
-{
-    return ((palReadPad(GPIOB, 8)==PAL_LOW) ? 0 : (1<<0));
-    // | ((palReadPad(...)==PAL_HIGH) ? 0 : (1<<1))
-}
-
-/* Row pin configuration
- */
-static void unselect_rows(void)
-{
-    // palSetPadMode(GPIOA, GPIOA_PIN10, PAL_MODE_INPUT); // hi-Z
-}
-
-static void select_row(uint8_t row)
-{
-    (void)row;
-    // Output low to select
-    // switch (row) {
-    //     case 0:
-    //         palSetPadMode(GPIOA, GPIOA_PIN10, PAL_MODE_OUTPUT_PUSHPULL);
-    //         palSetPad(GPIOA, GPIOA_PIN10, PAL_LOW);
-    //         break;
-    // }
-}
diff --git a/keyboards/stm32_f103_onekey/mcuconf.h b/keyboards/stm32_f103_onekey/mcuconf.h
deleted file mode 100644 (file)
index 626332a..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-#ifndef _MCUCONF_H_\r
-#define _MCUCONF_H_\r
-\r
-#define STM32F103_MCUCONF\r
-\r
-/*\r
- * STM32F103 drivers configuration.\r
- * The following settings override the default settings present in\r
- * the various device driver implementation headers.\r
- * Note that the settings for each driver only have effect if the whole\r
- * driver is enabled in halconf.h.\r
- *\r
- * IRQ priorities:\r
- * 15...0       Lowest...Highest.\r
- *\r
- * DMA priorities:\r
- * 0...3        Lowest...Highest.\r
- */\r
-\r
-/*\r
- * HAL driver system settings.\r
- */\r
-#define STM32_NO_INIT                       FALSE\r
-#define STM32_HSI_ENABLED                   TRUE\r
-#define STM32_LSI_ENABLED                   FALSE\r
-#define STM32_HSE_ENABLED                   TRUE\r
-#define STM32_LSE_ENABLED                   FALSE\r
-#define STM32_SW                            STM32_SW_PLL\r
-#define STM32_PLLSRC                        STM32_PLLSRC_HSE\r
-#define STM32_PLLXTPRE                      STM32_PLLXTPRE_DIV1\r
-#define STM32_PLLMUL_VALUE                  9\r
-#define STM32_HPRE                          STM32_HPRE_DIV1\r
-#define STM32_PPRE1                         STM32_PPRE1_DIV2\r
-#define STM32_PPRE2                         STM32_PPRE2_DIV2\r
-#define STM32_ADCPRE                        STM32_ADCPRE_DIV4\r
-#define STM32_USB_CLOCK_REQUIRED            TRUE\r
-#define STM32_USBPRE                        STM32_USBPRE_DIV1P5\r
-#define STM32_MCOSEL                        STM32_MCOSEL_NOCLOCK\r
-#define STM32_RTCSEL                        STM32_RTCSEL_HSEDIV\r
-#define STM32_PVD_ENABLE                    FALSE\r
-#define STM32_PLS                           STM32_PLS_LEV0\r
-\r
-/*\r
- * ADC driver system settings.\r
- */\r
-#define STM32_ADC_USE_ADC1                  FALSE\r
-#define STM32_ADC_ADC1_DMA_PRIORITY         2\r
-#define STM32_ADC_ADC1_IRQ_PRIORITY         6\r
-\r
-/*\r
- * CAN driver system settings.\r
- */\r
-#define STM32_CAN_USE_CAN1                  FALSE\r
-#define STM32_CAN_CAN1_IRQ_PRIORITY         11\r
-\r
-/*\r
- * EXT driver system settings.\r
- */\r
-#define STM32_EXT_EXTI0_IRQ_PRIORITY        6\r
-#define STM32_EXT_EXTI1_IRQ_PRIORITY        6\r
-#define STM32_EXT_EXTI2_IRQ_PRIORITY        6\r
-#define STM32_EXT_EXTI3_IRQ_PRIORITY        6\r
-#define STM32_EXT_EXTI4_IRQ_PRIORITY        6\r
-#define STM32_EXT_EXTI5_9_IRQ_PRIORITY      6\r
-#define STM32_EXT_EXTI10_15_IRQ_PRIORITY    6\r
-#define STM32_EXT_EXTI16_IRQ_PRIORITY       6\r
-#define STM32_EXT_EXTI17_IRQ_PRIORITY       6\r
-#define STM32_EXT_EXTI18_IRQ_PRIORITY       6\r
-#define STM32_EXT_EXTI19_IRQ_PRIORITY       6\r
-\r
-/*\r
- * GPT driver system settings.\r
- */\r
-#define STM32_GPT_USE_TIM1                  FALSE\r
-#define STM32_GPT_USE_TIM2                  FALSE\r
-#define STM32_GPT_USE_TIM3                  FALSE\r
-#define STM32_GPT_USE_TIM4                  FALSE\r
-#define STM32_GPT_USE_TIM5                  FALSE\r
-#define STM32_GPT_USE_TIM8                  FALSE\r
-#define STM32_GPT_TIM1_IRQ_PRIORITY         7\r
-#define STM32_GPT_TIM2_IRQ_PRIORITY         7\r
-#define STM32_GPT_TIM3_IRQ_PRIORITY         7\r
-#define STM32_GPT_TIM4_IRQ_PRIORITY         7\r
-#define STM32_GPT_TIM5_IRQ_PRIORITY         7\r
-#define STM32_GPT_TIM8_IRQ_PRIORITY         7\r
-\r
-/*\r
- * I2C driver system settings.\r
- */\r
-#define STM32_I2C_USE_I2C1                  FALSE\r
-#define STM32_I2C_USE_I2C2                  FALSE\r
-#define STM32_I2C_BUSY_TIMEOUT              50\r
-#define STM32_I2C_I2C1_IRQ_PRIORITY         5\r
-#define STM32_I2C_I2C2_IRQ_PRIORITY         5\r
-#define STM32_I2C_I2C1_DMA_PRIORITY         3\r
-#define STM32_I2C_I2C2_DMA_PRIORITY         3\r
-#define STM32_I2C_DMA_ERROR_HOOK(i2cp)      osalSysHalt("DMA failure")\r
-\r
-/*\r
- * ICU driver system settings.\r
- */\r
-#define STM32_ICU_USE_TIM1                  FALSE\r
-#define STM32_ICU_USE_TIM2                  FALSE\r
-#define STM32_ICU_USE_TIM3                  FALSE\r
-#define STM32_ICU_USE_TIM4                  FALSE\r
-#define STM32_ICU_USE_TIM5                  FALSE\r
-#define STM32_ICU_USE_TIM8                  FALSE\r
-#define STM32_ICU_TIM1_IRQ_PRIORITY         7\r
-#define STM32_ICU_TIM2_IRQ_PRIORITY         7\r
-#define STM32_ICU_TIM3_IRQ_PRIORITY         7\r
-#define STM32_ICU_TIM4_IRQ_PRIORITY         7\r
-#define STM32_ICU_TIM5_IRQ_PRIORITY         7\r
-#define STM32_ICU_TIM8_IRQ_PRIORITY         7\r
-\r
-/*\r
- * PWM driver system settings.\r
- */\r
-#define STM32_PWM_USE_ADVANCED              FALSE\r
-#define STM32_PWM_USE_TIM1                  FALSE\r
-#define STM32_PWM_USE_TIM2                  FALSE\r
-#define STM32_PWM_USE_TIM3                  FALSE\r
-#define STM32_PWM_USE_TIM4                  FALSE\r
-#define STM32_PWM_USE_TIM5                  FALSE\r
-#define STM32_PWM_USE_TIM8                  FALSE\r
-#define STM32_PWM_TIM1_IRQ_PRIORITY         7\r
-#define STM32_PWM_TIM2_IRQ_PRIORITY         7\r
-#define STM32_PWM_TIM3_IRQ_PRIORITY         7\r
-#define STM32_PWM_TIM4_IRQ_PRIORITY         7\r
-#define STM32_PWM_TIM5_IRQ_PRIORITY         7\r
-#define STM32_PWM_TIM8_IRQ_PRIORITY         7\r
-\r
-/*\r
- * RTC driver system settings.\r
- */\r
-#define STM32_RTC_IRQ_PRIORITY              15\r
-\r
-/*\r
- * SERIAL driver system settings.\r
- */\r
-#define STM32_SERIAL_USE_USART1             FALSE\r
-#define STM32_SERIAL_USE_USART2             FALSE\r
-#define STM32_SERIAL_USE_USART3             FALSE\r
-#define STM32_SERIAL_USE_UART4              FALSE\r
-#define STM32_SERIAL_USE_UART5              FALSE\r
-#define STM32_SERIAL_USART1_PRIORITY        12\r
-#define STM32_SERIAL_USART2_PRIORITY        12\r
-#define STM32_SERIAL_USART3_PRIORITY        12\r
-#define STM32_SERIAL_UART4_PRIORITY         12\r
-#define STM32_SERIAL_UART5_PRIORITY         12\r
-\r
-/*\r
- * SPI driver system settings.\r
- */\r
-#define STM32_SPI_USE_SPI1                  FALSE\r
-#define STM32_SPI_USE_SPI2                  FALSE\r
-#define STM32_SPI_USE_SPI3                  FALSE\r
-#define STM32_SPI_SPI1_DMA_PRIORITY         1\r
-#define STM32_SPI_SPI2_DMA_PRIORITY         1\r
-#define STM32_SPI_SPI3_DMA_PRIORITY         1\r
-#define STM32_SPI_SPI1_IRQ_PRIORITY         10\r
-#define STM32_SPI_SPI2_IRQ_PRIORITY         10\r
-#define STM32_SPI_SPI3_IRQ_PRIORITY         10\r
-#define STM32_SPI_DMA_ERROR_HOOK(spip)      osalSysHalt("DMA failure")\r
-\r
-/*\r
- * ST driver system settings.\r
- */\r
-#define STM32_ST_IRQ_PRIORITY               8\r
-#define STM32_ST_USE_TIMER                  2\r
-\r
-/*\r
- * UART driver system settings.\r
- */\r
-#define STM32_UART_USE_USART1               FALSE\r
-#define STM32_UART_USE_USART2               FALSE\r
-#define STM32_UART_USE_USART3               FALSE\r
-#define STM32_UART_USART1_IRQ_PRIORITY      12\r
-#define STM32_UART_USART2_IRQ_PRIORITY      12\r
-#define STM32_UART_USART3_IRQ_PRIORITY      12\r
-#define STM32_UART_USART1_DMA_PRIORITY      0\r
-#define STM32_UART_USART2_DMA_PRIORITY      0\r
-#define STM32_UART_USART3_DMA_PRIORITY      0\r
-#define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")\r
-\r
-/*\r
- * USB driver system settings.\r
- */\r
-#define STM32_USB_USE_USB1                  TRUE\r
-#define STM32_USB_LOW_POWER_ON_SUSPEND      FALSE\r
-#define STM32_USB_USB1_HP_IRQ_PRIORITY      13\r
-#define STM32_USB_USB1_LP_IRQ_PRIORITY      14\r
-\r
-#endif /* _MCUCONF_H_ */\r
diff --git a/keyboards/stm32_f103_onekey/stm32_f103_onekey.c b/keyboards/stm32_f103_onekey/stm32_f103_onekey.c
deleted file mode 100644 (file)
index 7fa99bb..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "stm32_f103_onekey.h"
diff --git a/keyboards/stm32_f103_onekey/stm32_f103_onekey.h b/keyboards/stm32_f103_onekey/stm32_f103_onekey.h
deleted file mode 100644 (file)
index e4d0dd9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef STM32_F103_ONEKEY_H
-#define STM32_F103_ONEKEY_H
-#include "quantum.h"
-#endif
diff --git a/keyboards/teensy_lc_onekey/Makefile b/keyboards/teensy_lc_onekey/Makefile
deleted file mode 100644 (file)
index 064e618..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-# project specific files
-SRC =  matrix.c \
-           led.c
-
-## chip/board settings
-# - the next two should match the directories in
-#   <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
-# - For Teensies, FAMILY = KINETIS and SERIES is either
-#   KL2x (LC) or K20x (3.0,3.1,3.2).
-MCU_FAMILY = KINETIS
-MCU_SERIES = KL2x
-
-# Linker script to use
-# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
-#   or <this_dir>/ld/
-# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
-# - LDSCRIPT =
-#   - MKL26Z64 for Teensy LC
-#   - MK20DX128 for Teensy 3.0
-#   - MK20DX256 for Teensy 3.1 and 3.2
-MCU_LDSCRIPT = MKL26Z64
-
-# Startup code to use
-#  - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
-# - STARTUP =
-#   - kl2x for Teensy LC
-#   - k20x5 for Teensy 3.0
-#   - k20x7 for Teensy 3.1 and 3.2
-MCU_STARTUP = kl2x
-
-# Board: it should exist either in <chibios>/os/hal/boards/
-#  or <this_dir>/boards
-# - BOARD =
-#   - PJRC_TEENSY_LC for Teensy LC
-#   - PJRC_TEENSY_3 for Teensy 3.0
-#   - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
-BOARD = PJRC_TEENSY_LC
-
-# Cortex version
-# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4
-MCU  = cortex-m0plus
-
-# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
-# I.e. 6 for Teensy LC; 7 for Teensy 3.x
-ARMV = 6
-
-# Build Options
-#   comment out to disable the options.
-#
-BOOTMAGIC_ENABLE ?= yes        # Virtual DIP switch configuration
-## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
-MOUSEKEY_ENABLE ?= yes # Mouse keys
-EXTRAKEY_ENABLE ?= yes # Audio control and System control
-CONSOLE_ENABLE ?= yes  # Console for debug
-COMMAND_ENABLE ?= yes    # Commands for debug and configuration
-SLEEP_LED_ENABLE ?= yes  # Breathing sleep LED during USB suspend
-NKRO_ENABLE ?= yes         # USB Nkey Rollover
-CUSTOM_MATRIX ?= yes # Custom matrix file
-
-ifndef QUANTUM_DIR
-       include ../../Makefile
-endif
diff --git a/keyboards/teensy_lc_onekey/Makefile.3.0 b/keyboards/teensy_lc_onekey/Makefile.3.0
deleted file mode 100644 (file)
index dbf12c3..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-# Target file name (without extension).
-PROJECT = ch
-
-# Directory common source files exist
-TMK_DIR = ../../tmk_core
-
-# Directory keyboard dependent files exist
-TARGET_DIR = .
-
-# project specific files
-SRC =  matrix.c \
-           led.c
-
-ifdef KEYMAP
-    SRC := keymap_$(KEYMAP).c $(SRC)
-else
-    SRC := keymap_plain.c $(SRC)
-endif
-
-CONFIG_H = config.h
-
-## chip/board settings
-# - the next two should match the directories in
-#   <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
-# - For Teensies, FAMILY = KINETIS and SERIES is either
-#   KL2x (LC) or K20x (3.0,3.1,3.2).
-MCU_FAMILY = KINETIS
-MCU_SERIES = K20x
-
-# Linker script to use
-# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
-#   or <this_dir>/ld/
-# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
-# - LDSCRIPT =
-#   - MKL26Z64 for Teensy LC
-#   - MK20DX128 for Teensy 3.0
-#   - MK20DX256 for Teensy 3.1 and 3.2
-MCU_LDSCRIPT = MK20DX128
-
-# Startup code to use
-#  - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
-# - STARTUP =
-#   - kl2x for Teensy LC
-#   - k20x5 for Teensy 3.0
-#   - k20x7 for Teensy 3.1 and 3.2
-MCU_STARTUP = k20x5
-
-# Board: it should exist either in <chibios>/os/hal/boards/
-#  or <this_dir>/boards
-# - BOARD =
-#   - PJRC_TEENSY_LC for Teensy LC
-#   - PJRC_TEENSY_3 for Teensy 3.0
-#   - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
-BOARD = PJRC_TEENSY_3
-
-# Cortex version
-# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
-MCU  = cortex-m4
-
-# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
-# I.e. 6 for Teensy LC; 7 for Teensy 3.x
-ARMV = 7
-
-# Build Options
-#   comment out to disable the options.
-#
-BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
-## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
-MOUSEKEY_ENABLE = yes  # Mouse keys
-EXTRAKEY_ENABLE = yes  # Audio control and System control
-CONSOLE_ENABLE = yes   # Console for debug
-COMMAND_ENABLE = yes    # Commands for debug and configuration
-SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
-NKRO_ENABLE = yes          # USB Nkey Rollover
-
-include $(TMK_DIR)/tool/chibios/common.mk
-include $(TMK_DIR)/tool/chibios/chibios.mk
diff --git a/keyboards/teensy_lc_onekey/Makefile.3.2 b/keyboards/teensy_lc_onekey/Makefile.3.2
deleted file mode 100644 (file)
index 41bfa41..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-# Target file name (without extension).
-PROJECT = ch
-
-# Directory common source files exist
-TMK_DIR = ../../tmk_core
-
-# Directory keyboard dependent files exist
-TARGET_DIR = .
-
-# project specific files
-SRC =  matrix.c \
-           led.c
-
-ifdef KEYMAP
-    SRC := keymap_$(KEYMAP).c $(SRC)
-else
-    SRC := keymap_plain.c $(SRC)
-endif
-
-CONFIG_H = config.h
-
-## chip/board settings
-# - the next two should match the directories in
-#   <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
-# - For Teensies, FAMILY = KINETIS and SERIES is either
-#   KL2x (LC) or K20x (3.0,3.1,3.2).
-MCU_FAMILY = KINETIS
-MCU_SERIES = K20x
-
-# Linker script to use
-# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
-#   or <this_dir>/ld/
-# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
-# - LDSCRIPT =
-#   - MKL26Z64 for Teensy LC
-#   - MK20DX128 for Teensy 3.0
-#   - MK20DX256 for Teensy 3.1 and 3.2
-MCU_LDSCRIPT = MK20DX256
-
-# Startup code to use
-#  - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
-# - STARTUP =
-#   - kl2x for Teensy LC
-#   - k20x5 for Teensy 3.0
-#   - k20x7 for Teensy 3.1 and 3.2
-MCU_STARTUP = k20x7
-
-# Board: it should exist either in <chibios>/os/hal/boards/
-#  or <this_dir>/boards
-# - BOARD =
-#   - PJRC_TEENSY_LC for Teensy LC
-#   - PJRC_TEENSY_3 for Teensy 3.0
-#   - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
-BOARD = PJRC_TEENSY_3_1
-
-# Cortex version
-# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
-MCU  = cortex-m4
-
-# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
-# I.e. 6 for Teensy LC; 7 for Teensy 3.x
-ARMV = 7
-
-# Build Options
-#   comment out to disable the options.
-#
-BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
-## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
-MOUSEKEY_ENABLE = yes  # Mouse keys
-EXTRAKEY_ENABLE = yes  # Audio control and System control
-CONSOLE_ENABLE = yes   # Console for debug
-COMMAND_ENABLE = yes    # Commands for debug and configuration
-SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
-NKRO_ENABLE = yes          # USB Nkey Rollover
-
-include $(TMK_DIR)/tool/chibios/common.mk
-include $(TMK_DIR)/tool/chibios/chibios.mk
diff --git a/keyboards/teensy_lc_onekey/chconf.h b/keyboards/teensy_lc_onekey/chconf.h
deleted file mode 100644 (file)
index cb36996..0000000
+++ /dev/null
@@ -1,524 +0,0 @@
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-/**\r
- * @file    templates/chconf.h\r
- * @brief   Configuration file template.\r
- * @details A copy of this file must be placed in each project directory, it\r
- *          contains the application specific kernel settings.\r
- *\r
- * @addtogroup config\r
- * @details Kernel related settings and hooks.\r
- * @{\r
- */\r
-\r
-#ifndef CHCONF_H\r
-#define CHCONF_H\r
-\r
-#define _CHIBIOS_RT_CONF_\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name System timers settings\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   System time counter resolution.\r
- * @note    Allowed values are 16 or 32 bits.\r
- */\r
-#define CH_CFG_ST_RESOLUTION                32\r
-\r
-/**\r
- * @brief   System tick frequency.\r
- * @details Frequency of the system timer that drives the system ticks. This\r
- *          setting also defines the system tick time unit.\r
- */\r
-#define CH_CFG_ST_FREQUENCY                 1000\r
-\r
-/**\r
- * @brief   Time delta constant for the tick-less mode.\r
- * @note    If this value is zero then the system uses the classic\r
- *          periodic tick. This value represents the minimum number\r
- *          of ticks that is safe to specify in a timeout directive.\r
- *          The value one is not valid, timeouts are rounded up to\r
- *          this value.\r
- */\r
-#define CH_CFG_ST_TIMEDELTA                 0\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Kernel parameters and options\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Round robin interval.\r
- * @details This constant is the number of system ticks allowed for the\r
- *          threads before preemption occurs. Setting this value to zero\r
- *          disables the preemption for threads with equal priority and the\r
- *          round robin becomes cooperative. Note that higher priority\r
- *          threads can still preempt, the kernel is always preemptive.\r
- * @note    Disabling the round robin preemption makes the kernel more compact\r
- *          and generally faster.\r
- * @note    The round robin preemption is not supported in tickless mode and\r
- *          must be set to zero in that case.\r
- */\r
-#define CH_CFG_TIME_QUANTUM                 20\r
-\r
-/**\r
- * @brief   Managed RAM size.\r
- * @details Size of the RAM area to be managed by the OS. If set to zero\r
- *          then the whole available RAM is used. The core memory is made\r
- *          available to the heap allocator and/or can be used directly through\r
- *          the simplified core memory allocator.\r
- *\r
- * @note    In order to let the OS manage the whole RAM the linker script must\r
- *          provide the @p __heap_base__ and @p __heap_end__ symbols.\r
- * @note    Requires @p CH_CFG_USE_MEMCORE.\r
- */\r
-#define CH_CFG_MEMCORE_SIZE                 0\r
-\r
-/**\r
- * @brief   Idle thread automatic spawn suppression.\r
- * @details When this option is activated the function @p chSysInit()\r
- *          does not spawn the idle thread. The application @p main()\r
- *          function becomes the idle thread and must implement an\r
- *          infinite loop.\r
- */\r
-#define CH_CFG_NO_IDLE_THREAD               FALSE\r
-\r
-/* Use __WFI in the idle thread for waiting. Does lower the power\r
- * consumption. */\r
-#define CORTEX_ENABLE_WFI_IDLE              TRUE\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Performance options\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   OS optimization.\r
- * @details If enabled then time efficient rather than space efficient code\r
- *          is used when two possible implementations exist.\r
- *\r
- * @note    This is not related to the compiler optimization options.\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_OPTIMIZE_SPEED               TRUE\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Subsystem options\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Time Measurement APIs.\r
- * @details If enabled then the time measurement APIs are included in\r
- *          the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_TM                       FALSE\r
-\r
-/**\r
- * @brief   Threads registry APIs.\r
- * @details If enabled then the registry APIs are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_REGISTRY                 TRUE\r
-\r
-/**\r
- * @brief   Threads synchronization APIs.\r
- * @details If enabled then the @p chThdWait() function is included in\r
- *          the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_WAITEXIT                 TRUE\r
-\r
-/**\r
- * @brief   Semaphores APIs.\r
- * @details If enabled then the Semaphores APIs are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_SEMAPHORES               TRUE\r
-\r
-/**\r
- * @brief   Semaphores queuing mode.\r
- * @details If enabled then the threads are enqueued on semaphores by\r
- *          priority rather than in FIFO order.\r
- *\r
- * @note    The default is @p FALSE. Enable this if you have special\r
- *          requirements.\r
- * @note    Requires @p CH_CFG_USE_SEMAPHORES.\r
- */\r
-#define CH_CFG_USE_SEMAPHORES_PRIORITY      FALSE\r
-\r
-/**\r
- * @brief   Mutexes APIs.\r
- * @details If enabled then the mutexes APIs are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_MUTEXES                  TRUE\r
-\r
-/**\r
- * @brief   Enables recursive behavior on mutexes.\r
- * @note    Recursive mutexes are heavier and have an increased\r
- *          memory footprint.\r
- *\r
- * @note    The default is @p FALSE.\r
- * @note    Requires @p CH_CFG_USE_MUTEXES.\r
- */\r
-#define CH_CFG_USE_MUTEXES_RECURSIVE        FALSE\r
-\r
-/**\r
- * @brief   Conditional Variables APIs.\r
- * @details If enabled then the conditional variables APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_MUTEXES.\r
- */\r
-#define CH_CFG_USE_CONDVARS                 TRUE\r
-\r
-/**\r
- * @brief   Conditional Variables APIs with timeout.\r
- * @details If enabled then the conditional variables APIs with timeout\r
- *          specification are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_CONDVARS.\r
- */\r
-#define CH_CFG_USE_CONDVARS_TIMEOUT         TRUE\r
-\r
-/**\r
- * @brief   Events Flags APIs.\r
- * @details If enabled then the event flags APIs are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_EVENTS                   TRUE\r
-\r
-/**\r
- * @brief   Events Flags APIs with timeout.\r
- * @details If enabled then the events APIs with timeout specification\r
- *          are included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_EVENTS.\r
- */\r
-#define CH_CFG_USE_EVENTS_TIMEOUT           TRUE\r
-\r
-/**\r
- * @brief   Synchronous Messages APIs.\r
- * @details If enabled then the synchronous messages APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_MESSAGES                 TRUE\r
-\r
-/**\r
- * @brief   Synchronous Messages queuing mode.\r
- * @details If enabled then messages are served by priority rather than in\r
- *          FIFO order.\r
- *\r
- * @note    The default is @p FALSE. Enable this if you have special\r
- *          requirements.\r
- * @note    Requires @p CH_CFG_USE_MESSAGES.\r
- */\r
-#define CH_CFG_USE_MESSAGES_PRIORITY        FALSE\r
-\r
-/**\r
- * @brief   Mailboxes APIs.\r
- * @details If enabled then the asynchronous messages (mailboxes) APIs are\r
- *          included in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_SEMAPHORES.\r
- */\r
-#define CH_CFG_USE_MAILBOXES                TRUE\r
-\r
-/**\r
- * @brief   Core Memory Manager APIs.\r
- * @details If enabled then the core memory manager APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_MEMCORE                  TRUE\r
-\r
-/**\r
- * @brief   Heap Allocator APIs.\r
- * @details If enabled then the memory heap allocator APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or\r
- *          @p CH_CFG_USE_SEMAPHORES.\r
- * @note    Mutexes are recommended.\r
- */\r
-#define CH_CFG_USE_HEAP                     TRUE\r
-\r
-/**\r
- * @brief   Memory Pools Allocator APIs.\r
- * @details If enabled then the memory pools allocator APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- */\r
-#define CH_CFG_USE_MEMPOOLS                 TRUE\r
-\r
-/**\r
- * @brief   Dynamic Threads APIs.\r
- * @details If enabled then the dynamic threads creation APIs are included\r
- *          in the kernel.\r
- *\r
- * @note    The default is @p TRUE.\r
- * @note    Requires @p CH_CFG_USE_WAITEXIT.\r
- * @note    Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.\r
- */\r
-#define CH_CFG_USE_DYNAMIC                  TRUE\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Debug options\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Debug option, kernel statistics.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_STATISTICS                   FALSE\r
-\r
-/**\r
- * @brief   Debug option, system state check.\r
- * @details If enabled the correct call protocol for system APIs is checked\r
- *          at runtime.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_SYSTEM_STATE_CHECK           TRUE\r
-\r
-/**\r
- * @brief   Debug option, parameters checks.\r
- * @details If enabled then the checks on the API functions input\r
- *          parameters are activated.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_ENABLE_CHECKS                TRUE\r
-\r
-/**\r
- * @brief   Debug option, consistency checks.\r
- * @details If enabled then all the assertions in the kernel code are\r
- *          activated. This includes consistency checks inside the kernel,\r
- *          runtime anomalies and port-defined checks.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_ENABLE_ASSERTS               TRUE\r
-\r
-/**\r
- * @brief   Debug option, trace buffer.\r
- * @details If enabled then the trace buffer is activated.\r
- *\r
- * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.\r
- */\r
-#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED\r
-\r
-/**\r
- * @brief   Trace buffer entries.\r
- * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is\r
- *          different from @p CH_DBG_TRACE_MASK_DISABLED.\r
- */\r
-#define CH_DBG_TRACE_BUFFER_SIZE            128\r
-\r
-/**\r
- * @brief   Debug option, stack checks.\r
- * @details If enabled then a runtime stack check is performed.\r
- *\r
- * @note    The default is @p FALSE.\r
- * @note    The stack check is performed in a architecture/port dependent way.\r
- *          It may not be implemented or some ports.\r
- * @note    The default failure mode is to halt the system with the global\r
- *          @p panic_msg variable set to @p NULL.\r
- */\r
-#define CH_DBG_ENABLE_STACK_CHECK           TRUE\r
-\r
-/**\r
- * @brief   Debug option, stacks initialization.\r
- * @details If enabled then the threads working area is filled with a byte\r
- *          value when a thread is created. This can be useful for the\r
- *          runtime measurement of the used stack.\r
- *\r
- * @note    The default is @p FALSE.\r
- */\r
-#define CH_DBG_FILL_THREADS                 TRUE\r
-\r
-/**\r
- * @brief   Debug option, threads profiling.\r
- * @details If enabled then a field is added to the @p thread_t structure that\r
- *          counts the system ticks occurred while executing the thread.\r
- *\r
- * @note    The default is @p FALSE.\r
- * @note    This debug option is not currently compatible with the\r
- *          tickless mode.\r
- */\r
-#define CH_DBG_THREADS_PROFILING            FALSE\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/**\r
- * @name Kernel hooks\r
- * @{\r
- */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Threads descriptor structure extension.\r
- * @details User fields added to the end of the @p thread_t structure.\r
- */\r
-#define CH_CFG_THREAD_EXTRA_FIELDS                                          \\r
-  /* Add threads custom fields here.*/\r
-\r
-/**\r
- * @brief   Threads initialization hook.\r
- * @details User initialization code added to the @p chThdInit() API.\r
- *\r
- * @note    It is invoked from within @p chThdInit() and implicitly from all\r
- *          the threads creation APIs.\r
- */\r
-#define CH_CFG_THREAD_INIT_HOOK(tp) {                                       \\r
-  /* Add threads initialization code here.*/                                \\r
-}\r
-\r
-/**\r
- * @brief   Threads finalization hook.\r
- * @details User finalization code added to the @p chThdExit() API.\r
- */\r
-#define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \\r
-  /* Add threads finalization code here.*/                                  \\r
-}\r
-\r
-/**\r
- * @brief   Context switch hook.\r
- * @details This hook is invoked just before switching between threads.\r
- */\r
-#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) {                              \\r
-  /* Context switch code here.*/                                            \\r
-}\r
-\r
-/**\r
- * @brief   ISR enter hook.\r
- */\r
-#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \\r
-  /* IRQ prologue code here.*/                                              \\r
-}\r
-\r
-/**\r
- * @brief   ISR exit hook.\r
- */\r
-#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \\r
-  /* IRQ epilogue code here.*/                                              \\r
-}\r
-\r
-/**\r
- * @brief   Idle thread enter hook.\r
- * @note    This hook is invoked within a critical zone, no OS functions\r
- *          should be invoked from here.\r
- * @note    This macro can be used to activate a power saving mode.\r
- */\r
-#define CH_CFG_IDLE_ENTER_HOOK() {                                          \\r
-  /* Idle-enter code here.*/                                                \\r
-}\r
-\r
-/**\r
- * @brief   Idle thread leave hook.\r
- * @note    This hook is invoked within a critical zone, no OS functions\r
- *          should be invoked from here.\r
- * @note    This macro can be used to deactivate a power saving mode.\r
- */\r
-#define CH_CFG_IDLE_LEAVE_HOOK() {                                          \\r
-  /* Idle-leave code here.*/                                                \\r
-}\r
-\r
-/**\r
- * @brief   Idle Loop hook.\r
- * @details This hook is continuously invoked by the idle thread loop.\r
- */\r
-#define CH_CFG_IDLE_LOOP_HOOK() {                                           \\r
-  /* Idle loop code here.*/                                                 \\r
-}\r
-\r
-/**\r
- * @brief   System tick event hook.\r
- * @details This hook is invoked in the system tick handler immediately\r
- *          after processing the virtual timers queue.\r
- */\r
-#define CH_CFG_SYSTEM_TICK_HOOK() {                                         \\r
-  /* System tick event code here.*/                                         \\r
-}\r
-\r
-/**\r
- * @brief   System halt hook.\r
- * @details This hook is invoked in case to a system halting error before\r
- *          the system is halted.\r
- */\r
-#define CH_CFG_SYSTEM_HALT_HOOK(reason) {                                   \\r
-  /* System halt code here.*/                                               \\r
-}\r
-\r
-/**\r
- * @brief   Trace hook.\r
- * @details This hook is invoked each time a new record is written in the\r
- *          trace buffer.\r
- */\r
-#define CH_CFG_TRACE_HOOK(tep) {                                            \\r
-  /* Trace code here.*/                                                     \\r
-}\r
-\r
-/** @} */\r
-\r
-/*===========================================================================*/\r
-/* Port-specific settings (override port settings defaulted in chcore.h).    */\r
-/*===========================================================================*/\r
-\r
-#endif  /* CHCONF_H */\r
-\r
-/** @} */\r
diff --git a/keyboards/teensy_lc_onekey/config.h b/keyboards/teensy_lc_onekey/config.h
deleted file mode 100644 (file)
index 19b14fe..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-Copyright 2015 Jun Wako <wakojun@gmail.com>
-
-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/>.
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-
-/* USB Device descriptor parameter */
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x6464
-#define DEVICE_VER      0x0001
-/* in python2: list(u"whatever".encode('utf-16-le')) */
-/*   at most 32 characters or the ugly hack in usb_main.c borks */
-#define MANUFACTURER "TMK"
-#define USBSTR_MANUFACTURER    'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00'
-#define PRODUCT "ChibiOS TMK test"
-#define USBSTR_PRODUCT         'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', 't', '\x00', 'e', '\x00', 's', '\x00', 't', '\x00'
-#define DESCRIPTION "TMK keyboard firmware over ChibiOS"
-
-/* key matrix size */
-#define MATRIX_ROWS 1
-#define MATRIX_COLS 1
-#define DIODE_DIRECTION COL2ROW
-
-/* define if matrix has ghost */
-//#define MATRIX_HAS_GHOST
-
-/* 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 */
-#define IS_COMMAND() ( \
-    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
-)
-
-
-
-/*
- * Feature disable options
- *  These options are also useful to firmware size reduction.
- */
-
-/* disable debug print */
-//#define NO_DEBUG
-
-/* disable print */
-//#define NO_PRINT
-
-/* disable action features */
-//#define NO_ACTION_LAYER
-//#define NO_ACTION_TAPPING
-//#define NO_ACTION_ONESHOT
-//#define NO_ACTION_MACRO
-//#define NO_ACTION_FUNCTION
-
-#endif
diff --git a/keyboards/teensy_lc_onekey/halconf.h b/keyboards/teensy_lc_onekey/halconf.h
deleted file mode 100644 (file)
index b1d2cd5..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-/**\r
- * @file    templates/halconf.h\r
- * @brief   HAL configuration header.\r
- * @details HAL configuration file, this file allows to enable or disable the\r
- *          various device drivers from your application. You may also use\r
- *          this file in order to override the device drivers default settings.\r
- *\r
- * @addtogroup HAL_CONF\r
- * @{\r
- */\r
-\r
-#ifndef _HALCONF_H_\r
-#define _HALCONF_H_\r
-\r
-#include "mcuconf.h"\r
-\r
-/**\r
- * @brief   Enables the PAL subsystem.\r
- */\r
-#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)\r
-#define HAL_USE_PAL                 TRUE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the ADC subsystem.\r
- */\r
-#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)\r
-#define HAL_USE_ADC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the CAN subsystem.\r
- */\r
-#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)\r
-#define HAL_USE_CAN                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the DAC subsystem.\r
- */\r
-#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)\r
-#define HAL_USE_DAC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the EXT subsystem.\r
- */\r
-#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)\r
-#define HAL_USE_EXT                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the GPT subsystem.\r
- */\r
-#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)\r
-#define HAL_USE_GPT                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the I2C subsystem.\r
- */\r
-#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)\r
-#define HAL_USE_I2C                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the I2S subsystem.\r
- */\r
-#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)\r
-#define HAL_USE_I2S                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the ICU subsystem.\r
- */\r
-#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)\r
-#define HAL_USE_ICU                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the MAC subsystem.\r
- */\r
-#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)\r
-#define HAL_USE_MAC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the MMC_SPI subsystem.\r
- */\r
-#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)\r
-#define HAL_USE_MMC_SPI             FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the PWM subsystem.\r
- */\r
-#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)\r
-#define HAL_USE_PWM                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the RTC subsystem.\r
- */\r
-#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)\r
-#define HAL_USE_RTC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the SDC subsystem.\r
- */\r
-#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)\r
-#define HAL_USE_SDC                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the SERIAL subsystem.\r
- */\r
-#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)\r
-#define HAL_USE_SERIAL              FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the SERIAL over USB subsystem.\r
- */\r
-#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)\r
-#define HAL_USE_SERIAL_USB          FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the SPI subsystem.\r
- */\r
-#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)\r
-#define HAL_USE_SPI                 FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the UART subsystem.\r
- */\r
-#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)\r
-#define HAL_USE_UART                FALSE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the USB subsystem.\r
- */\r
-#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)\r
-#define HAL_USE_USB                 TRUE\r
-#endif\r
-\r
-/**\r
- * @brief   Enables the WDG subsystem.\r
- */\r
-#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)\r
-#define HAL_USE_WDG                 FALSE\r
-#endif\r
-\r
-/*===========================================================================*/\r
-/* USB driver related settings.                                              */\r
-/*===========================================================================*/\r
-\r
-/**\r
- * @brief   Enables synchronous APIs.\r
- * @note    Disabling this option saves both code and data space.\r
- */\r
-#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)\r
-#define USB_USE_WAIT                TRUE\r
-#endif\r
-\r
-#endif /* _HALCONF_H_ */\r
-\r
-/** @} */\r
diff --git a/keyboards/teensy_lc_onekey/instructions.md b/keyboards/teensy_lc_onekey/instructions.md
deleted file mode 100644 (file)
index 16886a0..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-# Teensy LC, 3.0, 3.1, 3.2 support
-
-These ARM Teensies are now supported through [ChibiOS](http://chibios.org).
-
-You'll need to install an ARM toolchain, for instance from [gcc ARM embedded](https://launchpad.net/gcc-arm-embedded) website, or using your favourite package manager. After installing, you should be able to run `arm-none-eabi-gcc -v` in the command prompt and get sensible output. This toolchain is used instead of `avr-gcc`, which is only for AVR chips. Naturally you'll also need the usual development tools (e.g. `make`), just as in the AVR setting.
-
-Next, you'll need ChibiOS. For Teensies, you'll need code from two repositories: [chibios-main](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS). If you're not using git, you can just download a [zip of chibios from here](https://github.com/ChibiOS/ChibiOS/archive/a7df9a891067621e8e1a5c2a2c0ceada82403afe.zip), unpack the zip, and rename/move the unpacked directory (named `ChibiOS-<long_hash_here>`) to `tmk_core/tool/chibios/chibios` (so that the file `tmk_core/tool/chibios/chibios/license.txt` exists). Now the same procedure with a [zip of chibios-contrib from here](https://github.com/ChibiOS/ChibiOS-Contrib/archive/e1311c4db6cd366cf760673f769e925741ac0ad3.zip): unpack and move `ChibiOS-Contrib-<long_hash_here>` to `tmk_core/tool/chibios/chibios-contrib`.
-
-(If you're using git, you can just clone the two repos: [chibios](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS-Contrib). However - be warned that things may be somewhat out-of-sync (updates at different rates), so you may need to hunt a bit for the right commits.)
-
-(Why do we need chibios-contrib? Well, the main repo focuses on STM32 chips, and Freescale/NXP Kinetis chips are supported via the Contrib repository.)
-
-This should be it. Running `make` in `keyboard/teensy_lc_onekey` should create a working firmware in `build/`, called `ch.hex`.
-
-For more notes about the ChibiOS backend in TMK, see `tmk_core/protocol/chibios/README.md`.
-
-## About this onekey example
-
-It's set up for Teensy LC. To use 3.x, you'll need to edit the `Makefile` (and comment out one line in `mcuconf.h`). A sample makefile for Teensy 3.0 is provided as `Makefile.3.0`, can be used without renaming with `make -f Makefile.3.0`. Similarly for Teensy 3.2, there's `Makefile.3.2`.
-
-## Credits
-
-TMK itself is written by hasu, original sources [here](https://github.com/tmk/tmk_keyboard).
-
-The USB support for Kinetis MCUs is due to RedoX. His ChibiOS fork is also [on github](https://github.com/RedoXyde/ChibiOS); but it doesn't include Teensy LC definitions.
-
-## Features that are not implemented yet
-
-Currently only the more fancy suspend features are not there (power saving during suspend). The rest should work fine (reports either way are welcome).
-
-# Matrix programming notes
-
-The notes below explain what commands can be used to examine and set the status of Teensy pins.
-
-## ChibiOS pin manipulation basics
-
-### Pins
-
-Each pin sits on a "port", each of which comprises at most 32 individual pins.
-So for instance "PTC5" from Kinetis manual/datasheet refers to port C (or GPIOA), pin 5. Most functions dealing with pins take 2 parameters which specify the pin -- the first being the port, the second being the pin number.
-
-Within ChibiOS, there are definitions which simplify this a bit for the Teensies. `TEENSY_PINn_IOPORT` represents the port of the MCU's pin connected Teensy's PIN `n`, and `TEENSY_PINn` represents its MCU's pin number.
-
-### Mode
-
-A MCU pin can be in several modes. The basic command to set a pin mode is
-
-        palSetPadMode(TEENSY_PINn_IOPORT, TEENSY_PINn, PAL_MODE_INPUT_PULLUP);
-
-The last parameter is the mode. For keyboards, the usual ones that are used are `PAL_MODE_INPUT_PULLUP` (input with a pullup), `PAL_MODE_INPUT_PULLDOWN` (input with a pulldown), `PAL_MODE_INPUT` (input floating, a.k.a. Hi-Z), `PAL_MODE_OUTPUT_PUSHPULL` (output in the Arduino sense -- can be then set HIGH or LOW).
-
-### Setting
-
-Pins are set HIGH (after they've been put into `OUTPUT_PUSHPULL` mode) by
-
-        palSetPad(TEENSY_PINn_IOPORT, TEENSY_PINn);
-
-or set LOW by
-
-        palClearPad(TEENSY_PINn_IOPORT, TEENSY_PINn);
-
-Toggling can be done with
-
-        palTogglePad(TEENSY_PINn_IOPORT, TEENSY_PINn);
-
-Alternatively, you can use
-
-        palWritePad(TEENSY_PINn_IOPORT, TEENSY_PINn, bit);
-
-where `bit` is either `PAL_LOW` or `PAL_HIGH` (i.e. `0` or `1`).
-
-### Reading
-
-Reading pin status is done with
-
-        palReadPad(TEENSY_PINn_IOPORT, TEENSY_PINn);
-
-The function returns either `PAL_HIGH` (actually `1`) or `PAL_LOW` (actually `0`).
-
-### Further docs
-
-All the commands that are available for pin manipulation through ChibiOS HAL are documented in [ChibiOS PAL driver docs](http://chibios.sourceforge.net/docs3/hal/group___p_a_l.html).
diff --git a/keyboards/teensy_lc_onekey/keymaps/default/keymap.c b/keyboards/teensy_lc_onekey/keymaps/default/keymap.c
deleted file mode 100644 (file)
index a109b49..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
-
-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/>.
-*/
-
-#include "keycode.h"
-#include "action.h"
-#include "action_macro.h"
-#include "report.h"
-#include "host.h"
-#include "print.h"
-#include "debug.h"
-#include "keymap.h"
-
-const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    {{KC_A}},
-};  // to test: KC_CAPS, KT_BTLD, KC_A
-
-const uint16_t fn_actions[] = {
-};
diff --git a/keyboards/teensy_lc_onekey/ld/MKL26Z64.ld b/keyboards/teensy_lc_onekey/ld/MKL26Z64.ld
deleted file mode 100644 (file)
index fb141f8..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*\r
- * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com\r
- *           (C) 2016 flabbergast <s3+flabbergast@sdfeu.org>\r
- *\r
- * Permission is hereby granted, free of charge, to any person obtaining\r
- * a copy of this software and associated documentation files (the "Software"),\r
- * to deal in the Software without restriction, including without limitation\r
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
- * and/or sell copies of the Software, and to permit persons to whom the\r
- * Software is furnished to do so, subject to the following conditions:\r
- *\r
- * The above copyright notice and this permission notice shall be included in\r
- * all copies or substantial portions of the Software.\r
- *\r
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\r
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
- * SOFTWARE.\r
- */\r
-\r
-/*\r
- * KL26Z64 memory setup.\r
- */\r
-MEMORY\r
-{\r
-  flash0   : org = 0x00000000, len = 0x100\r
-  flash1   : org = 0x00000400, len = 0x10\r
-  flash2   : org = 0x00000410, len = 62k - 0x410\r
-  flash3   : org = 0x0000F800, len = 2k\r
-  flash4   : org = 0x00000000, len = 0\r
-  flash5   : org = 0x00000000, len = 0\r
-  flash6   : org = 0x00000000, len = 0\r
-  flash7   : org = 0x00000000, len = 0\r
-  ram0     : org = 0x1FFFF800, len = 8k\r
-  ram1     : org = 0x00000000, len = 0\r
-  ram2     : org = 0x00000000, len = 0\r
-  ram3     : org = 0x00000000, len = 0\r
-  ram4     : org = 0x00000000, len = 0\r
-  ram5     : org = 0x00000000, len = 0\r
-  ram6     : org = 0x00000000, len = 0\r
-  ram7     : org = 0x00000000, len = 0\r
-}\r
-\r
-/* Flash region for the configuration bytes.*/\r
-SECTIONS\r
-{\r
-  .cfmprotect : ALIGN(4) SUBALIGN(4)\r
-  {\r
-    KEEP(*(.cfmconfig))\r
-  } > flash1\r
-}\r
-\r
-/* For each data/text section two region are defined, a virtual region\r
-   and a load region (_LMA suffix).*/\r
-\r
-/* Flash region to be used for exception vectors.*/\r
-REGION_ALIAS("VECTORS_FLASH", flash0);\r
-REGION_ALIAS("VECTORS_FLASH_LMA", flash0);\r
-\r
-/* Flash region to be used for constructors and destructors.*/\r
-REGION_ALIAS("XTORS_FLASH", flash2);\r
-REGION_ALIAS("XTORS_FLASH_LMA", flash2);\r
-\r
-/* Flash region to be used for code text.*/\r
-REGION_ALIAS("TEXT_FLASH", flash2);\r
-REGION_ALIAS("TEXT_FLASH_LMA", flash2);\r
-\r
-/* Flash region to be used for read only data.*/\r
-REGION_ALIAS("RODATA_FLASH", flash2);\r
-REGION_ALIAS("RODATA_FLASH_LMA", flash2);\r
-\r
-/* Flash region to be used for various.*/\r
-REGION_ALIAS("VARIOUS_FLASH", flash2);\r
-REGION_ALIAS("VARIOUS_FLASH_LMA", flash2);\r
-\r
-/* Flash region to be used for RAM(n) initialization data.*/\r
-REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2);\r
-\r
-/* RAM region to be used for Main stack. This stack accommodates the processing\r
-   of all exceptions and interrupts.*/\r
-REGION_ALIAS("MAIN_STACK_RAM", ram0);\r
-\r
-/* RAM region to be used for the process stack. This is the stack used by\r
-   the main() function.*/\r
-REGION_ALIAS("PROCESS_STACK_RAM", ram0);\r
-\r
-/* RAM region to be used for data segment.*/\r
-REGION_ALIAS("DATA_RAM", ram0);\r
-REGION_ALIAS("DATA_RAM_LMA", flash2);\r
-\r
-/* RAM region to be used for BSS segment.*/\r
-REGION_ALIAS("BSS_RAM", ram0);\r
-\r
-/* RAM region to be used for the default heap.*/\r
-REGION_ALIAS("HEAP_RAM", ram0);\r
-\r
-__eeprom_workarea_start__ = ORIGIN(flash3);\r
-__eeprom_workarea_size__  = LENGTH(flash3);\r
-__eeprom_workarea_end__   = __eeprom_workarea_start__ + __eeprom_workarea_size__;\r
-\r
-/* Generic rules inclusion.*/\r
-INCLUDE rules.ld\r
diff --git a/keyboards/teensy_lc_onekey/led.c b/keyboards/teensy_lc_onekey/led.c
deleted file mode 100644 (file)
index dfa60c1..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-Copyright 2012 Jun Wako <wakojun@gmail.com>
-
-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/>.
-*/
-
-#include "hal.h"
-
-#include "led.h"
-
-
-void led_set(uint8_t usb_led) {
-    if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
-        // output high
-        palSetPadMode(TEENSY_PIN13_IOPORT, TEENSY_PIN13, PAL_MODE_OUTPUT_PUSHPULL);
-        palSetPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13);
-    } else {
-        // Hi-Z
-        palSetPadMode(TEENSY_PIN13_IOPORT, TEENSY_PIN13, PAL_MODE_INPUT);
-    }
-}
diff --git a/keyboards/teensy_lc_onekey/matrix.c b/keyboards/teensy_lc_onekey/matrix.c
deleted file mode 100644 (file)
index 7dab04f..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
-Copyright 2012 Jun Wako <wakojun@gmail.com>
-
-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/>.
-*/
-
-#include "ch.h"
-#include "hal.h"
-
-/*
- * scan matrix
- */
-#include "print.h"
-#include "debug.h"
-#include "util.h"
-#include "matrix.h"
-#include "wait.h"
-
-#ifndef DEBOUNCE
-#   define DEBOUNCE 5
-#endif
-static uint8_t debouncing = DEBOUNCE;
-
-/* matrix state(1:on, 0:off) */
-static matrix_row_t matrix[MATRIX_ROWS];
-static matrix_row_t matrix_debouncing[MATRIX_ROWS];
-
-static matrix_row_t read_cols(void);
-static void init_cols(void);
-static void unselect_rows(void);
-static void select_row(uint8_t row);
-
-
-inline
-uint8_t matrix_rows(void)
-{
-    return MATRIX_ROWS;
-}
-
-inline
-uint8_t matrix_cols(void)
-{
-    return MATRIX_COLS;
-}
-
-#define LED_ON()    do { palSetPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13) ;} while (0)
-#define LED_OFF()   do { palClearPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13); } while (0)
-#define LED_TGL()   do { palTogglePad(TEENSY_PIN13_IOPORT, TEENSY_PIN13); } while (0)
-
-void matrix_init(void)
-{
-    // initialize row and col
-    unselect_rows();
-    init_cols();
-
-    // initialize matrix state: all keys off
-    for (uint8_t i=0; i < MATRIX_ROWS; i++) {
-        matrix[i] = 0;
-        matrix_debouncing[i] = 0;
-    }
-
-    //debug
-    debug_matrix = true;
-    LED_ON();
-    wait_ms(500);
-    LED_OFF();
-}
-
-uint8_t matrix_scan(void)
-{
-    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-        select_row(i);
-        wait_us(30);  // without this wait read unstable value.
-        matrix_row_t cols = read_cols();
-        if (matrix_debouncing[i] != cols) {
-            matrix_debouncing[i] = cols;
-            if (debouncing) {
-                debug("bounce!: "); debug_hex(debouncing); debug("\n");
-            }
-            debouncing = DEBOUNCE;
-        }
-        unselect_rows();
-    }
-
-    if (debouncing) {
-        if (--debouncing) {
-            wait_ms(1);
-        } else {
-            for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-                matrix[i] = matrix_debouncing[i];
-            }
-        }
-    }
-
-    return 1;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
-    return (matrix[row] & ((matrix_row_t)1<<col));
-}
-
-inline
-matrix_row_t matrix_get_row(uint8_t row)
-{
-    return matrix[row];
-}
-
-void matrix_print(void)
-{
-    print("\nr/c 0123456789ABCDEF\n");
-    for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
-        phex(row); print(": ");
-        pbin_reverse16(matrix_get_row(row));
-        print("\n");
-    }
-}
-
-/* Column pin configuration
- */
-static void  init_cols(void)
-{
-    // internal pull-up
-    palSetPadMode(TEENSY_PIN2_IOPORT, TEENSY_PIN2, PAL_MODE_INPUT_PULLUP);
-}
-
-/* Returns status of switches(1:on, 0:off) */
-static matrix_row_t read_cols(void)
-{
-    return ((palReadPad(TEENSY_PIN2_IOPORT, TEENSY_PIN2)==PAL_HIGH) ? 0 : (1<<0));
-    // | ((palReadPad(...)==PAL_HIGH) ? 0 : (1<<1))
-}
-
-/* Row pin configuration
- */
-static void unselect_rows(void)
-{
-    palSetPadMode(TEENSY_PIN5_IOPORT, TEENSY_PIN5, PAL_MODE_INPUT); // hi-Z
-}
-
-static void select_row(uint8_t row)
-{
-    (void)row;
-    // Output low to select
-    switch (row) {
-        case 0:
-            palSetPadMode(TEENSY_PIN5_IOPORT, TEENSY_PIN5, PAL_MODE_OUTPUT_PUSHPULL);
-            palClearPad(TEENSY_PIN5_IOPORT, TEENSY_PIN5);
-            break;
-    }
-}
diff --git a/keyboards/teensy_lc_onekey/mcuconf.h b/keyboards/teensy_lc_onekey/mcuconf.h
deleted file mode 100644 (file)
index c636590..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*\r
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio\r
-\r
-    Licensed under the Apache License, Version 2.0 (the "License");\r
-    you may not use this file except in compliance with the License.\r
-    You may obtain a copy of the License at\r
-\r
-        http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-    Unless required by applicable law or agreed to in writing, software\r
-    distributed under the License is distributed on an "AS IS" BASIS,\r
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-    See the License for the specific language governing permissions and\r
-    limitations under the License.\r
-*/\r
-\r
-#ifndef _MCUCONF_H_\r
-#define _MCUCONF_H_\r
-\r
-#define KL2x_MCUCONF\r
-\r
-/*\r
- * HAL driver system settings.\r
- */\r
-#if 1\r
-/* PEE mode - 48MHz system clock driven by (16 MHz) external crystal. */\r
-#define KINETIS_MCG_MODE            KINETIS_MCG_MODE_PEE\r
-#define KINETIS_PLLCLK_FREQUENCY    96000000UL\r
-#define KINETIS_SYSCLK_FREQUENCY    48000000UL\r
-#endif\r
-\r
-#if 0\r
-/* crystal-less FEI mode - 48 MHz with internal 32.768 kHz crystal */\r
-#define KINETIS_MCG_MODE            KINETIS_MCG_MODE_FEI\r
-#define KINETIS_MCG_FLL_DMX32       1           /* Fine-tune for 32.768 kHz */\r
-#define KINETIS_MCG_FLL_DRS         1           /* 1464x FLL factor */\r
-#define KINETIS_SYSCLK_FREQUENCY    47972352UL  /* 32.768 kHz * 1464 (~48 MHz) */\r
-#define KINETIS_CLKDIV1_OUTDIV1     1           /* do not divide system clock */\r
-#endif\r
-\r
-/*\r
- * SERIAL driver system settings.\r
- */\r
-#define KINETIS_SERIAL_USE_UART0              TRUE\r
-\r
-/*\r
- * USB driver settings\r
- */\r
-#define KINETIS_USB_USE_USB0                  TRUE\r
-/* Need to redefine this, since the default is for K20x */\r
-/* This is for Teensy LC; you should comment it out (or change to 5)\r
- * for Teensy 3.x */\r
-#define KINETIS_USB_USB0_IRQ_PRIORITY         2\r
-\r
-#endif /* _MCUCONF_H_ */\r
diff --git a/keyboards/teensy_lc_onekey/teensy_lc_onekey.c b/keyboards/teensy_lc_onekey/teensy_lc_onekey.c
deleted file mode 100644 (file)
index b6c4327..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "teensy_lc_onekey.h"
diff --git a/keyboards/teensy_lc_onekey/teensy_lc_onekey.h b/keyboards/teensy_lc_onekey/teensy_lc_onekey.h
deleted file mode 100644 (file)
index f598bcf..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef TEENSY_LC_ONEKEY_H
-#define TEENSY_LC_ONEKEY_H
-#include "quantum.h"
-#endif
index a38c13f15b1e8699f6ab51b20ae66bb08961cd4e..094917025527a0558f09801d8d82a98c2f4468da 100644 (file)
@@ -26,32 +26,46 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "util.h"
 #include "matrix.h"
 
-#ifdef MATRIX_HAS_GHOST
-#   error "The universal matrix.c file cannot be used for this keyboard."
-#endif
+/* Set 0 if debouncing isn't needed */
+/*
+ * This constant define not debouncing time in msecs, but amount of matrix
+ * scan loops which should be made to get stable debounced results.
+ *
+ * On Ergodox matrix scan rate is relatively low, because of slow I2C.
+ * Now it's only 317 scans/second, or about 3.15 msec/scan.
+ * According to Cherry specs, debouncing time is 5 msec.
+ *
+ * And so, there is no sense to have DEBOUNCE higher than 2.
+ */
 
 #ifndef DEBOUNCING_DELAY
 #   define DEBOUNCING_DELAY 5
 #endif
+static uint8_t debouncing = DEBOUNCING_DELAY;
 
 static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
 static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
-/* matrix state */
-#if DIODE_DIRECTION == COL2ROW
+
+/* matrix state(1:on, 0:off) */
 static matrix_row_t matrix[MATRIX_ROWS];
-#else
-static matrix_col_t matrix[MATRIX_COLS];
+static matrix_row_t matrix_debouncing[MATRIX_ROWS];
+
+#if DIODE_DIRECTION == ROW2COL
+    static matrix_row_t matrix_reversed[MATRIX_COLS];
+    static matrix_row_t matrix_reversed_debouncing[MATRIX_COLS];
 #endif
-static int8_t debouncing_delay = -1;
 
-#if DIODE_DIRECTION == COL2ROW
-static void toggle_row(uint8_t row);
-static matrix_row_t read_cols(void);
+#if MATRIX_COLS > 16
+    #define SHIFTER 1UL
 #else
-static void toggle_col(uint8_t col);
-static matrix_col_t read_rows(void);
+    #define SHIFTER 1
 #endif
 
+static matrix_row_t read_cols(void);
+static void init_cols(void);
+static void unselect_rows(void);
+static void select_row(uint8_t row);
+
 __attribute__ ((weak))
 void matrix_init_quantum(void) {
     matrix_init_kb();
@@ -80,10 +94,12 @@ __attribute__ ((weak))
 void matrix_scan_user(void) {
 }
 
+inline
 uint8_t matrix_rows(void) {
     return MATRIX_ROWS;
 }
 
+inline
 uint8_t matrix_cols(void) {
     return MATRIX_COLS;
 }
@@ -113,161 +129,179 @@ uint8_t matrix_cols(void) {
 // }
 
 void matrix_init(void) {
-    /* frees PORTF by setting the JTD bit twice within four cycles */
+    // To use PORTF disable JTAG with writing JTD bit twice within four cycles.
     #ifdef __AVR_ATmega32U4__
         MCUCR |= _BV(JTD);
         MCUCR |= _BV(JTD);
     #endif
-    /* initializes the I/O pins */
-#if DIODE_DIRECTION == COL2ROW
-    for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
-        /* DDRxn */
-        _SFR_IO8((row_pins[r] >> 4) + 1) |= _BV(row_pins[r] & 0xF);
-        toggle_row(r);
-    }
-    for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) {
-        /* PORTxn */
-        _SFR_IO8((col_pins[c] >> 4) + 2) |= _BV(col_pins[c] & 0xF);
-    }
-#else
-    for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) {
-        /* DDRxn */
-        _SFR_IO8((col_pins[c] >> 4) + 1) |= _BV(col_pins[c] & 0xF);
-        toggle_col(c);
-    }
-    for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
-        /* PORTxn */
-        _SFR_IO8((row_pins[r] >> 4) + 2) |= _BV(row_pins[r] & 0xF);
+
+    // initialize row and col
+    unselect_rows();
+    init_cols();
+
+    // initialize matrix state: all keys off
+    for (uint8_t i=0; i < MATRIX_ROWS; i++) {
+        matrix[i] = 0;
+        matrix_debouncing[i] = 0;
     }
-#endif
+
     matrix_init_quantum();
 }
 
+uint8_t matrix_scan(void)
+{
+
 #if DIODE_DIRECTION == COL2ROW
-uint8_t matrix_scan(void) {
-    static matrix_row_t debouncing_matrix[MATRIX_ROWS];
-    for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
-        toggle_row(r);
-        matrix_row_t state = read_cols();
-        if (debouncing_matrix[r] != state) {
-            debouncing_matrix[r] = state;
-            debouncing_delay = DEBOUNCING_DELAY;
-        }
-        toggle_row(r);
-    }
-    if (debouncing_delay >= 0) {
-        dprintf("Debouncing delay remaining: %X\n", debouncing_delay);
-        --debouncing_delay;
-        if (debouncing_delay >= 0) {
-            wait_ms(1);
-        }
-        else {
-            for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
-                matrix[r] = debouncing_matrix[r];
+    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+        select_row(i);
+        wait_us(30);  // without this wait read unstable value.
+        matrix_row_t cols = read_cols();
+        if (matrix_debouncing[i] != cols) {
+            matrix_debouncing[i] = cols;
+            if (debouncing) {
+                debug("bounce!: "); debug_hex(debouncing); debug("\n");
             }
+            debouncing = DEBOUNCING_DELAY;
         }
+        unselect_rows();
     }
-    matrix_scan_quantum();
-    return 1;
-}
-
-static void toggle_row(uint8_t row) {
-    /* PINxn */
-    _SFR_IO8((row_pins[row] >> 4)) = _BV(row_pins[row] & 0xF);
-}
 
-static matrix_row_t read_cols(void) {
-    matrix_row_t state = 0;
-    for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) {
-        /* PINxn */
-        if (!(_SFR_IO8((col_pins[c] >> 4)) & _BV(col_pins[c] & 0xF))) {
-            state |= (matrix_row_t)1 << c;
+    if (debouncing) {
+        if (--debouncing) {
+            wait_us(1);
+        } else {
+            for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+                matrix[i] = matrix_debouncing[i];
+            }
         }
     }
-    return state;
-}
-
-matrix_row_t matrix_get_row(uint8_t row) {
-    return matrix[row];
-}
-
 #else
-uint8_t matrix_scan(void) {
-    static matrix_col_t debouncing_matrix[MATRIX_COLS];
-    for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) {
-        toggle_col(c);
-        matrix_col_t state = read_rows();
-        if (debouncing_matrix[c] != state) {
-            debouncing_matrix[c] = state;
-            debouncing_delay = DEBOUNCING_DELAY;
+    for (uint8_t i = 0; i < MATRIX_COLS; i++) {
+        select_row(i);
+        wait_us(30);  // without this wait read unstable value.
+        matrix_row_t rows = read_cols();
+        if (matrix_reversed_debouncing[i] != rows) {
+            matrix_reversed_debouncing[i] = rows;
+            if (debouncing) {
+                debug("bounce!: "); debug_hex(debouncing); debug("\n");
+            }
+            debouncing = DEBOUNCING_DELAY;
         }
-        toggle_col(c);
+        unselect_rows();
     }
-    if (debouncing_delay >= 0) {
-        dprintf("Debouncing delay remaining: %X\n", debouncing_delay);
-        --debouncing_delay;
-        if (debouncing_delay >= 0) {
-            wait_ms(1);
-        }
-        else {
-            for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) {
-                matrix[c] = debouncing_matrix[c];
+
+    if (debouncing) {
+        if (--debouncing) {
+            wait_us(1);
+        } else {
+            for (uint8_t i = 0; i < MATRIX_COLS; i++) {
+                matrix_reversed[i] = matrix_reversed_debouncing[i];
             }
         }
     }
+    for (uint8_t y = 0; y < MATRIX_ROWS; y++) {
+        matrix_row_t row = 0;
+        for (uint8_t x = 0; x < MATRIX_COLS; x++) {
+            row |= ((matrix_reversed[x] & (1<<y)) >> y) << x;
+        }
+        matrix[y] = row;
+    }
+#endif
+
     matrix_scan_quantum();
+
     return 1;
 }
 
-static void toggle_col(uint8_t col) {
-    /* PINxn */
-    _SFR_IO8((col_pins[col] >> 4)) = _BV(col_pins[col] & 0xF);
+bool matrix_is_modified(void)
+{
+    if (debouncing) return false;
+    return true;
 }
 
-static matrix_col_t read_rows(void) {
-    matrix_col_t state = 0;
-    for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
-        /* PINxn */
-        if (!(_SFR_IO8((row_pins[r] >> 4)) & _BV(row_pins[r] & 0xF))) {
-            state |= (matrix_col_t)1 << r;
-        }
+inline
+bool matrix_is_on(uint8_t row, uint8_t col)
+{
+    return (matrix[row] & ((matrix_row_t)1<col));
+}
+
+inline
+matrix_row_t matrix_get_row(uint8_t row)
+{
+    return matrix[row];
+}
+
+void matrix_print(void)
+{
+    print("\nr/c 0123456789ABCDEF\n");
+    for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
+        phex(row); print(": ");
+        pbin_reverse16(matrix_get_row(row));
+        print("\n");
     }
-    return state;
 }
 
-matrix_row_t matrix_get_row(uint8_t row) {
-    matrix_row_t state = 0;
-    matrix_col_t mask = (matrix_col_t)1 << row;
-    for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) {
-        if (matrix[c] & mask) {
-            state |= (matrix_row_t)1 << c;
-        }
+uint8_t matrix_key_count(void)
+{
+    uint8_t count = 0;
+    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+        count += bitpop16(matrix[i]);
     }
-    return state;
+    return count;
 }
 
+static void init_cols(void)
+{
+#if DIODE_DIRECTION == COL2ROW
+    for(int x = 0; x < MATRIX_COLS; x++) {
+        int pin = col_pins[x];
+#else
+    for(int x = 0; x < MATRIX_ROWS; x++) {
+        int pin = row_pins[x];
 #endif
-
-bool matrix_is_modified(void) {
-    if (debouncing_delay >= 0) return false;
-    return true;
+        _SFR_IO8((pin >> 4) + 1) &=  ~_BV(pin & 0xF);
+        _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF);
+    }
 }
 
-bool matrix_is_on(uint8_t row, uint8_t col) {
-    return matrix_get_row(row) & (matrix_row_t)1 << col;
-}
+static matrix_row_t read_cols(void)
+{
+    matrix_row_t result = 0;
 
-void matrix_print(void) {
-    dprintln("Human-readable matrix state:");
-    for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
-        dprintf("State of row %X: %016b\n", r, bitrev16(matrix_get_row(r)));
+#if DIODE_DIRECTION == COL2ROW
+    for(int x = 0; x < MATRIX_COLS; x++) {     
+        int pin = col_pins[x];
+#else
+    for(int x = 0; x < MATRIX_ROWS; x++) {
+        int pin = row_pins[x];
+#endif
+        result |= (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)) ? 0 : (SHIFTER << x);
     }
+    return result;
 }
 
-uint8_t matrix_key_count(void) {
-    uint8_t count = 0;
-    for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
-        count += bitpop16(matrix_get_row(r));
+static void unselect_rows(void)
+{
+#if DIODE_DIRECTION == COL2ROW
+    for(int x = 0; x < MATRIX_ROWS; x++) { 
+        int pin = row_pins[x];
+#else
+    for(int x = 0; x < MATRIX_COLS; x++) { 
+        int pin = col_pins[x];
+#endif
+        _SFR_IO8((pin >> 4) + 1) &=  ~_BV(pin & 0xF);
+        _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF);
     }
-    return count;
+}
+
+static void select_row(uint8_t row)
+{
+
+#if DIODE_DIRECTION == COL2ROW
+    int pin = row_pins[row];
+#else
+    int pin = col_pins[row];
+#endif
+    _SFR_IO8((pin >> 4) + 1) |=  _BV(pin & 0xF);
+    _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF);
 }
index a6f3c6441475d4240e1c86c044d13a99f2dd6245..8a7272bbc5298612bc935f51116d5e44973cddf2 100644 (file)
@@ -114,8 +114,10 @@ bool suspend_wakeup_condition(void)
     matrix_power_up();
     matrix_scan();
     matrix_power_down();
-    if (matrix_key_count()) return true;
-    return false;
+    for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
+        if (matrix_get_row(r)) return true;
+    }
+     return false;
 }
 
 // run immediately after wakeup
index 90275a18ba7b3330b4bab770cf03a79f1c616300..6730a2a4aab44372c0357e3ff9e85c6846fb6cfa 100644 (file)
@@ -106,13 +106,15 @@ void bootmagic(void)
     }
 }
 
-static bool scan_keycode(uint8_t keycode) {
-    for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
+static bool scan_keycode(uint8_t keycode)
+{
+    for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
         matrix_row_t matrix_row = matrix_get_row(r);
-        for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) {
-            if (matrix_row & (matrix_row_t)1 << c) {
-                keypos_t key = (keypos_t){ .row = r, .col = c };
-                if (keycode == keymap_key_to_keycode(0, key)) return true;
+        for (uint8_t c = 0; c < MATRIX_COLS; c++) {
+            if (matrix_row & ((matrix_row_t)1<<c)) {
+                if (keycode == keymap_key_to_keycode(0, (keypos_t){ .row = r, .col = c })) {
+                    return true;
+                }
             }
         }
     }
@@ -124,4 +126,4 @@ bool bootmagic_scan_keycode(uint8_t keycode)
     if (!scan_keycode(BOOTMAGIC_KEY_SALT)) return false;
 
     return scan_keycode(keycode);
-}
+}
\ No newline at end of file
index 34e1ceeca57eb19b552bd6c7ae07604c38e1c05c..81df8eb73bf535594ce5d19cd68e81eab4a6514d 100644 (file)
@@ -51,17 +51,20 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #endif
 
 #ifdef MATRIX_HAS_GHOST
-static bool is_row_ghosting(uint8_t row){
-    matrix_row_t state = matrix_get_row(row);
-    /* no ghosting happens when only one key in the row is pressed */
-    if (!(state - 1 & state)) return false;
-    /* ghosting occurs when two keys in the same column are pressed */
-    for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
-        if (r != row && matrix_get_row(r) & state) return true;
+static bool has_ghost_in_row(uint8_t row)
+{
+    matrix_row_t matrix_row = matrix_get_row(row);
+    // No ghost exists when less than 2 keys are down on the row
+    if (((matrix_row - 1) & matrix_row) == 0)
+        return false;
+
+    // Ghost occurs when the row shares column line with other row
+    for (uint8_t i=0; i < MATRIX_ROWS; i++) {
+        if (i != row && (matrix_get_row(i) & matrix_row))
+            return true;
     }
     return false;
 }
-
 #endif
 
 __attribute__ ((weak))
@@ -100,72 +103,86 @@ void keyboard_init(void) {
 #endif
 }
 
-/* does routine keyboard jobs */
-void keyboard_task(void) {
-    static uint8_t led_status;
+/*
+ * Do keyboard routine jobs: scan mantrix, light LEDs, ...
+ * This is repeatedly called as fast as possible.
+ */
+void keyboard_task(void)
+{
+    static matrix_row_t matrix_prev[MATRIX_ROWS];
+#ifdef MATRIX_HAS_GHOST
+    static matrix_row_t matrix_ghost[MATRIX_ROWS];
+#endif
+    static uint8_t led_status = 0;
+    matrix_row_t matrix_row = 0;
+    matrix_row_t matrix_change = 0;
+
     matrix_scan();
-    for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
-        static matrix_row_t previous_matrix[MATRIX_ROWS];
-        matrix_row_t state = matrix_get_row(r);
-        matrix_row_t changes = state ^ previous_matrix[r];
-        if (changes) {
+    for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
+        matrix_row = matrix_get_row(r);
+        matrix_change = matrix_row ^ matrix_prev[r];
+        if (matrix_change) {
 #ifdef MATRIX_HAS_GHOST
-            static matrix_row_t deghosting_matrix[MATRIX_ROWS];
-            if (is_row_ghosting(r)) {
-                /* debugs the deghosting mechanism */
-                /* doesn't update previous_matrix until the ghosting has stopped
-                 * in order to prevent the last key from being lost
+            if (has_ghost_in_row(r)) {
+                /* Keep track of whether ghosted status has changed for
+                 * debugging. But don't update matrix_prev until un-ghosted, or
+                 * the last key would be lost.
                  */
-                if (debug_matrix && deghosting_matrix[r] != state) {
+                if (debug_matrix && matrix_ghost[r] != matrix_row) {
                     matrix_print();
                 }
-                deghosting_matrix[r] = state;
+                matrix_ghost[r] = matrix_row;
                 continue;
             }
-            deghosting_matrix[r] = state;
+            matrix_ghost[r] = matrix_row;
 #endif
             if (debug_matrix) matrix_print();
-            for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) {
-                matrix_row_t mask = (matrix_row_t)1 << c;
-                if (changes & mask) {
-                    keyevent_t event;
-                    event.key = (keypos_t){ .row = r, .col = c };
-                    event.pressed = state & mask;
-                    /* the time should not be 0 */
-                    event.time = timer_read() | 1;
-                    action_exec(event);
-                    /* records the processed key event */
-                    previous_matrix[r] ^= mask;
-                    /* processes one key event per call */
-                    goto event_processed;
+            for (uint8_t c = 0; c < MATRIX_COLS; c++) {
+                if (matrix_change & ((matrix_row_t)1<<c)) {
+                    action_exec((keyevent_t){
+                        .key = (keypos_t){ .row = r, .col = c },
+                        .pressed = (matrix_row & ((matrix_row_t)1<<c)),
+                        .time = (timer_read() | 1) /* time should not be 0 */
+                    });
+                    // record a processed key
+                    matrix_prev[r] ^= ((matrix_row_t)1<<c);
+                    // process a key per task call
+                    goto MATRIX_LOOP_END;
                 }
             }
         }
     }
-    /* sends tick events when the keyboard is idle */
+    // call with pseudo tick event when no real key event.
     action_exec(TICK);
-event_processed:
+
+MATRIX_LOOP_END:
+
 #ifdef MOUSEKEY_ENABLE
-    /* repeats and accelerates the mouse keys */
+    // mousekey repeat & acceleration
     mousekey_task();
 #endif
+
 #ifdef PS2_MOUSE_ENABLE
     ps2_mouse_task();
 #endif
+
 #ifdef SERIAL_MOUSE_ENABLE
-    serial_mouse_task();
+        serial_mouse_task();
 #endif
+
 #ifdef ADB_MOUSE_ENABLE
-    adb_mouse_task();
+        adb_mouse_task();
 #endif
-    /* updates the LEDs */
+
+    // update LED
     if (led_status != host_keyboard_leds()) {
         led_status = host_keyboard_leds();
         keyboard_set_leds(led_status);
     }
 }
 
-void keyboard_set_leds(uint8_t leds) {
-    if (debug_keyboard) dprintf("Keyboard LEDs state: %x\n", leds);
+void keyboard_set_leds(uint8_t leds)
+{
+    if (debug_keyboard) { debug("keyboard_set_led: "); debug_hex8(leds); debug("\n"); }
     led_set(leds);
 }
index 5f2f831b4539280eeac60c598a168a6d4ce5ce3a..71153a5f58370831f4a675d5ff17c3d885713f38 100644 (file)
@@ -20,59 +20,48 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <stdint.h>
 #include <stdbool.h>
 
-#if MATRIX_COLS <= 8
-typedef uint8_t matrix_row_t;
-#elif MATRIX_COLS <= 16
-typedef uint16_t matrix_row_t;
-#elif MATRIX_COLS <= 32
-typedef uint32_t matrix_row_t;
+
+#if (MATRIX_COLS <= 8)
+typedef  uint8_t    matrix_row_t;
+#elif (MATRIX_COLS <= 16)
+typedef  uint16_t   matrix_row_t;
+#elif (MATRIX_COLS <= 32)
+typedef  uint32_t   matrix_row_t;
 #else
-#   error "There are too many columns."
+#error "MATRIX_COLS: invalid value"
 #endif
 
-#if DIODE_DIRECTION == ROW2COL
-#   if MATRIX_ROWS <= 8
-typedef uint8_t matrix_col_t;
-#   elif MATRIX_ROWS <= 16
-typedef uint16_t matrix_col_t;
-#   elif MATRIX_ROWS <= 32
-typedef uint32_t matrix_col_t;
-#   else
-#       error "There are too many rows."
-#   endif
-#endif
+#define MATRIX_IS_ON(row, col)  (matrix_get_row(row) && (1<<col))
 
-typedef struct {
-    uint8_t input_addr:4;
-    uint8_t bit:4;
-} io_pin_t;
 
 #ifdef __cplusplus
 extern "C" {
 #endif
-/* counts the number of rows in the matrix */
+
+/* number of matrix rows */
 uint8_t matrix_rows(void);
-/* counts the number of columns in the matrix */
+/* number of matrix columns */
 uint8_t matrix_cols(void);
-/* sets up the matrix before matrix_init */
+/* should be called at early stage of startup before matrix_init.(optional) */
 void matrix_setup(void);
-/* intializes the matrix */
+/* intialize matrix for scaning. */
 void matrix_init(void);
-/* scans the entire matrix */
+/* scan all key states on matrix */
 uint8_t matrix_scan(void);
-/* checks if the matrix has been modified */
+/* whether modified from previous scan. used after matrix_scan. */
 bool matrix_is_modified(void) __attribute__ ((deprecated));
-/* checks if a key is pressed */
+/* whether a swtich is on */
 bool matrix_is_on(uint8_t row, uint8_t col);
-/* inspects the state of a row in the matrix */
+/* matrix state on row */
 matrix_row_t matrix_get_row(uint8_t row);
-/* prints the matrix for debugging */
+/* print matrix for debug */
 void matrix_print(void);
-/* counts the total number of keys pressed */
-uint8_t matrix_key_count(void);
-/* controls power to the matrix */
+
+
+/* power control */
 void matrix_power_up(void);
 void matrix_power_down(void);
+
 /* executes code for Quantum */
 void matrix_init_quantum(void);
 void matrix_scan_quantum(void);