aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/infinity_ergodox/MEMO.txt385
-rw-r--r--keyboards/infinity_ergodox/Makefile72
-rw-r--r--keyboards/infinity_ergodox/bootloader_defs.h1
-rw-r--r--keyboards/infinity_ergodox/chconf.h524
-rw-r--r--keyboards/infinity_ergodox/config.h80
-rw-r--r--keyboards/infinity_ergodox/halconf.h353
-rw-r--r--keyboards/infinity_ergodox/infinity_ergodox.c1
-rw-r--r--keyboards/infinity_ergodox/infinity_ergodox.h44
-rw-r--r--keyboards/infinity_ergodox/keymaps/default/keymap.c111
-rw-r--r--keyboards/infinity_ergodox/led.c49
-rw-r--r--keyboards/infinity_ergodox/matrix.c169
-rw-r--r--keyboards/infinity_ergodox/mcuconf.h74
-rw-r--r--tmk_core/avr.mk1
-rw-r--r--tmk_core/chibios.mk6
-rw-r--r--tmk_core/rules.mk6
15 files changed, 1875 insertions, 1 deletions
diff --git a/keyboards/infinity_ergodox/MEMO.txt b/keyboards/infinity_ergodox/MEMO.txt
new file mode 100644
index 000000000..e2886aa00
--- /dev/null
+++ b/keyboards/infinity_ergodox/MEMO.txt
@@ -0,0 +1,385 @@
1flabbergast's TMK/ChibiOS port
2==============================
32015/10/16
4
5
6Build
7-----
8$ git clone -b chibios https://github.com/flabbergast/tmk_keyboard.git
9
10$ cd tmk_keyboard
11$ git submodule add -f -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios
12or
13$ cd tmk_keyboard/tmk_core/tool/chibios
14$ git clone -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios
15
16$ cd tmk_keyboard/keyboard/infinity_chibios
17$ make
18
19
20
21
22Chibios Configuration
23---------------------
24halconf.h: for HAL configuration
25 placed in project directory
26 read in chibios/os/hal/hal.mk
27 included in chibios/os/hal/include/hal.h
28mcuconf.h: for MCU configuration
29 placed in project directory
30 included in halconf.h
31
32
33Chibios Term
34------------
35PAL = Port Abstraction Layer
36 palWritePad
37 palReadPad
38 palSetPad
39 chibios/os/hal/include/pal.h
40
41LLD = Low Level Driver
42
43
44Makefile
45--------
46 # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
47 MCU_FAMILY = KINETIS
48 MCU_SERIES = KL2x
49
50 # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
51 # or <this_dir>/ld/
52 MCU_LDSCRIPT = MKL26Z64
53
54 # - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
55 MCU_STARTUP = kl2x
56
57 # Board: it should exist either in <chibios>/os/hal/boards/
58 # or <this_dir>/boards
59 BOARD = PJRC_TEENSY_LC
60
61 MCU = cortex-m0
62
63 # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
64 ARMV = 6
65
66
67halconf.h
68---------
69
70
71mcuconf.h
72---------
73
74
75chconf.h
76--------
77
78
79ld script
80---------
81--- ../../tmk_core/tool/chibios/chibios/os/common/ports/ARMCMx/compilers/GCC/ld/MKL26Z64.ld 2015-10-15 09:08:58.732904304 +0900
82+++ ld/MKL26Z64.ld 2015-10-15 08:48:06.430215496 +0900
83@@ -27,7 +27,8 @@
84 {
85 flash0 : org = 0x00000000, len = 0xc0
86 flashcfg : org = 0x00000400, len = 0x10
87- flash : org = 0x00000410, len = 64k - 0x410
88+ flash : org = 0x00000410, len = 62k - 0x410
89+ eeprom_emu : org = 0x0000F800, len = 2k
90 ram : org = 0x1FFFF800, len = 8k
91 }
92
93@@ -35,6 +36,10 @@
94 __ram_size__ = LENGTH(ram);
95 __ram_end__ = __ram_start__ + __ram_size__;
96
97+__eeprom_workarea_start__ = ORIGIN(eeprom_emu);
98+__eeprom_workarea_size__ = LENGTH(eeprom_emu);
99+__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__;
100+
101 SECTIONS
102 {
103 . = 0;
104
105
106
107Configuration/Startup for Infinity 60%
108--------------------------------------
109Configuration:
110
111
112Clock:
113Inifinity
114 FEI(FLL Engaged Internal) mode with core clock:48MHz, bus clock:48MHz, flash clock:24MHz
115 Clock dividor:
116 SIM_CLKDIV1[OUTDIV1] = 0 divide-by-1 for core clock
117 SIM_CLKDIV1[OUTDIV2] = 0 divide-by-1 for bus clock
118 SIM_CLKDIV1[OUTDIV4] = 1 divide-by-2 for flash clock
119 Internal reference clock:
120 MCG_C1[IREFS] = 1 Internal Reference Select for clock source for FLL
121 MCG_C1[IRCLKEN] = 1 Internal Reference Clock Enable
122 FLL multipilication:
123 MCG_C4[DMX32] = 1
124 MCG_C4[DRST_DRS] = 01 FLL factor 1464 * 32.768kHz = 48MHz
125
126chibios/os/hal/ports/KINETIS/K20x/hal_lld.c
127 k20x_clock_init(): called in __early_init() defined in board.c
128 disable watchdog and configure clock
129
130 configurable macros:
131 KINETIS_NO_INIT: whether init or not
132 KINETIS_MCG_MODE: clock mode
133 KINETIS_MCG_MODE_FEI
134 KINETIS_MCG_MODE_PEE
135 hal/ports/KINETIS/K20x/hal_lld.h
136
137
138chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.h
139 PALConfig pal_default_config
140 boardInit()
141 __early_init()
142 macro definitions for board infos, freq and mcu type
143
144chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.c
145
146USB
147
148
149Startup
150-------
151 common/ports/ARMCMx/GCC/crt0_v[67]m.s
152 Reset_Handler: startup code
153 common/ports/ARMCMx/GCC/crt1.c
154 __core_init(): weak
155 __early_init(): weak
156 __late_init(): weak
157 __default_exit(): weak
158 called from Reset_Handler of crt0
159 common/ports/ARMCMx/GCC/vector.c
160 common/ports/ARMCMx/GCC/ld/*.ld
161
162chibios/os/common/ports/ARMCMx/compilers/GCC/
163├── crt0_v6m.s
164├── crt0_v7m.s
165├── crt1.c
166├── ld
167│   ├── MK20DX128BLDR3.ld
168│   ├── MK20DX128BLDR4.ld
169│   ├── MK20DX128.ld
170│   ├── MK20DX256.ld
171│   ├── MKL25Z128.ld
172│   ├── MKL26Z128.ld
173│   ├── MKL26Z64.ld
174│   └── STM32L476xG.ld
175├── mk
176│   ├── startup_k20x5.mk
177│   ├── startup_k20x7.mk
178│   ├── startup_k20x.mk
179│   ├── startup_kl2x.mk
180│   └── startup_stm32l4xx.mk
181├── rules.ld
182├── rules.mk
183└── vectors.c
184
185chibios/os/hal/
186├── boards
187│   ├── FREESCALE_FREEDOM_K20D50M
188│   │   ├── board.c
189│   │   ├── board.h
190│   │   └── board.mk
191│   ├── MCHCK_K20
192│   │   ├── board.c
193│   │   ├── board.h
194│   │   └── board.mk
195│   ├── PJRC_TEENSY_3
196│   │   ├── board.c
197│   │   ├── board.h
198│   │   └── board.mk
199│   ├── PJRC_TEENSY_3_1
200│   │   ├── board.c
201│   │   ├── board.h
202│   │   └── board.mk
203│   ├── PJRC_TEENSY_LC
204│   │   ├── board.c
205│   │   ├── board.h
206│   │   └── board.mk
207│   ├── readme.txt
208│   ├── simulator
209│   │   ├── board.c
210│   │   ├── board.h
211│   │   └── board.mk
212│   ├── ST_NUCLEO_F030R8
213│   │   ├── board.c
214│   │   ├── board.h
215│   │   ├── board.mk
216│   │   └── cfg
217│   │   └── board.chcfg
218├── hal.mk
219├── include
220│   ├── adc.h
221│   ├── can.h
222│   ├── dac.h
223│   ├── ext.h
224│   ├── gpt.h
225│   ├── hal_channels.h
226│   ├── hal_files.h
227│   ├── hal.h
228│   ├── hal_ioblock.h
229│   ├── hal_mmcsd.h
230│   ├── hal_queues.h
231│   ├── hal_streams.h
232│   ├── i2c.h
233│   ├── i2s.h
234│   ├── icu.h
235│   ├── mac.h
236│   ├── mii.h
237│   ├── mmc_spi.h
238│   ├── pal.h
239│   ├── pwm.h
240│   ├── rtc.h
241│   ├── sdc.h
242│   ├── serial.h
243│   ├── serial_usb.h
244│   ├── spi.h
245│   ├── st.h
246│   ├── uart.h
247│   └── usb.h
248├── lib
249│   └── streams
250│   ├── chprintf.c
251│   ├── chprintf.h
252│   ├── memstreams.c
253│   ├── memstreams.h
254│   ├── nullstreams.c
255│   └── nullstreams.h
256├── osal
257│   ├── nil
258│   │   ├── osal.c
259│   │   ├── osal.h
260│   │   └── osal.mk
261│   ├── os-less
262│   │   └── ARMCMx
263│   │   ├── osal.c
264│   │   ├── osal.h
265│   │   └── osal.mk
266│   └── rt
267│   ├── osal.c
268│   ├── osal.h
269│   └── osal.mk
270├── ports
271│   ├── AVR
272│   ├── common
273│   │   └── ARMCMx
274│   │   ├── mpu.h
275│   │   ├── nvic.c
276│   │   └── nvic.h
277│   ├── KINETIS
278│   │   ├── K20x
279│   │   │   ├── hal_lld.c
280│   │   │   ├── hal_lld.h
281│   │   │   ├── kinetis_registry.h
282│   │   │   ├── platform.dox
283│   │   │   ├── platform.mk
284│   │   │   ├── pwm_lld.c
285│   │   │   ├── pwm_lld.h
286│   │   │   ├── spi_lld.c
287│   │   │   └── spi_lld.h
288│   │   ├── KL2x
289│   │   │   ├── hal_lld.c
290│   │   │   ├── hal_lld.h
291│   │   │   ├── kinetis_registry.h
292│   │   │   ├── platform.mk
293│   │   │   ├── pwm_lld.c
294│   │   │   └── pwm_lld.h
295│   │   ├── LLD
296│   │   │   ├── adc_lld.c
297│   │   │   ├── adc_lld.h
298│   │   │   ├── ext_lld.c
299│   │   │   ├── ext_lld.h
300│   │   │   ├── gpt_lld.c
301│   │   │   ├── gpt_lld.h
302│   │   │   ├── i2c_lld.c
303│   │   │   ├── i2c_lld.h
304│   │   │   ├── pal_lld.c
305│   │   │   ├── pal_lld.h
306│   │   │   ├── serial_lld.c
307│   │   │   ├── serial_lld.h
308│   │   │   ├── st_lld.c
309│   │   │   ├── st_lld.h
310│   │   │   ├── usb_lld.c
311│   │   │   └── usb_lld.h
312│   │   └── README.md
313│   ├── LPC
314│   ├── simulator
315│   └── STM32
316├── src
317│   ├── adc.c
318│   ├── can.c
319│   ├── dac.c
320│   ├── ext.c
321│   ├── gpt.c
322│   ├── hal.c
323│   ├── hal_mmcsd.c
324│   ├── hal_queues.c
325│   ├── i2c.c
326│   ├── i2s.c
327│   ├── icu.c
328│   ├── mac.c
329│   ├── mmc_spi.c
330│   ├── pal.c
331│   ├── pwm.c
332│   ├── rtc.c
333│   ├── sdc.c
334│   ├── serial.c
335│   ├── serial_usb.c
336│   ├── spi.c
337│   ├── st.c
338│   ├── uart.c
339│   └── usb.c
340└── templates
341 ├── adc_lld.c
342 ├── adc_lld.h
343 ├── can_lld.c
344 ├── can_lld.h
345 ├── dac_lld.c
346 ├── dac_lld.h
347 ├── ext_lld.c
348 ├── ext_lld.h
349 ├── gpt_lld.c
350 ├── gpt_lld.h
351 ├── halconf.h
352 ├── hal_lld.c
353 ├── hal_lld.h
354 ├── i2c_lld.c
355 ├── i2c_lld.h
356 ├── i2s_lld.c
357 ├── i2s_lld.h
358 ├── icu_lld.c
359 ├── icu_lld.h
360 ├── mac_lld.c
361 ├── mac_lld.h
362 ├── mcuconf.h
363 ├── osal
364 │   ├── osal.c
365 │   ├── osal.h
366 │   └── osal.mk
367 ├── pal_lld.c
368 ├── pal_lld.h
369 ├── platform.mk
370 ├── pwm_lld.c
371 ├── pwm_lld.h
372 ├── rtc_lld.c
373 ├── rtc_lld.h
374 ├── sdc_lld.c
375 ├── sdc_lld.h
376 ├── serial_lld.c
377 ├── serial_lld.h
378 ├── spi_lld.c
379 ├── spi_lld.h
380 ├── st_lld.c
381 ├── st_lld.h
382 ├── uart_lld.c
383 ├── uart_lld.h
384 ├── usb_lld.c
385 └── usb_lld.h
diff --git a/keyboards/infinity_ergodox/Makefile b/keyboards/infinity_ergodox/Makefile
new file mode 100644
index 000000000..fb21aae5e
--- /dev/null
+++ b/keyboards/infinity_ergodox/Makefile
@@ -0,0 +1,72 @@
1# project specific files
2SRC = matrix.c \
3 led.c
4
5## chip/board settings
6# - the next two should match the directories in
7# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
8# - For Teensies, FAMILY = KINETIS and SERIES is either
9# KL2x (LC) or K20x (3.0,3.1,3.2).
10# - For Infinity KB, SERIES = K20x
11MCU_FAMILY = KINETIS
12MCU_SERIES = K20x
13
14# Linker script to use
15# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
16# or <this_dir>/ld/
17# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
18# - LDSCRIPT =
19# - MKL26Z64 for Teensy LC
20# - MK20DX128 for Teensy 3.0
21# - MK20DX256 for Teensy 3.1 and 3.2
22# - MK20DX128BLDR4 for Infinity 60% with Kiibohd bootloader
23# - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader
24MCU_LDSCRIPT = MK20DX256BLDR8
25
26# Startup code to use
27# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
28# - STARTUP =
29# - kl2x for Teensy LC
30# - k20x5 for Teensy 3.0 and Infinity 60%
31# - k20x7 for Teensy 3.1, 3.2 and Infinity ErgoDox
32MCU_STARTUP = k20x7
33
34# Board: it should exist either in <chibios>/os/hal/boards/
35# or <this_dir>/boards
36# - BOARD =
37# - PJRC_TEENSY_LC for Teensy LC
38# - PJRC_TEENSY_3 for Teensy 3.0
39# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
40# - MCHCK_K20 for Infinity KB
41#BOARD = MCHCK_K20
42BOARD = PJRC_TEENSY_3_1
43
44# Cortex version
45# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
46MCU = cortex-m4
47
48# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
49# I.e. 6 for Teensy LC; 7 for Teensy 3.x
50ARMV = 7
51
52# Vector table for application
53# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
54# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
55OPT_DEFS = -DCORTEX_VTOR_INIT=0x00002000
56
57# Build Options
58# comment out to disable the options.
59#
60BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration
61## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
62MOUSEKEY_ENABLE ?= yes # Mouse keys
63EXTRAKEY_ENABLE ?= yes # Audio control and System control
64CONSOLE_ENABLE ?= yes # Console for debug
65COMMAND_ENABLE ?= yes # Commands for debug and configuration
66SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
67NKRO_ENABLE ?= yes # USB Nkey Rollover
68CUSTOM_MATRIX ?= yes # Custom matrix file
69
70ifndef QUANTUM_DIR
71 include ../../Makefile
72endif \ No newline at end of file
diff --git a/keyboards/infinity_ergodox/bootloader_defs.h b/keyboards/infinity_ergodox/bootloader_defs.h
new file mode 100644
index 000000000..c67153be6
--- /dev/null
+++ b/keyboards/infinity_ergodox/bootloader_defs.h
@@ -0,0 +1 @@
#define KIIBOHD_BOOTLOADER
diff --git a/keyboards/infinity_ergodox/chconf.h b/keyboards/infinity_ergodox/chconf.h
new file mode 100644
index 000000000..d59c35eb6
--- /dev/null
+++ b/keyboards/infinity_ergodox/chconf.h
@@ -0,0 +1,524 @@
1/*
2 ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/chconf.h
19 * @brief Configuration file template.
20 * @details A copy of this file must be placed in each project directory, it
21 * contains the application specific kernel settings.
22 *
23 * @addtogroup config
24 * @details Kernel related settings and hooks.
25 * @{
26 */
27
28#ifndef _CHCONF_H_
29#define _CHCONF_H_
30
31#define _CHIBIOS_RT_CONF_
32
33/*===========================================================================*/
34/**
35 * @name System timers settings
36 * @{
37 */
38/*===========================================================================*/
39
40/**
41 * @brief System time counter resolution.
42 * @note Allowed values are 16 or 32 bits.
43 */
44#define CH_CFG_ST_RESOLUTION 32
45
46/**
47 * @brief System tick frequency.
48 * @details Frequency of the system timer that drives the system ticks. This
49 * setting also defines the system tick time unit.
50 */
51#define CH_CFG_ST_FREQUENCY 100000
52
53/**
54 * @brief Time delta constant for the tick-less mode.
55 * @note If this value is zero then the system uses the classic
56 * periodic tick. This value represents the minimum number
57 * of ticks that is safe to specify in a timeout directive.
58 * The value one is not valid, timeouts are rounded up to
59 * this value.
60 */
61#define CH_CFG_ST_TIMEDELTA 0
62
63/** @} */
64
65/*===========================================================================*/
66/**
67 * @name Kernel parameters and options
68 * @{
69 */
70/*===========================================================================*/
71
72/**
73 * @brief Round robin interval.
74 * @details This constant is the number of system ticks allowed for the
75 * threads before preemption occurs. Setting this value to zero
76 * disables the preemption for threads with equal priority and the
77 * round robin becomes cooperative. Note that higher priority
78 * threads can still preempt, the kernel is always preemptive.
79 * @note Disabling the round robin preemption makes the kernel more compact
80 * and generally faster.
81 * @note The round robin preemption is not supported in tickless mode and
82 * must be set to zero in that case.
83 */
84#define CH_CFG_TIME_QUANTUM 20
85
86/**
87 * @brief Managed RAM size.
88 * @details Size of the RAM area to be managed by the OS. If set to zero
89 * then the whole available RAM is used. The core memory is made
90 * available to the heap allocator and/or can be used directly through
91 * the simplified core memory allocator.
92 *
93 * @note In order to let the OS manage the whole RAM the linker script must
94 * provide the @p __heap_base__ and @p __heap_end__ symbols.
95 * @note Requires @p CH_CFG_USE_MEMCORE.
96 */
97#define CH_CFG_MEMCORE_SIZE 0
98
99/**
100 * @brief Idle thread automatic spawn suppression.
101 * @details When this option is activated the function @p chSysInit()
102 * does not spawn the idle thread. The application @p main()
103 * function becomes the idle thread and must implement an
104 * infinite loop.
105 */
106#define CH_CFG_NO_IDLE_THREAD FALSE
107
108/** @} */
109
110/*===========================================================================*/
111/**
112 * @name Performance options
113 * @{
114 */
115/*===========================================================================*/
116
117/**
118 * @brief OS optimization.
119 * @details If enabled then time efficient rather than space efficient code
120 * is used when two possible implementations exist.
121 *
122 * @note This is not related to the compiler optimization options.
123 * @note The default is @p TRUE.
124 */
125#define CH_CFG_OPTIMIZE_SPEED TRUE
126
127/** @} */
128
129/*===========================================================================*/
130/**
131 * @name Subsystem options
132 * @{
133 */
134/*===========================================================================*/
135
136/**
137 * @brief Time Measurement APIs.
138 * @details If enabled then the time measurement APIs are included in
139 * the kernel.
140 *
141 * @note The default is @p TRUE.
142 */
143#define CH_CFG_USE_TM FALSE
144
145/**
146 * @brief Threads registry APIs.
147 * @details If enabled then the registry APIs are included in the kernel.
148 *
149 * @note The default is @p TRUE.
150 */
151#define CH_CFG_USE_REGISTRY TRUE
152
153/**
154 * @brief Threads synchronization APIs.
155 * @details If enabled then the @p chThdWait() function is included in
156 * the kernel.
157 *
158 * @note The default is @p TRUE.
159 */
160#define CH_CFG_USE_WAITEXIT TRUE
161
162/**
163 * @brief Semaphores APIs.
164 * @details If enabled then the Semaphores APIs are included in the kernel.
165 *
166 * @note The default is @p TRUE.
167 */
168#define CH_CFG_USE_SEMAPHORES TRUE
169
170/**
171 * @brief Semaphores queuing mode.
172 * @details If enabled then the threads are enqueued on semaphores by
173 * priority rather than in FIFO order.
174 *
175 * @note The default is @p FALSE. Enable this if you have special
176 * requirements.
177 * @note Requires @p CH_CFG_USE_SEMAPHORES.
178 */
179#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
180
181/**
182 * @brief Mutexes APIs.
183 * @details If enabled then the mutexes APIs are included in the kernel.
184 *
185 * @note The default is @p TRUE.
186 */
187#define CH_CFG_USE_MUTEXES TRUE
188
189/**
190 * @brief Enables recursive behavior on mutexes.
191 * @note Recursive mutexes are heavier and have an increased
192 * memory footprint.
193 *
194 * @note The default is @p FALSE.
195 * @note Requires @p CH_CFG_USE_MUTEXES.
196 */
197#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
198
199/**
200 * @brief Conditional Variables APIs.
201 * @details If enabled then the conditional variables APIs are included
202 * in the kernel.
203 *
204 * @note The default is @p TRUE.
205 * @note Requires @p CH_CFG_USE_MUTEXES.
206 */
207#define CH_CFG_USE_CONDVARS TRUE
208
209/**
210 * @brief Conditional Variables APIs with timeout.
211 * @details If enabled then the conditional variables APIs with timeout
212 * specification are included in the kernel.
213 *
214 * @note The default is @p TRUE.
215 * @note Requires @p CH_CFG_USE_CONDVARS.
216 */
217#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
218
219/**
220 * @brief Events Flags APIs.
221 * @details If enabled then the event flags APIs are included in the kernel.
222 *
223 * @note The default is @p TRUE.
224 */
225#define CH_CFG_USE_EVENTS TRUE
226
227/**
228 * @brief Events Flags APIs with timeout.
229 * @details If enabled then the events APIs with timeout specification
230 * are included in the kernel.
231 *
232 * @note The default is @p TRUE.
233 * @note Requires @p CH_CFG_USE_EVENTS.
234 */
235#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
236
237/**
238 * @brief Synchronous Messages APIs.
239 * @details If enabled then the synchronous messages APIs are included
240 * in the kernel.
241 *
242 * @note The default is @p TRUE.
243 */
244#define CH_CFG_USE_MESSAGES TRUE
245
246/**
247 * @brief Synchronous Messages queuing mode.
248 * @details If enabled then messages are served by priority rather than in
249 * FIFO order.
250 *
251 * @note The default is @p FALSE. Enable this if you have special
252 * requirements.
253 * @note Requires @p CH_CFG_USE_MESSAGES.
254 */
255#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
256
257/**
258 * @brief Mailboxes APIs.
259 * @details If enabled then the asynchronous messages (mailboxes) APIs are
260 * included in the kernel.
261 *
262 * @note The default is @p TRUE.
263 * @note Requires @p CH_CFG_USE_SEMAPHORES.
264 */
265#define CH_CFG_USE_MAILBOXES TRUE
266
267/**
268 * @brief I/O Queues APIs.
269 * @details If enabled then the I/O queues APIs are included in the kernel.
270 *
271 * @note The default is @p TRUE.
272 */
273#define CH_CFG_USE_QUEUES TRUE
274
275/**
276 * @brief Core Memory Manager APIs.
277 * @details If enabled then the core memory manager APIs are included
278 * in the kernel.
279 *
280 * @note The default is @p TRUE.
281 */
282#define CH_CFG_USE_MEMCORE TRUE
283
284/**
285 * @brief Heap Allocator APIs.
286 * @details If enabled then the memory heap allocator APIs are included
287 * in the kernel.
288 *
289 * @note The default is @p TRUE.
290 * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
291 * @p CH_CFG_USE_SEMAPHORES.
292 * @note Mutexes are recommended.
293 */
294#define CH_CFG_USE_HEAP TRUE
295
296/**
297 * @brief Memory Pools Allocator APIs.
298 * @details If enabled then the memory pools allocator APIs are included
299 * in the kernel.
300 *
301 * @note The default is @p TRUE.
302 */
303#define CH_CFG_USE_MEMPOOLS TRUE
304
305/**
306 * @brief Dynamic Threads APIs.
307 * @details If enabled then the dynamic threads creation APIs are included
308 * in the kernel.
309 *
310 * @note The default is @p TRUE.
311 * @note Requires @p CH_CFG_USE_WAITEXIT.
312 * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
313 */
314#define CH_CFG_USE_DYNAMIC TRUE
315
316/** @} */
317
318/*===========================================================================*/
319/**
320 * @name Debug options
321 * @{
322 */
323/*===========================================================================*/
324
325/**
326 * @brief Debug option, kernel statistics.
327 *
328 * @note The default is @p FALSE.
329 */
330#define CH_DBG_STATISTICS FALSE
331
332/**
333 * @brief Debug option, system state check.
334 * @details If enabled the correct call protocol for system APIs is checked
335 * at runtime.
336 *
337 * @note The default is @p FALSE.
338 */
339#define CH_DBG_SYSTEM_STATE_CHECK FALSE
340
341/**
342 * @brief Debug option, parameters checks.
343 * @details If enabled then the checks on the API functions input
344 * parameters are activated.
345 *
346 * @note The default is @p FALSE.
347 */
348#define CH_DBG_ENABLE_CHECKS FALSE
349
350/**
351 * @brief Debug option, consistency checks.
352 * @details If enabled then all the assertions in the kernel code are
353 * activated. This includes consistency checks inside the kernel,
354 * runtime anomalies and port-defined checks.
355 *
356 * @note The default is @p FALSE.
357 */
358#define CH_DBG_ENABLE_ASSERTS FALSE
359
360/**
361 * @brief Debug option, trace buffer.
362 * @details If enabled then the context switch circular trace buffer is
363 * activated.
364 *
365 * @note The default is @p FALSE.
366 */
367#define CH_DBG_ENABLE_TRACE FALSE
368
369/**
370 * @brief Debug option, stack checks.
371 * @details If enabled then a runtime stack check is performed.
372 *
373 * @note The default is @p FALSE.
374 * @note The stack check is performed in a architecture/port dependent way.
375 * It may not be implemented or some ports.
376 * @note The default failure mode is to halt the system with the global
377 * @p panic_msg variable set to @p NULL.
378 */
379#define CH_DBG_ENABLE_STACK_CHECK FALSE
380
381/**
382 * @brief Debug option, stacks initialization.
383 * @details If enabled then the threads working area is filled with a byte
384 * value when a thread is created. This can be useful for the
385 * runtime measurement of the used stack.
386 *
387 * @note The default is @p FALSE.
388 */
389#define CH_DBG_FILL_THREADS FALSE
390
391/**
392 * @brief Debug option, threads profiling.
393 * @details If enabled then a field is added to the @p thread_t structure that
394 * counts the system ticks occurred while executing the thread.
395 *
396 * @note The default is @p FALSE.
397 * @note This debug option is not currently compatible with the
398 * tickless mode.
399 */
400#define CH_DBG_THREADS_PROFILING FALSE
401
402/** @} */
403
404/*===========================================================================*/
405/**
406 * @name Kernel hooks
407 * @{
408 */
409/*===========================================================================*/
410
411/**
412 * @brief Threads descriptor structure extension.
413 * @details User fields added to the end of the @p thread_t structure.
414 */
415#define CH_CFG_THREAD_EXTRA_FIELDS \
416 /* Add threads custom fields here.*/
417
418/**
419 * @brief Threads initialization hook.
420 * @details User initialization code added to the @p chThdInit() API.
421 *
422 * @note It is invoked from within @p chThdInit() and implicitly from all
423 * the threads creation APIs.
424 */
425#define CH_CFG_THREAD_INIT_HOOK(tp) { \
426 /* Add threads initialization code here.*/ \
427}
428
429/**
430 * @brief Threads finalization hook.
431 * @details User finalization code added to the @p chThdExit() API.
432 *
433 * @note It is inserted into lock zone.
434 * @note It is also invoked when the threads simply return in order to
435 * terminate.
436 */
437#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
438 /* Add threads finalization code here.*/ \
439}
440
441/**
442 * @brief Context switch hook.
443 * @details This hook is invoked just before switching between threads.
444 */
445#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
446 /* Context switch code here.*/ \
447}
448
449/**
450 * @brief ISR enter hook.
451 */
452#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
453 /* IRQ prologue code here.*/ \
454}
455
456/**
457 * @brief ISR exit hook.
458 */
459#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
460 /* IRQ epilogue code here.*/ \
461}
462
463/**
464 * @brief Idle thread enter hook.
465 * @note This hook is invoked within a critical zone, no OS functions
466 * should be invoked from here.
467 * @note This macro can be used to activate a power saving mode.
468 */
469#define CH_CFG_IDLE_ENTER_HOOK() { \
470}
471
472/**
473 * @brief Idle thread leave hook.
474 * @note This hook is invoked within a critical zone, no OS functions
475 * should be invoked from here.
476 * @note This macro can be used to deactivate a power saving mode.
477 */
478#define CH_CFG_IDLE_LEAVE_HOOK() { \
479}
480
481/**
482 * @brief Idle Loop hook.
483 * @details This hook is continuously invoked by the idle thread loop.
484 */
485#define CH_CFG_IDLE_LOOP_HOOK() { \
486 /* Idle loop code here.*/ \
487}
488
489/**
490 * @brief System tick event hook.
491 * @details This hook is invoked in the system tick handler immediately
492 * after processing the virtual timers queue.
493 */
494#define CH_CFG_SYSTEM_TICK_HOOK() { \
495 /* System tick event code here.*/ \
496}
497
498/**
499 * @brief System halt hook.
500 * @details This hook is invoked in case to a system halting error before
501 * the system is halted.
502 */
503#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
504 /* System halt code here.*/ \
505}
506
507/**
508 * @brief Trace hook.
509 * @details This hook is invoked each time a new record is written in the
510 * trace buffer.
511 */
512#define CH_CFG_TRACE_HOOK(tep) { \
513 /* Trace code here.*/ \
514}
515
516/** @} */
517
518/*===========================================================================*/
519/* Port-specific settings (override port settings defaulted in chcore.h). */
520/*===========================================================================*/
521
522#endif /* _CHCONF_H_ */
523
524/** @} */
diff --git a/keyboards/infinity_ergodox/config.h b/keyboards/infinity_ergodox/config.h
new file mode 100644
index 000000000..d24ee0f05
--- /dev/null
+++ b/keyboards/infinity_ergodox/config.h
@@ -0,0 +1,80 @@
1/*
2Copyright 2015 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19#define CONFIG_H
20
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x6464
25#define DEVICE_VER 0x0001
26/* in python2: list(u"whatever".encode('utf-16-le')) */
27/* at most 32 characters or the ugly hack in usb_main.c borks */
28#define MANUFACTURER "TMK"
29#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00'
30#define PRODUCT "Infinity keyboard/TMK"
31#define USBSTR_PRODUCT 'I', '\x00', 'n', '\x00', 'f', '\x00', 'i', '\x00', 'n', '\x00', 'i', '\x00', 't', '\x00', 'y', '\x00', ' ', '\x00', 'k', '\x00', 'e', '\x00', 'y', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', '/', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00'
32
33/* key matrix size */
34#define MATRIX_ROWS 18
35#define MATRIX_COLS 5
36#define LOCAL_MATRIX_ROWS 9
37
38/* define if matrix has ghost */
39//#define MATRIX_HAS_GHOST
40
41/* Set 0 if debouncing isn't needed */
42#define DEBOUNCE 5
43
44/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
45//#define LOCKING_SUPPORT_ENABLE
46/* Locking resynchronize hack */
47//#define LOCKING_RESYNC_ENABLE
48
49/* key combination for command */
50#define IS_COMMAND() ( \
51 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
52)
53
54/* Keymap for Infiity prototype */
55#define INFINITY_PROTOTYPE
56
57#define SERIAL_LINK_BAUD 562500
58#define SERIAL_LINK_THREAD_PRIORITY (NORMALPRIO - 1)
59// The visualizer needs gfx thread priorities
60#define VISUALIZER_THREAD_PRIORITY (NORMAL_PRIORITY - 2)
61
62/*
63 * Feature disable options
64 * These options are also useful to firmware size reduction.
65 */
66
67/* disable debug print */
68//#define NO_DEBUG
69
70/* disable print */
71//#define NO_PRINT
72
73/* disable action features */
74//#define NO_ACTION_LAYER
75//#define NO_ACTION_TAPPING
76//#define NO_ACTION_ONESHOT
77//#define NO_ACTION_MACRO
78//#define NO_ACTION_FUNCTION
79
80#endif
diff --git a/keyboards/infinity_ergodox/halconf.h b/keyboards/infinity_ergodox/halconf.h
new file mode 100644
index 000000000..55dd5e88d
--- /dev/null
+++ b/keyboards/infinity_ergodox/halconf.h
@@ -0,0 +1,353 @@
1/*
2 ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/halconf.h
19 * @brief HAL configuration header.
20 * @details HAL configuration file, this file allows to enable or disable the
21 * various device drivers from your application. You may also use
22 * this file in order to override the device drivers default settings.
23 *
24 * @addtogroup HAL_CONF
25 * @{
26 */
27
28#ifndef _HALCONF_H_
29#define _HALCONF_H_
30
31#include "mcuconf.h"
32
33/**
34 * @brief Enables the PAL subsystem.
35 */
36#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
37#define HAL_USE_PAL TRUE
38#endif
39
40/**
41 * @brief Enables the ADC subsystem.
42 */
43#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
44#define HAL_USE_ADC FALSE
45#endif
46
47/**
48 * @brief Enables the CAN subsystem.
49 */
50#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
51#define HAL_USE_CAN FALSE
52#endif
53
54/**
55 * @brief Enables the DAC subsystem.
56 */
57#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
58#define HAL_USE_DAC FALSE
59#endif
60
61/**
62 * @brief Enables the EXT subsystem.
63 */
64#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
65#define HAL_USE_EXT FALSE
66#endif
67
68/**
69 * @brief Enables the GPT subsystem.
70 */
71#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
72#define HAL_USE_GPT FALSE
73#endif
74
75/**
76 * @brief Enables the I2C subsystem.
77 */
78#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
79#define HAL_USE_I2C TRUE
80#endif
81
82/**
83 * @brief Enables the I2S subsystem.
84 */
85#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
86#define HAL_USE_I2S FALSE
87#endif
88
89/**
90 * @brief Enables the ICU subsystem.
91 */
92#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
93#define HAL_USE_ICU FALSE
94#endif
95
96/**
97 * @brief Enables the MAC subsystem.
98 */
99#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
100#define HAL_USE_MAC FALSE
101#endif
102
103/**
104 * @brief Enables the MMC_SPI subsystem.
105 */
106#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
107#define HAL_USE_MMC_SPI FALSE
108#endif
109
110/**
111 * @brief Enables the PWM subsystem.
112 */
113#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
114#define HAL_USE_PWM FALSE
115#endif
116
117/**
118 * @brief Enables the RTC subsystem.
119 */
120#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
121#define HAL_USE_RTC FALSE
122#endif
123
124/**
125 * @brief Enables the SDC subsystem.
126 */
127#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
128#define HAL_USE_SDC FALSE
129#endif
130
131/**
132 * @brief Enables the SERIAL subsystem.
133 */
134#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
135#define HAL_USE_SERIAL TRUE
136#endif
137
138/**
139 * @brief Enables the SERIAL over USB subsystem.
140 */
141#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
142#define HAL_USE_SERIAL_USB TRUE
143#endif
144
145/**
146 * @brief Enables the SPI subsystem.
147 */
148#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
149#define HAL_USE_SPI TRUE
150#endif
151
152/**
153 * @brief Enables the UART subsystem.
154 */
155#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
156#define HAL_USE_UART FALSE
157#endif
158
159/**
160 * @brief Enables the USB subsystem.
161 */
162#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
163#define HAL_USE_USB TRUE
164#endif
165
166/**
167 * @brief Enables the WDG subsystem.
168 */
169#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
170#define HAL_USE_WDG FALSE
171#endif
172
173/*===========================================================================*/
174/* ADC driver related settings. */
175/*===========================================================================*/
176
177/**
178 * @brief Enables synchronous APIs.
179 * @note Disabling this option saves both code and data space.
180 */
181#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
182#define ADC_USE_WAIT TRUE
183#endif
184
185/**
186 * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
187 * @note Disabling this option saves both code and data space.
188 */
189#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
190#define ADC_USE_MUTUAL_EXCLUSION TRUE
191#endif
192
193/*===========================================================================*/
194/* CAN driver related settings. */
195/*===========================================================================*/
196
197/**
198 * @brief Sleep mode related APIs inclusion switch.
199 */
200#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
201#define CAN_USE_SLEEP_MODE TRUE
202#endif
203
204/*===========================================================================*/
205/* I2C driver related settings. */
206/*===========================================================================*/
207
208/**
209 * @brief Enables the mutual exclusion APIs on the I2C bus.
210 */
211#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
212#define I2C_USE_MUTUAL_EXCLUSION TRUE
213#endif
214
215/*===========================================================================*/
216/* MAC driver related settings. */
217/*===========================================================================*/
218
219/**
220 * @brief Enables an event sources for incoming packets.
221 */
222#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
223#define MAC_USE_ZERO_COPY FALSE
224#endif
225
226/**
227 * @brief Enables an event sources for incoming packets.
228 */
229#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
230#define MAC_USE_EVENTS TRUE
231#endif
232
233/*===========================================================================*/
234/* MMC_SPI driver related settings. */
235/*===========================================================================*/
236
237/**
238 * @brief Delays insertions.
239 * @details If enabled this options inserts delays into the MMC waiting
240 * routines releasing some extra CPU time for the threads with
241 * lower priority, this may slow down the driver a bit however.
242 * This option is recommended also if the SPI driver does not
243 * use a DMA channel and heavily loads the CPU.
244 */
245#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
246#define MMC_NICE_WAITING TRUE
247#endif
248
249/*===========================================================================*/
250/* SDC driver related settings. */
251/*===========================================================================*/
252
253/**
254 * @brief Number of initialization attempts before rejecting the card.
255 * @note Attempts are performed at 10mS intervals.
256 */
257#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
258#define SDC_INIT_RETRY 100
259#endif
260
261/**
262 * @brief Include support for MMC cards.
263 * @note MMC support is not yet implemented so this option must be kept
264 * at @p FALSE.
265 */
266#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
267#define SDC_MMC_SUPPORT FALSE
268#endif
269
270/**
271 * @brief Delays insertions.
272 * @details If enabled this options inserts delays into the MMC waiting
273 * routines releasing some extra CPU time for the threads with
274 * lower priority, this may slow down the driver a bit however.
275 */
276#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
277#define SDC_NICE_WAITING TRUE
278#endif
279
280/*===========================================================================*/
281/* SERIAL driver related settings. */
282/*===========================================================================*/
283
284/**
285 * @brief Default bit rate.
286 * @details Configuration parameter, this is the baud rate selected for the
287 * default configuration.
288 */
289#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
290#define SERIAL_DEFAULT_BITRATE 38400
291#endif
292
293/**
294 * @brief Serial buffers size.
295 * @details Configuration parameter, you can change the depth of the queue
296 * buffers depending on the requirements of your application.
297 * @note The default is 64 bytes for both the transmission and receive
298 * buffers.
299 */
300#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
301#define SERIAL_BUFFERS_SIZE 128
302#endif
303
304/*===========================================================================*/
305/* SERIAL_USB driver related setting. */
306/*===========================================================================*/
307
308/**
309 * @brief Serial over USB buffers size.
310 * @details Configuration parameter, the buffer size must be a multiple of
311 * the USB data endpoint maximum packet size.
312 * @note The default is 64 bytes for both the transmission and receive
313 * buffers.
314 */
315#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
316#define SERIAL_USB_BUFFERS_SIZE 256
317#endif
318
319/*===========================================================================*/
320/* SPI driver related settings. */
321/*===========================================================================*/
322
323/**
324 * @brief Enables synchronous APIs.
325 * @note Disabling this option saves both code and data space.
326 */
327#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
328#define SPI_USE_WAIT TRUE
329#endif
330
331/**
332 * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
333 * @note Disabling this option saves both code and data space.
334 */
335#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
336#define SPI_USE_MUTUAL_EXCLUSION TRUE
337#endif
338
339/*===========================================================================*/
340/* USB driver related settings. */
341/*===========================================================================*/
342
343/**
344 * @brief Enables synchronous APIs.
345 * @note Disabling this option saves both code and data space.
346 */
347#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
348#define USB_USE_WAIT TRUE
349#endif
350
351#endif /* _HALCONF_H_ */
352
353/** @} */
diff --git a/keyboards/infinity_ergodox/infinity_ergodox.c b/keyboards/infinity_ergodox/infinity_ergodox.c
new file mode 100644
index 000000000..34aded1a7
--- /dev/null
+++ b/keyboards/infinity_ergodox/infinity_ergodox.c
@@ -0,0 +1 @@
#include "infinity_ergodox.h"
diff --git a/keyboards/infinity_ergodox/infinity_ergodox.h b/keyboards/infinity_ergodox/infinity_ergodox.h
new file mode 100644
index 000000000..de7267594
--- /dev/null
+++ b/keyboards/infinity_ergodox/infinity_ergodox.h
@@ -0,0 +1,44 @@
1#ifndef KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_
2#define KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_
3
4#include "quantum.h"
5
6#define KEYMAP( \
7 A80, A70, A60, A50, A40, A30, A20, \
8 A81, A71, A61, A51, A41, A31, A21, \
9 A82, A72, A62, A52, A42, A32, \
10 A83, A73, A63, A53, A43, A33, A23, \
11 A84, A74, A64, A54, A44, \
12 A13, A03, \
13 A04, \
14 A34, A24, A14, \
15 B20, B30, B40, B50, B60, B70, B80, \
16 B21, B31, B41, B51, B61, B71, B81, \
17 B32, B42, B52, B62, B72, B82, \
18 B23, B33, B43, B53, B63, B73, B83, \
19 B44, B54, B64, B74, B84, \
20 B03, B13, \
21 B04, \
22 B14, B24, B34 \
23) { \
24 { KC_NO, KC_NO, KC_NO, KC_##A03, KC_##A04 }, \
25 { KC_NO, KC_NO, KC_NO, KC_##A13, KC_##A14 }, \
26 { KC_##A20, KC_##A21, KC_NO, KC_##A23, KC_##A24 }, \
27 { KC_##A30, KC_##A31, KC_##A32, KC_##A33, KC_##A34 }, \
28 { KC_##A40, KC_##A41, KC_##A42, KC_##A43, KC_##A44 }, \
29 { KC_##A50, KC_##A51, KC_##A52, KC_##A53, KC_##A54 }, \
30 { KC_##A60, KC_##A61, KC_##A62, KC_##A63, KC_##A64 }, \
31 { KC_##A70, KC_##A71, KC_##A72, KC_##A73, KC_##A74 }, \
32 { KC_##A80, KC_##A81, KC_##A82, KC_##A83, KC_##A84 }, \
33 { KC_NO, KC_NO, KC_NO, KC_##B03, KC_##B04 }, \
34 { KC_NO, KC_NO, KC_NO, KC_##B13, KC_##B14 }, \
35 { KC_##B20, KC_##B21, KC_NO, KC_##B23, KC_##B24 }, \
36 { KC_##B30, KC_##B31, KC_##B32, KC_##B33, KC_##B34 }, \
37 { KC_##B40, KC_##B41, KC_##B42, KC_##B43, KC_##B44 }, \
38 { KC_##B50, KC_##B51, KC_##B52, KC_##B53, KC_##B54 }, \
39 { KC_##B60, KC_##B61, KC_##B62, KC_##B63, KC_##B64 }, \
40 { KC_##B70, KC_##B71, KC_##B72, KC_##B73, KC_##B74 }, \
41 { KC_##B80, KC_##B81, KC_##B82, KC_##B83, KC_##B84 } \
42}
43
44#endif /* KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ */
diff --git a/keyboards/infinity_ergodox/keymaps/default/keymap.c b/keyboards/infinity_ergodox/keymaps/default/keymap.c
new file mode 100644
index 000000000..c33fb7b92
--- /dev/null
+++ b/keyboards/infinity_ergodox/keymaps/default/keymap.c
@@ -0,0 +1,111 @@
1/*
2Copyright 2016 Fred Sundvik <fsundvik@gmail.com>
3Jun Wako <wakojun@gmail.com>
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#include "infinity_ergodox.h"
20
21const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
22 KEYMAP( // layer 0 : default
23 // left hand
24 EQL, 1, 2, 3, 4, 5, ESC,
25 BSLS,Q, W, E, R, T, FN1,
26 TAB, A, S, D, F, G,
27 LSFT,Z, X, C, V, B, FN0,
28 LGUI,GRV, BSLS,LEFT,RGHT,
29 LCTL,LALT,
30 HOME,
31 BSPC,DEL, END,
32 // right hand
33 FN2, 6, 7, 8, 9, 0, MINS,
34 LBRC,Y, U, I, O, P, RBRC,
35 H, J, K, L, SCLN,QUOT,
36 FN0, N, M, COMM,DOT, SLSH,RSFT,
37 LEFT,DOWN,UP, RGHT,RGUI,
38 RALT,RCTL,
39 PGUP,
40 PGDN,ENT, SPC
41 ),
42
43 KEYMAP( // layer 1 : function and symbol keys
44 // left hand
45 TRNS,F1, F2, F3, F4, F5, F11,
46 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN3,
47 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
48 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
49 TRNS,TRNS,TRNS,TRNS,TRNS,
50 TRNS,TRNS,
51 TRNS,
52 TRNS,TRNS,TRNS,
53 // right hand
54 F12, F6, F7, F8, F9, F10, TRNS,
55 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
56 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
57 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
58 TRNS,TRNS,TRNS,TRNS,TRNS,
59 TRNS,TRNS,
60 TRNS,
61 TRNS,TRNS,TRNS
62 ),
63
64 KEYMAP( // layer 2 : keyboard functions
65 // left hand
66 BTLD,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
67 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, FN3,
68 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
69 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
70 TRNS,TRNS,TRNS,TRNS,TRNS,
71 TRNS,TRNS,
72 TRNS,
73 TRNS,TRNS,TRNS,
74 // right hand
75 TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
76 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
77 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
78 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
79 TRNS,TRNS,TRNS,TRNS,TRNS,
80 TRNS,TRNS,
81 TRNS,
82 TRNS,TRNS,TRNS
83 ),
84
85 KEYMAP( // layer 3: numpad
86 // left hand
87 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
88 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
89 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
90 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
91 TRNS,TRNS,TRNS,TRNS,TRNS,
92 TRNS,TRNS,
93 TRNS,
94 TRNS,TRNS,TRNS,
95 // right hand
96 TRNS,NLCK,PSLS,PAST,PAST,PMNS,BSPC,
97 TRNS,NO, P7, P8, P9, PMNS,BSPC,
98 NO, P4, P5, P6, PPLS,PENT,
99 TRNS,NO, P1, P2, P3, PPLS,PENT,
100 P0, PDOT,SLSH,PENT,PENT,
101 TRNS,TRNS,
102 TRNS,
103 TRNS,TRNS,TRNS
104 ),
105};
106const uint16_t fn_actions[] = {
107 ACTION_LAYER_MOMENTARY(1), // FN0 - switch to Layer1
108 ACTION_LAYER_SET(2, ON_PRESS), // FN1 - set Layer2
109 ACTION_LAYER_TOGGLE(3), // FN2 - toggle Layer3 aka Numpad layer
110 ACTION_LAYER_SET(0, ON_PRESS), // FN3 - set Layer0
111};
diff --git a/keyboards/infinity_ergodox/led.c b/keyboards/infinity_ergodox/led.c
new file mode 100644
index 000000000..77195bb35
--- /dev/null
+++ b/keyboards/infinity_ergodox/led.c
@@ -0,0 +1,49 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include "hal.h"
19
20#include "led.h"
21
22
23void led_set(uint8_t usb_led) {
24// The LCD backlight functionality conflicts with this simple
25// red backlight
26#if !defined(LCD_BACKLIGHT_ENABLE) && defined(STATUS_LED_ENABLE)
27 // PTC1: LCD Backlight Red(0:on/1:off)
28 GPIOC->PDDR |= (1<<1);
29 PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
30 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
31 GPIOC->PCOR |= (1<<1);
32 } else {
33 GPIOC->PSOR |= (1<<1);
34 }
35#elif !defined(LCD_BACKLIGHT_ENABLE)
36 (void)usb_led;
37 GPIOC->PDDR |= (1<<1);
38 PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
39 GPIOC->PSOR |= (1<<1);
40 GPIOC->PDDR |= (1<<2);
41 PORTC->PCR[2] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
42 GPIOC->PSOR |= (1<<2);
43 GPIOC->PDDR |= (1<<3);
44 PORTC->PCR[3] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
45 GPIOC->PSOR |= (1<<3);
46#else
47 (void)usb_led;
48#endif
49}
diff --git a/keyboards/infinity_ergodox/matrix.c b/keyboards/infinity_ergodox/matrix.c
new file mode 100644
index 000000000..2b806cd64
--- /dev/null
+++ b/keyboards/infinity_ergodox/matrix.c
@@ -0,0 +1,169 @@
1/*
2Copyright 2016 Fred Sundvik <fsundvik@gmail.com>
3Jun Wako <wakojun@gmail.com>
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18#include <stdint.h>
19#include <stdbool.h>
20#include <string.h>
21#include "hal.h"
22#include "timer.h"
23#include "wait.h"
24#include "print.h"
25#include "debug.h"
26#include "matrix.h"
27
28
29/*
30 * Infinity ErgoDox Pinusage:
31 * Column pins are input with internal pull-down. Row pins are output and strobe with high.
32 * Key is high or 1 when it turns on.
33 *
34 * col: { PTD1, PTD4, PTD5, PTD6, PTD7 }
35 * row: { PTB2, PTB3, PTB18, PTB19, PTC0, PTC9, PTC10, PTC11, PTD0 }
36 */
37/* matrix state(1:on, 0:off) */
38static matrix_row_t matrix[MATRIX_ROWS];
39static matrix_row_t matrix_debouncing[LOCAL_MATRIX_ROWS];
40static bool debouncing = false;
41static uint16_t debouncing_time = 0;
42
43
44void matrix_init(void)
45{
46 /* Column(sense) */
47 palSetPadMode(GPIOD, 1, PAL_MODE_INPUT_PULLDOWN);
48 palSetPadMode(GPIOD, 4, PAL_MODE_INPUT_PULLDOWN);
49 palSetPadMode(GPIOD, 5, PAL_MODE_INPUT_PULLDOWN);
50 palSetPadMode(GPIOD, 6, PAL_MODE_INPUT_PULLDOWN);
51 palSetPadMode(GPIOD, 7, PAL_MODE_INPUT_PULLDOWN);
52
53 /* Row(strobe) */
54 palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL);
55 palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL);
56 palSetPadMode(GPIOB, 18, PAL_MODE_OUTPUT_PUSHPULL);
57 palSetPadMode(GPIOB, 19, PAL_MODE_OUTPUT_PUSHPULL);
58 palSetPadMode(GPIOC, 0, PAL_MODE_OUTPUT_PUSHPULL);
59 palSetPadMode(GPIOC, 9, PAL_MODE_OUTPUT_PUSHPULL);
60 palSetPadMode(GPIOC, 10, PAL_MODE_OUTPUT_PUSHPULL);
61 palSetPadMode(GPIOC, 11, PAL_MODE_OUTPUT_PUSHPULL);
62 palSetPadMode(GPIOD, 0, PAL_MODE_OUTPUT_PUSHPULL);
63
64 memset(matrix, 0, MATRIX_ROWS);
65 memset(matrix_debouncing, 0, LOCAL_MATRIX_ROWS);
66}
67
68uint8_t matrix_scan(void)
69{
70 for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) {
71 matrix_row_t data = 0;
72
73 // strobe row
74 switch (row) {
75 case 0: palSetPad(GPIOB, 2); break;
76 case 1: palSetPad(GPIOB, 3); break;
77 case 2: palSetPad(GPIOB, 18); break;
78 case 3: palSetPad(GPIOB, 19); break;
79 case 4: palSetPad(GPIOC, 0); break;
80 case 5: palSetPad(GPIOC, 9); break;
81 case 6: palSetPad(GPIOC, 10); break;
82 case 7: palSetPad(GPIOC, 11); break;
83 case 8: palSetPad(GPIOD, 0); break;
84 }
85
86 // need wait to settle pin state
87 // if you wait too short, or have a too high update rate
88 // the keyboard might freeze, or there might not be enough
89 // processing power to update the LCD screen properly.
90 // 20us, or two ticks at 100000Hz seems to be OK
91 wait_us(20);
92
93 // read col data: { PTD1, PTD4, PTD5, PTD6, PTD7 }
94 data = ((palReadPort(GPIOD) & 0xF0) >> 3) |
95 ((palReadPort(GPIOD) & 0x02) >> 1);
96
97 // un-strobe row
98 switch (row) {
99 case 0: palClearPad(GPIOB, 2); break;
100 case 1: palClearPad(GPIOB, 3); break;
101 case 2: palClearPad(GPIOB, 18); break;
102 case 3: palClearPad(GPIOB, 19); break;
103 case 4: palClearPad(GPIOC, 0); break;
104 case 5: palClearPad(GPIOC, 9); break;
105 case 6: palClearPad(GPIOC, 10); break;
106 case 7: palClearPad(GPIOC, 11); break;
107 case 8: palClearPad(GPIOD, 0); break;
108 }
109
110 if (matrix_debouncing[row] != data) {
111 matrix_debouncing[row] = data;
112 debouncing = true;
113 debouncing_time = timer_read();
114 }
115 }
116
117 uint8_t offset = 0;
118#ifdef MASTER_IS_ON_RIGHT
119 if (is_serial_link_master()) {
120 offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS;
121 }
122#endif
123
124 if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
125 for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) {
126 matrix[offset + row] = matrix_debouncing[row];
127 }
128 debouncing = false;
129 }
130 return 1;
131}
132
133bool matrix_is_on(uint8_t row, uint8_t col)
134{
135 return (matrix[row] & (1<<col));
136}
137
138matrix_row_t matrix_get_row(uint8_t row)
139{
140 return matrix[row];
141}
142
143void matrix_print(void)
144{
145 xprintf("\nr/c 01234567\n");
146 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
147 xprintf("%X0: ", row);
148 matrix_row_t data = matrix_get_row(row);
149 for (int col = 0; col < MATRIX_COLS; col++) {
150 if (data & (1<<col))
151 xprintf("1");
152 else
153 xprintf("0");
154 }
155 xprintf("\n");
156 }
157}
158
159void matrix_set_remote(matrix_row_t* rows, uint8_t index) {
160 uint8_t offset = 0;
161#ifdef MASTER_IS_ON_RIGHT
162 offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS * (index + 2);
163#else
164 offset = LOCAL_MATRIX_ROWS * (index + 1);
165#endif
166 for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) {
167 matrix[offset + row] = rows[row];
168 }
169}
diff --git a/keyboards/infinity_ergodox/mcuconf.h b/keyboards/infinity_ergodox/mcuconf.h
new file mode 100644
index 000000000..f6730b99c
--- /dev/null
+++ b/keyboards/infinity_ergodox/mcuconf.h
@@ -0,0 +1,74 @@
1/*
2 ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#ifndef _MCUCONF_H_
18#define _MCUCONF_H_
19
20#define K20x_MCUCONF
21
22/*
23 * HAL driver system settings.
24 */
25
26#define K20x7
27
28/* Select the MCU clocking mode below by enabling the appropriate block. */
29
30#define KINETIS_NO_INIT FALSE
31
32/* PEE mode - 48MHz system clock driven by external crystal. */
33#define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE
34#define KINETIS_PLLCLK_FREQUENCY 72000000UL
35#define KINETIS_SYSCLK_FREQUENCY 72000000UL
36#define KINETIS_BUSCLK_FREQUENCY 36000000UL
37#define KINETIS_FLASHCLK_FREQUENCY 24000000UL
38
39#if 0
40/* FEI mode - 48 MHz with internal 32.768 kHz crystal */
41#define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI
42#define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */
43#define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */
44#define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */
45#define KINETIS_CLKDIV1_OUTDIV1 1
46#define KINETIS_CLKDIV1_OUTDIV2 1
47#define KINETIS_CLKDIV1_OUTDIV4 2
48#define KINETIS_BUSCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY
49#define KINETIS_FLASHCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY/2
50#endif
51
52/*
53 * SERIAL driver system settings.
54 */
55#define KINETIS_SERIAL_USE_UART0 TRUE
56#define KINETIS_SERIAL_USE_UART1 TRUE
57
58/*
59 * USB driver settings
60 */
61#define KINETIS_USB_USE_USB0 TRUE
62/* Need to redefine this, since the default is for K20x */
63/* This is for Teensy LC; you should comment it out (or change to 5)
64 * for Teensy 3.x */
65#define KINETIS_USB_USB0_IRQ_PRIORITY 2
66
67/*
68 * SPI driver system settings.
69 */
70#define KINETIS_SPI_USE_SPI0 TRUE
71
72#define KINETIS_I2C_USE_I2C0 TRUE
73
74#endif /* _MCUCONF_H_ */
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk
index 72be5e6da..3bf2b34f8 100644
--- a/tmk_core/avr.mk
+++ b/tmk_core/avr.mk
@@ -10,6 +10,7 @@ AR = avr-ar rcs
10NM = avr-nm 10NM = avr-nm
11HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature 11HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature
12EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) 12EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT)
13BIN =
13 14
14 15
15 16
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index 0abb933a8..cb67ac6f2 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -113,6 +113,7 @@ AR = arm-none-eabi-ar
113NM = arm-none-eabi-nm 113NM = arm-none-eabi-nm
114HEX = $(OBJCOPY) -O $(FORMAT) 114HEX = $(OBJCOPY) -O $(FORMAT)
115EEP = 115EEP =
116BIN = $(OBJCOPY) -O binary
116 117
117THUMBFLAGS = -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb -DTHUMB 118THUMBFLAGS = -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb -DTHUMB
118 119
@@ -151,4 +152,7 @@ else ifneq ("$(wildcard $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h)","")
151endif 152endif
152 153
153# List any extra directories to look for libraries here. 154# List any extra directories to look for libraries here.
154EXTRALIBDIRS = $(RULESPATH)/ld \ No newline at end of file 155EXTRALIBDIRS = $(RULESPATH)/ld
156
157dfu-util: $(BUILD_DIR)/$(TARGET).bin sizeafter
158 dfu-util -D $(BUILD_DIR)/$(TARGET).bin \ No newline at end of file
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index 7d3d8f9a6..352e9314b 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -234,6 +234,7 @@ MSG_COFF = Converting to AVR COFF:
234MSG_EXTENDED_COFF = Converting to AVR Extended COFF: 234MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
235MSG_FLASH = Creating load file for Flash: 235MSG_FLASH = Creating load file for Flash:
236MSG_EEPROM = Creating load file for EEPROM: 236MSG_EEPROM = Creating load file for EEPROM:
237MSG_BIN = Creating binary load file for Flash:
237MSG_EXTENDED_LISTING = Creating Extended Listing: 238MSG_EXTENDED_LISTING = Creating Extended Listing:
238MSG_SYMBOL_TABLE = Creating Symbol Table: 239MSG_SYMBOL_TABLE = Creating Symbol Table:
239MSG_LINKING = Linking: 240MSG_LINKING = Linking:
@@ -369,6 +370,11 @@ gccversion :
369 $(eval CMD=$(NM) -n $< > $@ ) 370 $(eval CMD=$(NM) -n $< > $@ )
370 @$(BUILD_CMD) 371 @$(BUILD_CMD)
371 372
373%.bin: %.elf
374 @$(SILENT) || printf "$(MSG_BIN) $@" | $(AWK_CMD)
375 $(eval CMD=$(BIN) $< $@ || exit 0)
376 @$(BUILD_CMD)
377
372# Create library from object files. 378# Create library from object files.
373.SECONDARY : $(BUILD_DIR)/$(TARGET).a 379.SECONDARY : $(BUILD_DIR)/$(TARGET).a
374.PRECIOUS : $(OBJ) 380.PRECIOUS : $(OBJ)