aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2021-06-20 12:03:11 +1000
committerGitHub <noreply@github.com>2021-06-20 12:03:11 +1000
commit4dddcb4f0300f79d8fbfc462ff8d6b360e99989e (patch)
tree3b15a8ce14a9911b425a86cd36fd2afd302c3a25
parent11f66c317ab47a3f95b3278187392105cfe791d8 (diff)
downloadqmk_firmware-4dddcb4f0300f79d8fbfc462ff8d6b360e99989e.tar.gz
qmk_firmware-4dddcb4f0300f79d8fbfc462ff8d6b360e99989e.zip
Telophase cleanup (#13225)
-rw-r--r--keyboards/telophase/config.h53
-rw-r--r--keyboards/telophase/keymaps/default/keymap.c134
-rw-r--r--keyboards/telophase/matrix.c127
-rw-r--r--keyboards/telophase/readme.md13
-rw-r--r--keyboards/telophase/rules.mk39
-rw-r--r--keyboards/telophase/telophase.c44
-rw-r--r--keyboards/telophase/telophase.h77
7 files changed, 177 insertions, 310 deletions
diff --git a/keyboards/telophase/config.h b/keyboards/telophase/config.h
index c67dd939b..51718da9d 100644
--- a/keyboards/telophase/config.h
+++ b/keyboards/telophase/config.h
@@ -1,5 +1,5 @@
1/* 1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com> 2Copyright 2021
3 3
4This program is free software: you can redistribute it and/or modify 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 5it under the terms of the GNU General Public License as published by
@@ -15,32 +15,45 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#ifndef CONFIG_H 18#pragma once
19#define CONFIG_H
20 19
21#include "config_common.h" 20#include "config_common.h"
22 21
23/* USB Device descriptor parameter */ 22/* USB Device descriptor parameter */
24 23#define VENDOR_ID 0xFEED
25#define VENDOR_ID 0xFEED 24#define PRODUCT_ID 0x6060
26#define PRODUCT_ID 0x6060 25#define DEVICE_VER 0x0001
27#define DEVICE_VER 0x0001 26#define MANUFACTURER unknown
28#define MANUFACTURER unknown 27#define PRODUCT Telophase
29#define PRODUCT Telophase
30 28
31/* key matrix size */ 29/* key matrix size */
32#define MATRIX_ROWS 4 30#define MATRIX_ROWS 4
33#define MATRIX_COLS 12 31#define MATRIX_COLS 12
34 32
35/* define if matrix has ghost */
36//#define MATRIX_HAS_GHOST
37
38/* number of backlight levels */
39//#define BACKLIGHT_LEVELS 3
40
41#define ONESHOT_TIMEOUT 500 33#define ONESHOT_TIMEOUT 500
42 34
43/* 35/*
36 * Force NKRO
37 *
38 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
39 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
40 * makefile for this to work.)
41 *
42 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
43 * until the next keyboard reset.
44 *
45 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
46 * fully operational during normal computer usage.
47 *
48 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
49 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
50 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
51 * power-up.
52 *
53 */
54//#define FORCE_NKRO
55
56/*
44 * Feature disable options 57 * Feature disable options
45 * These options are also useful to firmware size reduction. 58 * These options are also useful to firmware size reduction.
46 */ 59 */
@@ -55,10 +68,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
55//#define NO_ACTION_LAYER 68//#define NO_ACTION_LAYER
56//#define NO_ACTION_TAPPING 69//#define NO_ACTION_TAPPING
57//#define NO_ACTION_ONESHOT 70//#define NO_ACTION_ONESHOT
58//#define NO_ACTION_MACRO
59//#define NO_ACTION_FUNCTION
60 71
61//UART settings for communication with the RF microcontroller 72/* disable these deprecated features by default */
73#define NO_ACTION_MACRO
74#define NO_ACTION_FUNCTION
75
76// UART settings for communication with the RF microcontroller
62#define SERIAL_UART_BAUD 1000000 77#define SERIAL_UART_BAUD 1000000
63#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) 78#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1))
64#define SERIAL_UART_INIT_CUSTOM \ 79#define SERIAL_UART_INIT_CUSTOM \
@@ -66,5 +81,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
66 UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ 81 UCSR1B = _BV(TXEN1) | _BV(RXEN1); \
67 /* 8-bit data */ \ 82 /* 8-bit data */ \
68 UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); 83 UCSR1C = _BV(UCSZ11) | _BV(UCSZ10);
69
70#endif
diff --git a/keyboards/telophase/keymaps/default/keymap.c b/keyboards/telophase/keymaps/default/keymap.c
index 9cc6c1bb0..163f754d4 100644
--- a/keyboards/telophase/keymaps/default/keymap.c
+++ b/keyboards/telophase/keymaps/default/keymap.c
@@ -1,99 +1,55 @@
1// this is the style you want to emulate. 1/*
2// This is the canonical layout file for the Quantum project. If you want to add another keyboard, 2Copyright 2021
3 3
4#include QMK_KEYBOARD_H 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.
5 8
6// Each layer gets a name for readability, which is then used in the keymap matrix below. 9This program is distributed in the hope that it will be useful,
7// The underscores don't mean anything - you can have a layer called STUFF or any other name. 10but WITHOUT ANY WARRANTY; without even the implied warranty of
8// Layer names don't all need to be of the same length, obviously, and you can also skip them 11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9// entirely and just use numbers. 12GNU General Public License for more details.
10enum telophase_layers 13
11{ 14You should have received a copy of the GNU General Public License
12 _QWERTY, 15along with this program. If not, see <http://www.gnu.org/licenses/>.
13 _LOWER, 16*/
14 _RAISE, 17
15 _ADJUST, 18#include QMK_KEYBOARD_H
16};
17 19
18enum telophase_keycodes 20enum layer_names {
19{ 21 _QWERTY,
20 LOWER = SAFE_RANGE, 22 _LOWER,
21 RAISE, 23 _RAISE,
22 ADJUST 24 _ADJUST
23}; 25};
24 26
25#define LONGPRESS_DELAY 150 27#define LONGPRESS_DELAY 150
26#define LAYER_TOGGLE_DELAY 300 28#define LAYER_TOGGLE_DELAY 300
27 29
28const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
29[_QWERTY] = { /*QWERTY*/ 31 [_QWERTY] = LAYOUT_ortho_4x12(
30 {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, 32 KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
31 {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT }, 33 KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
32 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, 34 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
33 {KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT } 35 KC_LCTL, KC_LGUI, KC_LALT, MO(_ADJUST), MO(_LOWER), KC_SPC, KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT
34}, 36 ),
35 37 [_LOWER] = LAYOUT_ortho_4x12(
36 38 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL,
37[_LOWER] = { /*Lower*/ 39 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
38 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, 40 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), _______, _______, _______,
39 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE }, 41 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
40 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______ }, 42 ),
41 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY } 43 [_RAISE] = LAYOUT_ortho_4x12(
42}, 44 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
43 45 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
44 46 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______,
45 47 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
46[_RAISE] = { /*Raise*/ 48 ),
47 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL }, 49 [_ADJUST] = LAYOUT_ortho_4x12(
48 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS }, 50 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
49 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______ }, 51 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
50 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY } 52 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
51 53 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
52}, 54 )
53
54
55[_ADJUST] = { /*Adjust*/
56 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
57 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
58 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
59 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
60
61},
62};
63
64bool process_record_user(uint16_t keycode, keyrecord_t *record) {
65 switch (keycode) {
66 case LOWER:
67 if (record->event.pressed) {
68 layer_on(_LOWER);
69 } else {
70 layer_off(_LOWER);
71 }
72 return false;
73 break;
74
75 case RAISE:
76 if (record->event.pressed) {
77 layer_on(_RAISE);
78 } else {
79 layer_off(_RAISE);
80 }
81 return false;
82 break;
83
84 case ADJUST:
85 if (record->event.pressed) {
86 layer_on(_ADJUST);
87 } else {
88 layer_off(_ADJUST);
89 }
90 return false;
91 break;
92
93 }
94 return true;
95}
96
97void matrix_scan_user(void) {
98 return;
99}; 55};
diff --git a/keyboards/telophase/matrix.c b/keyboards/telophase/matrix.c
index bc7a125e0..a153dd4bf 100644
--- a/keyboards/telophase/matrix.c
+++ b/keyboards/telophase/matrix.c
@@ -15,86 +15,18 @@ GNU General Public License for more details.
15You should have received a copy of the GNU General Public License 15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>. 16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
18#include <stdint.h> 18
19#include <stdbool.h> 19#include "quantum.h"
20#if defined(__AVR__)
21#include <avr/io.h>
22#endif
23#include "wait.h"
24#include "print.h"
25#include "debug.h"
26#include "util.h"
27#include "matrix.h" 20#include "matrix.h"
28#include "timer.h"
29#include "protocol/serial.h" 21#include "protocol/serial.h"
30 22
31#if (MATRIX_COLS <= 8) 23void matrix_init_custom(void) {
32# define print_matrix_header() print("\nr/c 01234567\n")
33# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
34# define matrix_bitpop(i) bitpop(matrix[i])
35# define ROW_SHIFTER ((uint8_t)1)
36#elif (MATRIX_COLS <= 16)
37# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
38# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
39# define matrix_bitpop(i) bitpop16(matrix[i])
40# define ROW_SHIFTER ((uint16_t)1)
41#elif (MATRIX_COLS <= 32)
42# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
43# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
44# define matrix_bitpop(i) bitpop32(matrix[i])
45# define ROW_SHIFTER ((uint32_t)1)
46#endif
47
48/* matrix state(1:on, 0:off) */
49static matrix_row_t matrix[MATRIX_ROWS];
50
51__attribute__ ((weak))
52void matrix_init_quantum(void) {
53 matrix_init_kb();
54}
55
56__attribute__ ((weak))
57void matrix_scan_quantum(void) {
58 matrix_scan_kb();
59}
60
61__attribute__ ((weak))
62void matrix_init_kb(void) {
63 matrix_init_user();
64}
65
66__attribute__ ((weak))
67void matrix_scan_kb(void) {
68 matrix_scan_user();
69}
70
71__attribute__ ((weak))
72void matrix_init_user(void) {
73}
74
75__attribute__ ((weak))
76void matrix_scan_user(void) {
77}
78
79inline
80uint8_t matrix_rows(void) {
81 return MATRIX_ROWS;
82}
83
84inline
85uint8_t matrix_cols(void) {
86 return MATRIX_COLS;
87}
88
89void matrix_init(void) {
90
91 matrix_init_quantum();
92 serial_init(); 24 serial_init();
93} 25}
94 26
95uint8_t matrix_scan(void) 27bool matrix_scan_custom(matrix_row_t current_matrix[]) {
96{
97 uint32_t timeout = 0; 28 uint32_t timeout = 0;
29 bool changed = false;
98 30
99 //the s character requests the RF slave to send the matrix 31 //the s character requests the RF slave to send the matrix
100 SERIAL_UART_DATA = 's'; 32 SERIAL_UART_DATA = 's';
@@ -107,9 +39,9 @@ uint8_t matrix_scan(void)
107 //wait for the serial data, timeout if it's been too long 39 //wait for the serial data, timeout if it's been too long
108 //this only happened in testing with a loose wire, but does no 40 //this only happened in testing with a loose wire, but does no
109 //harm to leave it in here 41 //harm to leave it in here
110 while(!SERIAL_UART_RXD_PRESENT){ 42 while (!SERIAL_UART_RXD_PRESENT) {
111 timeout++; 43 timeout++;
112 if (timeout > 10000){ 44 if (timeout > 10000) {
113 break; 45 break;
114 } 46 }
115 } 47 }
@@ -118,47 +50,16 @@ uint8_t matrix_scan(void)
118 50
119 //check for the end packet, the key state bytes use the LSBs, so 0xE0 51 //check for the end packet, the key state bytes use the LSBs, so 0xE0
120 //will only show up here if the correct bytes were recieved 52 //will only show up here if the correct bytes were recieved
121 if (uart_data[11] == 0xE0) 53 if (uart_data[11] == 0xE0) {
122 {
123 //shifting and transferring the keystates to the QMK matrix variable 54 //shifting and transferring the keystates to the QMK matrix variable
124 for (uint8_t i = 0; i < MATRIX_ROWS; i++) { 55 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
125 matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 6; 56 matrix_row_t current_row = (uint16_t) uart_data[i * 2] | (uint16_t) uart_data[i * 2 + 1] << 6;
57 if (current_matrix[i] != current_row) {
58 changed = true;
59 }
60 current_matrix[i] = current_row;
126 } 61 }
127 } 62 }
128 63
129 64 return changed;
130 matrix_scan_quantum();
131 return 1;
132}
133
134inline
135bool matrix_is_on(uint8_t row, uint8_t col)
136{
137 return (matrix[row] & ((matrix_row_t)1<<col));
138}
139
140inline
141matrix_row_t matrix_get_row(uint8_t row)
142{
143 return matrix[row];
144}
145
146void matrix_print(void)
147{
148 print_matrix_header();
149
150 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
151 print_hex8(row); print(": ");
152 print_matrix_row(row);
153 print("\n");
154 }
155}
156
157uint8_t matrix_key_count(void)
158{
159 uint8_t count = 0;
160 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
161 count += matrix_bitpop(i);
162 }
163 return count;
164} 65}
diff --git a/keyboards/telophase/readme.md b/keyboards/telophase/readme.md
index 97bce57bb..26b623ca1 100644
--- a/keyboards/telophase/readme.md
+++ b/keyboards/telophase/readme.md
@@ -1,16 +1,13 @@
1Telophase 1# Telophase
2=========
3 2
4A wireless split compact keyboard. 3A wireless split compact keyboard.
5 4
6Hardware Supported: Telophase PCB 5This keyboard uses a completely different 'matrix scan' system to other keyboards, it relies on an external nRF51822 microcontroller maintaining a matrix of keystates received from the keyboard halves. The matrix.c file contains the code to poll the external microcontroller for the key matrix. As long as this file is not changed, all other QMK features are supported.
6
7* Hardware Supported: Telophase PCB
7 8
8Make example for this keyboard (after setting up your build environment): 9Make example for this keyboard (after setting up your build environment):
9 10
10 make telophase:default 11 make telophase:default
11 12
12See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. 13See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
13
14## Mitosis Notes
15
16These configuration files were based off the Atreus keyboard. It assumes a Pro Micro is being used, however retains the 'make upload' feature from the Atreus branch. This keyboard uses a completely different 'matrix scan' system to other keyboards, it relies on an external nRF51822 microcontroller maintaining a matrix of keystates received from the keyboard halves. The matrix.c file contains the code to poll the external microcontroller for the key matrix. As long as this file is not changed, all other QMK features are supported.
diff --git a/keyboards/telophase/rules.mk b/keyboards/telophase/rules.mk
index 614d90918..d475836b7 100644
--- a/keyboards/telophase/rules.mk
+++ b/keyboards/telophase/rules.mk
@@ -2,34 +2,27 @@
2MCU = atmega32u4 2MCU = atmega32u4
3 3
4# Bootloader selection 4# Bootloader selection
5# Teensy halfkay
6# Pro Micro caterina
7# Atmel DFU atmel-dfu
8# LUFA DFU lufa-dfu
9# QMK DFU qmk-dfu
10# ATmega32A bootloadHID
11# ATmega328P USBasp
12BOOTLOADER = caterina 5BOOTLOADER = caterina
13 6
14# Build Options 7# Build Options
15# comment out to disable the options. 8# change yes to no to disable
16# 9#
17#BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration 10BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = yes # Mouse keys 11MOUSEKEY_ENABLE = yes # Mouse keys
19EXTRAKEY_ENABLE = yes # Audio control and System control 12EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = yes # Console for debug 13CONSOLE_ENABLE = yes # Console for debug
21COMMAND_ENABLE = yes # Commands for debug and configuration 14COMMAND_ENABLE = yes # Commands for debug and configuration
22CUSTOM_MATRIX = yes # Remote matrix from the wireless bridge 15SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
23# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 16# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
24# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend 17NKRO_ENABLE = yes # USB Nkey Rollover
25NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA 18BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
26# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality 19RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
27# MIDI_ENABLE = YES # MIDI controls 20BLUETOOTH_ENABLE = no # Enable Bluetooth
28UNICODE_ENABLE = YES # Unicode 21AUDIO_ENABLE = no # Audio output
29# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID 22CUSTOM_MATRIX = lite
30 23
31# # project specific files 24# project specific files
32SRC = matrix.c serial_uart.c 25SRC += matrix.c serial_uart.c
33 26
34# Disable unsupported hardware 27# Disable unsupported hardware
35RGBLIGHT_SUPPORTED = no 28RGBLIGHT_SUPPORTED = no
diff --git a/keyboards/telophase/telophase.c b/keyboards/telophase/telophase.c
index 7484551c9..334cc7697 100644
--- a/keyboards/telophase/telophase.c
+++ b/keyboards/telophase/telophase.c
@@ -1,26 +1,44 @@
1/*
2Copyright 2021
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
1#include "telophase.h" 18#include "telophase.h"
2 19
3void led_init(void) { 20void led_init(void) {
4 DDRD |= (1<<1); 21 setPinOutput(D1);
5 PORTD |= (1<<1); 22 setPinOutput(F4);
6 DDRF |= (1<<4) | (1<<5); 23 setPinOutput(F5);
7 PORTF |= (1<<4) | (1<<5); 24 writePinHigh(D1);
25 writePinHigh(F4);
26 writePinHigh(F5);
8} 27}
9 28
10
11void matrix_init_kb(void) { 29void matrix_init_kb(void) {
12 // put your keyboard start-up code here 30 // put your keyboard start-up code here
13 // runs once when the firmware starts up 31 // runs once when the firmware starts up
14 matrix_init_user(); 32 matrix_init_user();
15 led_init(); 33 led_init();
16} 34}
17 35
18#ifdef SWAP_HANDS_ENABLE 36#ifdef SWAP_HANDS_ENABLE
19__attribute__ ((weak)) 37__attribute__ ((weak))
20const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { 38const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
21{{12, 0}, {11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, 39 {{12, 0}, {11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
22{{12, 1}, {11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, 40 {{12, 1}, {11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
23{{12, 2}, {11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, 41 {{12, 2}, {11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
24{{12, 3}, {11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, 42 {{12, 3}, {11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}
25}; 43};
26#endif 44#endif
diff --git a/keyboards/telophase/telophase.h b/keyboards/telophase/telophase.h
index 458ea35da..8ca674417 100644
--- a/keyboards/telophase/telophase.h
+++ b/keyboards/telophase/telophase.h
@@ -1,14 +1,30 @@
1#ifndef TELOPHASE_H 1/*
2#define TELOPHASE_H 2Copyright 2021
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#pragma once
3 19
4#include "quantum.h" 20#include "quantum.h"
5 21
6#define red_led_off PORTF |= (1<<5) 22#define red_led_off writePinHigh(F5)
7#define red_led_on PORTF &= ~(1<<5) 23#define red_led_on writePinLow(F5)
8#define blu_led_off PORTF |= (1<<4) 24#define blu_led_off writePinHigh(F4)
9#define blu_led_on PORTF &= ~(1<<4) 25#define blu_led_on writePinLow(F4)
10#define grn_led_off PORTD |= (1<<1) 26#define grn_led_off writePinHigh(D1)
11#define grn_led_on PORTD &= ~(1<<1) 27#define grn_led_on writePinLow(D1)
12 28
13#define set_led_off red_led_off; grn_led_off; blu_led_off 29#define set_led_off red_led_off; grn_led_off; blu_led_off
14#define set_led_red red_led_on; grn_led_off; blu_led_off 30#define set_led_red red_led_on; grn_led_off; blu_led_off
@@ -19,46 +35,19 @@
19#define set_led_cyan red_led_off; grn_led_on; blu_led_on 35#define set_led_cyan red_led_off; grn_led_on; blu_led_on
20#define set_led_white red_led_on; grn_led_on; blu_led_on 36#define set_led_white red_led_on; grn_led_on; blu_led_on
21 37
22/*
23#define LED_B 5
24#define LED_R 6
25#define LED_G 7
26
27#define all_leds_off PORTF &= ~(1<<LED_B) & ~(1<<LED_R) & ~(1<<LED_G)
28
29#define red_led_on PORTF |= (1<<LED_R)
30#define red_led_off PORTF &= ~(1<<LED_R)
31#define grn_led_on PORTF |= (1<<LED_G)
32#define grn_led_off PORTF &= ~(1<<LED_G)
33#define blu_led_on PORTF |= (1<<LED_B)
34#define blu_led_off PORTF &= ~(1<<LED_B)
35
36#define set_led_off PORTF &= ~(1<<LED_B) & ~(1<<LED_R) & ~(1<<LED_G)
37#define set_led_red PORTF = PORTF & ~(1<<LED_B) & ~(1<<LED_G) | (1<<LED_R)
38#define set_led_blue PORTF = PORTF & ~(1<<LED_G) & ~(1<<LED_R) | (1<<LED_B)
39#define set_led_green PORTF = PORTF & ~(1<<LED_B) & ~(1<<LED_R) | (1<<LED_G)
40#define set_led_yellow PORTF = PORTF & ~(1<<LED_B) | (1<<LED_R) | (1<<LED_G)
41#define set_led_magenta PORTF = PORTF & ~(1<<LED_G) | (1<<LED_R) | (1<<LED_B)
42#define set_led_cyan PORTF = PORTF & ~(1<<LED_R) | (1<<LED_B) | (1<<LED_G)
43#define set_led_white PORTF |= (1<<LED_B) | (1<<LED_R) | (1<<LED_G)
44*/
45
46// This a shortcut to help you visually see your layout. 38// This a shortcut to help you visually see your layout.
47// The first section contains all of the arguements 39// The first section contains all of the arguements
48// The second converts the arguments into a two-dimensional array 40// The second converts the arguments into a two-dimensional array
49#define LAYOUT_ortho_4x12( \ 41#define LAYOUT_ortho_4x12( \
50 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, \ 42 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, \
51 k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, \ 43 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, \
52 k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, \ 44 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, \
53 k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47 \ 45 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B \
54) \ 46) { \
55{ \ 47 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B }, \
56 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11 }, \ 48 { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B }, \
57 { k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23 }, \ 49 { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B }, \
58 { k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35 }, \ 50 { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B } \
59 { k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47 }, \
60} 51}
61 52
62#define LAYOUT LAYOUT_ortho_4x12 53#define LAYOUT LAYOUT_ortho_4x12
63
64#endif