summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-11-28 23:51:07 -0500
committerJack Humbert <jack.humb@gmail.com>2016-11-28 23:51:07 -0500
commit6e0f994950435aa5867e7b7ce780186d881d74ac (patch)
tree4a43aec89032a5bace8be91c3230b6d2fcedcb5f
parent7edac212c8ed8442bf4207e70dc8194631b2bf27 (diff)
parent1585fc4b616cb28b8d4a418cd31c8ce0dd64f731 (diff)
Merge branch 'master' of github.com:jackhumbert/qmk_firmware into wu5y7
-rw-r--r--build_keyboard.mk1
-rw-r--r--keyboards/handwired/promethium/Makefile3
-rw-r--r--keyboards/handwired/promethium/config.h162
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/Makefile28
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/config.h17
-rwxr-xr-xkeyboards/handwired/promethium/keymaps/priyadi/flash.sh3
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/keymap.c725
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/readme.md0
-rw-r--r--keyboards/handwired/promethium/keymaps/readme.md22
-rw-r--r--keyboards/handwired/promethium/promethium.c6
-rw-r--r--keyboards/handwired/promethium/promethium.h101
-rw-r--r--keyboards/handwired/promethium/readme.md13
-rw-r--r--keyboards/handwired/promethium/rgbsps.c24
-rw-r--r--keyboards/handwired/promethium/rgbsps.h4
-rw-r--r--keyboards/handwired/promethium/rules.mk74
-rw-r--r--quantum/config_common.h48
-rw-r--r--quantum/keymap_extras/keymap_jp.h62
-rw-r--r--quantum/process_keycode/process_unicode.h1
-rw-r--r--readme.md157
-rw-r--r--tmk_core/common/avr/suspend.c11
-rw-r--r--tmk_core/common/backlight.c4
-rw-r--r--tmk_core/protocol/ps2_mouse.c5
22 files changed, 1415 insertions, 56 deletions
diff --git a/build_keyboard.mk b/build_keyboard.mk
index c1e5540039..ce505de126 100644
--- a/build_keyboard.mk
+++ b/build_keyboard.mk
@@ -213,6 +213,7 @@ endif
213VPATH += $(KEYBOARD_PATH) 213VPATH += $(KEYBOARD_PATH)
214VPATH += $(COMMON_VPATH) 214VPATH += $(COMMON_VPATH)
215 215
216include $(TMK_PATH)/protocol.mk
216 217
217include $(TMK_PATH)/common.mk 218include $(TMK_PATH)/common.mk
218SRC += $(TMK_COMMON_SRC) 219SRC += $(TMK_COMMON_SRC)
diff --git a/keyboards/handwired/promethium/Makefile b/keyboards/handwired/promethium/Makefile
new file mode 100644
index 0000000000..191c6bb664
--- /dev/null
+++ b/keyboards/handwired/promethium/Makefile
@@ -0,0 +1,3 @@
1ifndef MAKEFILE_INCLUDED
2 include ../../../Makefile
3endif \ No newline at end of file
diff --git a/keyboards/handwired/promethium/config.h b/keyboards/handwired/promethium/config.h
new file mode 100644
index 0000000000..473af67d34
--- /dev/null
+++ b/keyboards/handwired/promethium/config.h
@@ -0,0 +1,162 @@
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#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x6660
26#define DEVICE_VER 0x0001
27#define MANUFACTURER Priyadi
28#define PRODUCT Promethium Keyboard
29#define DESCRIPTION Promethium Keyboard
30
31/* key matrix size */
32#define MATRIX_ROWS 8
33#define MATRIX_COLS 6
34
35/* default pin-out */
36#define MATRIX_COL_PINS { B6, B7, D6, C7, F6, F7 }
37#define MATRIX_ROW_PINS { D7, C6, D0, D1, F5, F4, F1, F0 }
38#define UNUSED_PINS
39
40/* COL2ROW or ROW2COL */
41#define DIODE_DIRECTION COL2ROW
42
43/* define if matrix has ghost */
44//#define MATRIX_HAS_GHOST
45
46/* number of backlight levels */
47#define BACKLIGHT_LEVELS 3
48
49/* Set 0 if debouncing isn't needed */
50#define DEBOUNCING_DELAY 5
51
52/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
53#define LOCKING_SUPPORT_ENABLE
54/* Locking resynchronize hack */
55#define LOCKING_RESYNC_ENABLE
56
57/* key combination for command */
58#define IS_COMMAND() ( \
59 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT) | MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RCTRL)) \
60)
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/* PS/2 mouse */
81#ifdef PS2_USE_BUSYWAIT
82# define PS2_CLOCK_PORT PORTD
83# define PS2_CLOCK_PIN PIND
84# define PS2_CLOCK_DDR DDRD
85# define PS2_CLOCK_BIT 1
86# define PS2_DATA_PORT PORTD
87# define PS2_DATA_PIN PIND
88# define PS2_DATA_DDR DDRD
89# define PS2_DATA_BIT 2
90#endif
91
92/* PS/2 mouse interrupt version */
93#ifdef PS2_USE_INT
94/* uses INT1 for clock line(ATMega32U4) */
95#define PS2_CLOCK_PORT PORTD
96#define PS2_CLOCK_PIN PIND
97#define PS2_CLOCK_DDR DDRD
98#define PS2_CLOCK_BIT 3
99#define PS2_DATA_PORT PORTD
100#define PS2_DATA_PIN PIND
101#define PS2_DATA_DDR DDRD
102#define PS2_DATA_BIT 2
103
104#define PS2_INT_INIT() do { \
105 EICRA |= ((1<<ISC31) | \
106 (0<<ISC30)); \
107} while (0)
108#define PS2_INT_ON() do { \
109 EIMSK |= (1<<INT3); \
110} while (0)
111#define PS2_INT_OFF() do { \
112 EIMSK &= ~(1<<INT3); \
113} while (0)
114#define PS2_INT_VECT INT3_vect
115#endif
116
117/* PS/2 mouse USART version */
118#ifdef PS2_USE_USART
119/* XCK for clock line and RXD for data line */
120#define PS2_CLOCK_PORT PORTD
121#define PS2_CLOCK_PIN PIND
122#define PS2_CLOCK_DDR DDRD
123#define PS2_CLOCK_BIT 5
124#define PS2_DATA_PORT PORTD
125#define PS2_DATA_PIN PIND
126#define PS2_DATA_DDR DDRD
127#define PS2_DATA_BIT 2
128
129/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
130/* set DDR of CLOCK as input to be slave */
131#define PS2_USART_INIT() do { \
132 PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
133 PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
134 UCSR1C = ((1 << UMSEL10) | \
135 (3 << UPM10) | \
136 (0 << USBS1) | \
137 (3 << UCSZ10) | \
138 (0 << UCPOL1)); \
139 UCSR1A = 0; \
140 UBRR1H = 0; \
141 UBRR1L = 0; \
142} while (0)
143#define PS2_USART_RX_INT_ON() do { \
144 UCSR1B = ((1 << RXCIE1) | \
145 (1 << RXEN1)); \
146} while (0)
147#define PS2_USART_RX_POLL_ON() do { \
148 UCSR1B = (1 << RXEN1); \
149} while (0)
150#define PS2_USART_OFF() do { \
151 UCSR1C = 0; \
152 UCSR1B &= ~((1 << RXEN1) | \
153 (1 << TXEN1)); \
154} while (0)
155#define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
156#define PS2_USART_RX_DATA UDR1
157#define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
158#define PS2_USART_RX_VECT USART1_RX_vect
159#endif
160
161
162#endif
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/Makefile b/keyboards/handwired/promethium/keymaps/priyadi/Makefile
new file mode 100644
index 0000000000..2f6f27a732
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/Makefile
@@ -0,0 +1,28 @@
1
2
3# Build Options
4# change to "no" to disable the options, or define them in the Makefile in
5# the appropriate keymap folder that will get included automatically
6#
7BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
8MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
9EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
10CONSOLE_ENABLE = no # Console for debug(+400)
11COMMAND_ENABLE = yes # Commands for debug and configuration
12NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
13BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
14MIDI_ENABLE = no # MIDI controls
15AUDIO_ENABLE = no # Audio output on port C6
16UNICODE_ENABLE = no # Unicode
17BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
18RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
19PS2_MOUSE_ENABLE = yes
20PS2_USE_INT = yes
21
22# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
23SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
24
25ifndef QUANTUM_DIR
26 include ../../../../../Makefile
27endif
28
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/config.h b/keyboards/handwired/promethium/keymaps/priyadi/config.h
new file mode 100644
index 0000000000..8b78c0dc4f
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/config.h
@@ -0,0 +1,17 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/* bootmagic salt key */
7#define BOOTMAGIC_KEY_SALT KC_ESC
8
9/* skip bootmagic and eeconfig */
10#define BOOTMAGIC_KEY_SKIP KC_SPACE
11
12#define PREVENT_STUCK_MODIFIERS
13
14#define RGB_DI_PIN B5
15#define RGBSPS_NUM 57
16
17#endif
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/flash.sh b/keyboards/handwired/promethium/keymaps/priyadi/flash.sh
new file mode 100755
index 0000000000..fb81a54ee0
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/flash.sh
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3avrdude -p m32u4 -P /dev/ttyACM0 -c avr109 -U flash:w:../../../../../.build/handwired_promethium_priyadi.hex
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c
new file mode 100644
index 0000000000..b2da2f97b7
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c
@@ -0,0 +1,725 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2// this is the style you want to emulate.
3
4#include "promethium.h"
5#include "action_layer.h"
6#ifdef AUDIO_ENABLE
7 #include "audio.h"
8 #include "musical_notes.h"
9#endif
10#include "eeconfig.h"
11#include "process_unicode.h"
12#include "quantum.h"
13#include "rgbsps.h"
14#define COUNT(x) (sizeof (x) / sizeof (*(x)))
15
16// #define RGBLED_NUM 5
17// struct cRGB led[RGBLED_NUM];
18
19
20extern keymap_config_t keymap_config;
21
22enum layers {
23 _QWERTY,
24 _COLEMAK,
25 _WORKMAN,
26 _PUNC,
27 _NUM,
28 _FUNC,
29 _EMOJI,
30 _GUI,
31};
32
33enum planck_keycodes {
34 // layouts
35 QWERTY = SAFE_RANGE,
36 COLEMAK,
37 WORKMAN,
38
39 // layer switchers
40 PUNC,
41 NUM,
42 FUNC,
43 EMOJI,
44 GUI,
45
46 // os switchers
47 LINUX,
48 WIN,
49 OSX,
50};
51
52// Fillers to make layering clearer
53
54#define _______ KC_TRNS
55#define XXXXXXX KC_NO
56
57// unicode map
58
59enum unicode_name {
60 GRIN, // grinning face 😊
61 TJOY, // tears of joy 😂
62 SMILE, // grining face with smiling eyes 😁
63 HEART, // heart ❤
64 EYERT, // smiling face with heart shaped eyes 😍
65 CRY, // crying face 😭
66 SMEYE, // smiling face with smiling eyes 😊
67 UNAMU, // unamused 😒
68 KISS, // kiss 😘
69 HART2, // two hearts 💕
70 WEARY, // weary 😩
71 OKHND, // ok hand sign 👌
72 PENSV, // pensive 😔
73 SMIRK, // smirk 😏
74 RECYC, // recycle ♻
75 WINK, // wink 😉
76 THMUP, // thumb up 👍
77 THMDN, // thumb down 👎
78 PRAY, // pray 🙏
79 PHEW, // relieved 😌
80 MUSIC, // musical notes
81 FLUSH, // flushed 😳
82 CELEB, // celebration 🙌
83 CRY2, // crying face 😢
84 COOL, // smile with sunglasses 😎
85 NOEVS, // see no evil
86 NOEVH, // hear no evil
87 NOEVK, // speak no evil
88 POO, // pile of poo
89 EYES, // eyes
90 VIC, // victory hand
91 BHART, // broken heart
92 SLEEP, // sleeping face
93 SMIL2, // smiling face with open mouth & sweat
94 HUNRD, // 100
95 CONFU, // confused
96 TONGU, // face with tongue & winking eye
97 DISAP, // disappointed
98 YUMMY, // face savoring delicious food
99 CLAP, // hand clapping
100 FEAR, // face screaming in fear
101 HORNS, // smiling face with horns
102 HALO, // smiling face with halo
103 BYE, // waving hand
104 SUN, // sun
105 MOON, // moon
106 SKULL, // skull
107};
108
109const uint32_t PROGMEM unicode_map[] = {
110 [GRIN] = 0x1F600,
111 [TJOY] = 0x1F602,
112 [SMILE] = 0x1F601,
113 [HEART] = 0x2764,
114 [EYERT] = 0x1f60d,
115 [CRY] = 0x1f62d,
116 [SMEYE] = 0x1F60A,
117 [UNAMU] = 0x1F612,
118 [KISS] = 0x1F618,
119 [HART2] = 0x1F495,
120 [WEARY] = 0x1F629,
121 [OKHND] = 0x1F44C,
122 [PENSV] = 0x1F614,
123 [SMIRK] = 0x1F60F,
124 [RECYC] = 0x267B,
125 [WINK] = 0x1F609,
126 [THMUP] = 0x1F44D,
127 [THMDN] = 0x1F44E,
128 [PRAY] = 0x1F64F,
129 [PHEW] = 0x1F60C,
130 [MUSIC] = 0x1F3B6,
131 [FLUSH] = 0x1F633,
132 [CELEB] = 0x1F64C,
133 [CRY2] = 0x1F622,
134 [COOL] = 0x1F60E,
135 [NOEVS] = 0x1F648,
136 [NOEVH] = 0x1F649,
137 [NOEVK] = 0x1F64A,
138 [POO] = 0x1F4A9,
139 [EYES] = 0x1F440,
140 [VIC] = 0x270C,
141 [BHART] = 0x1F494,
142 [SLEEP] = 0x1F634,
143 [SMIL2] = 0x1F605,
144 [HUNRD] = 0x1F4AF,
145 [CONFU] = 0x1F615,
146 [TONGU] = 0x1F61C,
147 [DISAP] = 0x1F61E,
148 [YUMMY] = 0x1F60B,
149 [CLAP] = 0x1F44F,
150 [FEAR] = 0x1F631,
151 [HORNS] = 0x1F608,
152 [HALO] = 0x1F607,
153 [BYE] = 0x1F44B,
154 [SUN] = 0x2600,
155 [MOON] = 0x1F314,
156 [SKULL] = 0x1F480,
157};
158
159
160// hybrid shift - =
161// #undef KC_LSFT
162// #define KC_LSFT MT(MOD_LSFT, KC_MINS)
163// #undef KC_RSFT
164// #define KC_RSFT MT(MOD_LSFT, KC_EQL)
165
166
167// hybrid right-gui & scroll lock (mapped to Compose in OS)
168#undef KC_RCTL
169#define KC_RCTL MT(MOD_LCTL, KC_SLCK)
170
171// RGBSPS
172
173const uint8_t PROGMEM LED_ALNUM[] = {
174 LED_Z,
175 LED_A,
176 LED_Q,
177 LED_W,
178 LED_S,
179 LED_X,
180 LED_C,
181 LED_D,
182 LED_E,
183 LED_R,
184 LED_F,
185 LED_V,
186 LED_B,
187 LED_G,
188 LED_T,
189 LED_N,
190 LED_HH,
191 LED_Y,
192 LED_U,
193 LED_J,
194 LED_M,
195 LED_COMM,
196 LED_K,
197 LED_I,
198 LED_O,
199 LED_L,
200 LED_DOT,
201 LED_SLSH,
202 LED_SCLN,
203 LED_P,
204 LED_LSPC,
205 LED_RSPC
206};
207
208const uint8_t PROGMEM LED_MODS[] = {
209 LED_TAB,
210 LED_ESC,
211 LED_LSFT,
212 LED_LCTL,
213 LED_LGUI,
214 LED_LALT,
215 LED_RALT,
216 LED_RGUI,
217 LED_BKSP,
218 LED_ENT,
219 LED_RSFT,
220 LED_RCTL
221};
222
223const uint8_t PROGMEM LED_FN[] = {
224 LED_PUNC,
225 LED_NUM,
226 LED_FUNC,
227 LED_EMOJI
228};
229
230const uint8_t PROGMEM LED_INDICATORS[] = {
231 LED_IND_EMOJI,
232 LED_IND_NUM,
233 LED_IND_FUNC,
234 LED_IND_BATTERY,
235 LED_IND_USB,
236 LED_IND_BLUETOOTH,
237};
238
239const uint8_t PROGMEM LED_TRACKPOINT[] = {
240 LED_TRACKPOINT1,
241 LED_TRACKPOINT2,
242 LED_TRACKPOINT3,
243};
244
245void led_reset(void) {
246 for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) {
247 rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 15, 6, 0);
248 }
249
250 for(uint8_t i = 0; i < COUNT(LED_MODS); i++) {
251 rgbsps_set(pgm_read_byte(&LED_MODS[i]), 15, 0, 0);
252 }
253
254 for(uint8_t i = 0; i < COUNT(LED_FN); i++) {
255 rgbsps_set(pgm_read_byte(&LED_FN[i]), 15, 15, 15);
256 }
257}
258
259void led_layer_normal(void) {
260 rgbsps_set(LED_IND_FUNC, 0, 0, 0);
261 rgbsps_set(LED_IND_NUM, 0, 0, 0);
262 rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
263
264 led_reset();
265
266 rgbsps_send();
267}
268
269void led_layer_func(void) {
270 rgbsps_set(LED_IND_FUNC, 0, 15, 0);
271 rgbsps_set(LED_IND_NUM, 0, 0, 0);
272 rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
273
274 led_reset();
275
276 for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) {
277 rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 0, 0, 0);
278 }
279
280 rgbsps_set(LED_I, 15, 0, 15);
281 rgbsps_set(LED_J, 15, 0, 15);
282 rgbsps_set(LED_K, 15, 0, 15);
283 rgbsps_set(LED_L, 15, 0, 15);
284
285 rgbsps_set(LED_U, 15, 0, 10);
286 rgbsps_set(LED_O, 15, 0, 10);
287 rgbsps_set(LED_COMM, 15, 0, 10);
288 rgbsps_set(LED_DOT, 15, 0, 10);
289 rgbsps_set(LED_SCLN, 15, 0, 10);
290 rgbsps_set(LED_P, 15, 0, 10);
291
292 rgbsps_set(LED_Q, 10, 0, 15);
293 rgbsps_set(LED_W, 10, 0, 15);
294 rgbsps_set(LED_E, 10, 0, 15);
295 rgbsps_set(LED_R, 10, 0, 15);
296 rgbsps_set(LED_A, 10, 0, 15);
297 rgbsps_set(LED_S, 10, 0, 15);
298 rgbsps_set(LED_D, 10, 0, 15);
299 rgbsps_set(LED_F, 10, 0, 15);
300 rgbsps_set(LED_Z, 10, 0, 15);
301 rgbsps_set(LED_X, 10, 0, 15);
302 rgbsps_set(LED_C, 10, 0, 15);
303 rgbsps_set(LED_V, 10, 0, 15);
304
305 rgbsps_send();
306}
307
308void led_layer_punc(void) {
309 rgbsps_set(LED_IND_FUNC, 0, 15, 0);
310 rgbsps_set(LED_IND_NUM, 0, 0, 15);
311 rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
312
313 led_reset();
314
315 rgbsps_send();
316}
317
318void led_layer_num(void) {
319 rgbsps_set(LED_IND_FUNC, 0, 0, 0);
320 rgbsps_set(LED_IND_NUM, 0, 0, 15);
321 rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
322
323 led_reset();
324
325 for(uint8_t i = 0; i < COUNT(LED_ALNUM); i++) {
326 rgbsps_set(pgm_read_byte(&LED_ALNUM[i]), 0, 0, 0);
327 }
328
329 rgbsps_set(LED_U, 0, 5, 15);
330 rgbsps_set(LED_I, 0, 5, 15);
331 rgbsps_set(LED_O, 0, 5, 15);
332 rgbsps_set(LED_J, 0, 5, 15);
333 rgbsps_set(LED_K, 0, 5, 15);
334 rgbsps_set(LED_L, 0, 5, 15);
335 rgbsps_set(LED_M, 0, 5, 15);
336 rgbsps_set(LED_COMM, 0, 5, 15);
337 rgbsps_set(LED_DOT, 0, 5, 15);
338 rgbsps_set(LED_FUNC, 0, 5, 15);
339
340 rgbsps_set(LED_EMOJI, 0, 10, 15);
341 rgbsps_set(LED_RALT, 0, 10, 15);
342
343 rgbsps_set(LED_Q, 0, 10, 15);
344 rgbsps_set(LED_W, 0, 10, 15);
345 rgbsps_set(LED_E, 0, 10, 15);
346 rgbsps_set(LED_R, 0, 10, 15);
347 rgbsps_set(LED_T, 0, 10, 15);
348 rgbsps_set(LED_Y, 0, 10, 15);
349 rgbsps_set(LED_P, 0, 10, 15);
350
351 rgbsps_set(LED_A, 0, 15, 15);
352 rgbsps_set(LED_S, 0, 15, 15);
353 rgbsps_set(LED_D, 0, 15, 15);
354 rgbsps_set(LED_F, 0, 15, 15);
355 rgbsps_set(LED_Z, 0, 15, 15);
356 rgbsps_set(LED_X, 0, 15, 15);
357 rgbsps_set(LED_C, 0, 15, 15);
358 rgbsps_set(LED_V, 0, 15, 15);
359
360 rgbsps_send();
361}
362
363void led_layer_emoji(void) {
364 rgbsps_setall(15, 15, 0);
365
366 rgbsps_set(LED_IND_FUNC, 0, 0, 0);
367 rgbsps_set(LED_IND_NUM, 0, 0, 0);
368 rgbsps_set(LED_IND_EMOJI, 15, 15, 0);
369
370 rgbsps_set(LED_PUNC, 15, 15, 15);
371 rgbsps_set(LED_EMOJI, 15, 15, 15);
372
373 rgbsps_send();
374}
375
376void led_layer_gui(void) {
377 rgbsps_set(LED_IND_FUNC, 15, 10, 15);
378 rgbsps_set(LED_IND_NUM, 15, 10, 15);
379 rgbsps_set(LED_IND_EMOJI, 15, 10, 15);
380 rgbsps_send();
381}
382
383void led_init(void) {
384 // turn off all
385 rgbsps_turnoff();
386
387 // set trackpoint color
388 rgbsps_set(LED_TRACKPOINT1, 15, 0, 0);
389 rgbsps_set(LED_TRACKPOINT2, 0, 0, 15);
390 rgbsps_set(LED_TRACKPOINT3, 15, 0, 0);
391
392 // // hardcode indicator for now
393 rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 15);
394 rgbsps_set(LED_IND_USB, 15, 15, 15);
395 rgbsps_set(LED_IND_BATTERY, 0, 15, 0);
396
397 led_layer_normal();
398}
399
400
401// keymaps
402
403const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
404
405/* Qwerty
406 * ,-----------------------------------------------------------------------------------.
407 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
408 * |------+------+------+------+------+-------------+------+------+------+------+------|
409 * | Esc | A | S | D | F | G | H | J | K | L | ; |Enter |
410 * |------+------+------+------+------+------|------+------+------+------+------+------|
411 * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift |
412 * |------+------+------+------+------+------+------+------+------+------+------+------|
413 * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl |
414 * `-----------------------------------------------------------------------------------'
415 */
416[_QWERTY] = KEYMAP(
417 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
418 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT ,
419 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
420 KC_LCTL, KC_LGUI, KC_LALT, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, KC_RALT, KC_RGUI, KC_RCTL
421),
422
423/* Colemak
424 * ,-----------------------------------------------------------------------------------.
425 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
426 * |------+------+------+------+------+-------------+------+------+------+------+------|
427 * | Esc | A | R | S | T | D | H | N | E | I | O |Enter |
428 * |------+------+------+------+------+------|------+------+------+------+------+------|
429 * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift |
430 * |------+------+------+------+------+------+------+------+------+------+------+------|
431 * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl |
432 * `-----------------------------------------------------------------------------------'
433 */
434[_COLEMAK] = KEYMAP(
435 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
436 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT ,
437 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
438 KC_LCTL, KC_LGUI, KC_LALT, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, KC_RALT, KC_RGUI, KC_RCTL
439),
440
441/* Workman
442 * ,-----------------------------------------------------------------------------------.
443 * | Tab | Q | D | R | W | B | J | F | U | P | ; | Bksp |
444 * |------+------+------+------+------+-------------+------+------+------+------+------|
445 * | Esc | A | S | H | T | G | Y | N | E | O | I |Enter |
446 * |------+------+------+------+------+------|------+------+------+------+------+------|
447 * | Shift| Z | X | M | C | V | K | K | , | . | / |Shift |
448 * |------+------+------+------+------+------+------+------+------+------+------+------|
449 * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl |
450 * `-----------------------------------------------------------------------------------'
451 */
452[_WORKMAN] = KEYMAP(
453 KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSPC,
454 KC_ESC, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_ENT ,
455 KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
456 KC_LCTL, KC_LGUI, KC_LALT, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, KC_RALT, KC_RGUI, KC_RCTL
457),
458
459/* Punc
460 * ,-----------------------------------------------------------------------------------.
461 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | ` |
462 * |------+------+------+------+------+-------------+------+------+------+------+------|
463 * | | | \ | - | = | < | > | ( | ) | ' | | |
464 * |------+------+------+------+------+------|------+------+------+------+------+------|
465 * | | | | | _ | + | { | } | [ | ] | " | | |
466 * |------+------+------+------+------+------+------+------+------+------+------+------|
467 * | | | | | | | | | | | |
468 * `-----------------------------------------------------------------------------------'
469 */
470[_PUNC] = KEYMAP(
471 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_GRV ,
472 XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, KC_LABK, KC_RABK, KC_LPRN, KC_RPRN, KC_QUOT, XXXXXXX, XXXXXXX,
473 XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_DQUO, XXXXXXX, XXXXXXX,
474 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
475),
476
477/* Num
478 * ,-----------------------------------------------------------------------------------.
479 * | ^ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
480 * |------+------+------+------+------+-------------+------+------+------+------+------|
481 * | Esc | @ | A | B | C | ( | ) | 4 | 5 | 6 | : |Enter |
482 * |------+------+------+------+------+------|------+------+------+------+------+------|
483 * | & | # | D | E | F | [ | ] | 1 | 2 | 3 | / | * |
484 * |------+------+------+------+------+------+------+------+------+------+------+------|
485 * | | | | x | | | 0 | , | . | + | - |
486 * `-----------------------------------------------------------------------------------'
487 */
488[_NUM] = KEYMAP(
489 KC_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
490 KC_ESC, KC_AT, S(KC_A), S(KC_B), S(KC_C), KC_LPRN, KC_RPRN, KC_4, KC_5, KC_6, KC_COLN, KC_ENT,
491 KC_AMPR, KC_HASH, S(KC_D), S(KC_E), S(KC_F), KC_LBRC, KC_RBRC, KC_1, KC_2, KC_3, KC_SLSH, KC_ASTR,
492 _______, _______, _______, KC_X, _______, KC_SPC, KC_SPC, KC_0, KC_COMM, KC_DOT, KC_PLUS, KC_MINS
493),
494
495/* Func
496 * ,-----------------------------------------------------------------------------------.
497 * | | F1 | F2 | F3 | F4 | | | PgUp | Up | PgDn | PgUp | Del |
498 * |------+------+------+------+------+-------------+------+------+------+------+------|
499 * | | F5 | F6 | F7 | F8 |PrtSc | | Left | Down | Right| PgDn | Ins |
500 * |------+------+------+------+------+------|------+------+------+------+------+------|
501 * | | F9 | F10 | F11 | F12 | | | | Home | End | | |
502 * |------+------+------+------+------+------+------+------+------+------+------+------|
503 * | | | | | | | | | | | |
504 * `-----------------------------------------------------------------------------------'
505 */
506[_FUNC] = KEYMAP(
507 XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL,
508 XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8,KC_PSCREEN,XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_INS,
509 _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______,
510 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
511),
512
513/* Emoji
514 * ,-----------------------------------------------------------------------------------.
515 * | | | | | | | | | | | | |
516 * |------+------+------+------+------+-------------+------+------+------+------+------|
517 * | | | | | | | | | | | | |
518 * |------+------+------+------+------+------+------+------+------+------+------+------|
519 * | | | | | | | | | | | | |
520 * |------+------+------+------+------+------+------+------+------+------+------+------|
521 * | | | | | | | | | | | | |
522 * `-----------------------------------------------------------------------------------'
523 */
524[_EMOJI] = KEYMAP(
525 X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW),
526 X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS),
527 X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH),
528 X(POO), X(EYES),X(HUNRD), _______,X(SKULL),X(HORNS), X(HALO), X(FEAR), _______,X(YUMMY),X(DISAP),X(NOEVK)
529),
530
531/* GUI
532 * ,-----------------------------------------------------------------------------------.
533 * | | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | |
534 * |------+------+------+------+------+-------------+------+------+------+------+------|
535 * |Linux | | Vol- | Mute | Vol+ | | | D- | | D+ | |Qwerty|
536 * |------+------+------+------+------+------+------+------+------+------+------+------|
537 * | Win | | Prev | Play | Next | | | | | | |Colmak|
538 * |------+------+------+------+------+------+------+------+------+------+------+------|
539 * | OSX | | | | | BL- | BL+ | | | | |Workmn|
540 * `-----------------------------------------------------------------------------------'
541 */
542[_GUI] = KEYMAP(
543 _______, LGUI(KC_1),LGUI(KC_2),LGUI(KC_3),LGUI(KC_4),LGUI(KC_5),LGUI(KC_6),LGUI(KC_7),LGUI(KC_8),LGUI(KC_9),LGUI(KC_0), _______,
544 LINUX, _______, KC_VOLD, KC_MUTE, KC_VOLU,_______,_______,KC_WWW_BACK,_______,KC_WWW_FORWARD,_______, QWERTY,
545 WIN, _______, KC_MPRV, KC_MPLY, KC_MNXT, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, COLEMAK,
546 OSX, _______, _______, _______, _______, BL_DEC, BL_INC, _______, _______, RGB_VAI, RGB_VAD, WORKMAN
547),
548
549};
550
551#ifdef AUDIO_ENABLE
552float tone_startup[][2] = SONG(STARTUP_SOUND);
553float tone_qwerty[][2] = SONG(QWERTY_SOUND);
554float tone_colemak[][2] = SONG(COLEMAK_SOUND);
555float tone_workman[][2] = SONG(DVORAK_SOUND);
556float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
557float tone_linux[][2] = SONG(CAPS_LOCK_ON_SOUND);
558float tone_windows[][2] = SONG(SCROLL_LOCK_ON_SOUND);
559float tone_osx[][2] = SONG(NUM_LOCK_ON_SOUND);
560float tone_click[][2] = SONG(MUSICAL_NOTE(_F3, 2));
561#endif
562
563void persistant_default_layer_set(uint16_t default_layer) {
564 eeconfig_update_default_layer(default_layer);
565 default_layer_set(default_layer);
566}
567
568bool process_record_user(uint16_t keycode, keyrecord_t *record) {
569 #ifdef AUDIO_ENABLE
570 // faux clicky
571 if (record->event.pressed) PLAY_NOTE_ARRAY(tone_click, false, 0);
572 #endif
573
574 switch (keycode) {
575 case QWERTY:
576 if (record->event.pressed) {
577 #ifdef AUDIO_ENABLE
578 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
579 #endif
580 persistant_default_layer_set(1UL<<_QWERTY);
581 }
582 return false;
583 break;
584 case COLEMAK:
585 if (record->event.pressed) {
586 #ifdef AUDIO_ENABLE
587 PLAY_NOTE_ARRAY(tone_colemak, false, 0);
588 #endif
589 persistant_default_layer_set(1UL<<_COLEMAK);
590 }
591 return false;
592 break;
593 case WORKMAN:
594 if (record->event.pressed) {
595 #ifdef AUDIO_ENABLE
596 PLAY_NOTE_ARRAY(tone_workman, false, 0);
597 #endif
598 persistant_default_layer_set(1UL<<_WORKMAN);
599 }
600 return false;
601 break;
602
603
604
605 case PUNC:
606 if (record->event.pressed) {
607 layer_on(_PUNC);
608 update_tri_layer(_PUNC, _EMOJI, _GUI);
609 if (IS_LAYER_ON(_GUI)) {
610 led_layer_gui();
611 } else {
612 led_layer_punc();;
613 }
614 } else {
615 layer_off(_PUNC);
616 update_tri_layer(_PUNC, _EMOJI, _GUI);
617 if (IS_LAYER_ON(_EMOJI)) {
618 led_layer_emoji();
619 } else {
620 led_layer_normal();;
621 }
622 }
623 return false;
624 break;
625 case EMOJI:
626 if (record->event.pressed) {
627 layer_on(_EMOJI);
628 update_tri_layer(_PUNC, _EMOJI, _GUI);
629 if (IS_LAYER_ON(_GUI)) {
630 led_layer_gui();
631 } else {
632 led_layer_emoji();;
633 }
634 } else {
635 layer_off(_EMOJI);
636 update_tri_layer(_PUNC, _EMOJI, _GUI);
637 if (IS_LAYER_ON(_PUNC)) {
638 led_layer_punc();
639 } else {
640 led_layer_normal();;
641 }
642 }
643 return false;
644 break;
645 case NUM:
646 if (record->event.pressed) {
647 layer_on(_NUM);
648 led_layer_num();
649 } else {
650 layer_off(_NUM);
651 led_layer_normal();
652 }
653 return false;
654 break;
655 case FUNC:
656 if (record->event.pressed) {
657 layer_on(_FUNC);
658 led_layer_func();
659 } else {
660 layer_off(_FUNC);
661 led_layer_normal();
662 }
663 return false;
664 break;
665
666
667 case LINUX:
668 set_unicode_input_mode(UC_LNX);
669 #ifdef AUDIO_ENABLE
670 PLAY_NOTE_ARRAY(tone_linux, false, 0);
671 #endif
672 return false;
673 break;
674 case WIN:
675 set_unicode_input_mode(UC_WINC);
676 #ifdef AUDIO_ENABLE
677 PLAY_NOTE_ARRAY(tone_windows, false, 0);
678 #endif
679 return false;
680 break;
681 case OSX:
682 set_unicode_input_mode(UC_OSX);
683 #ifdef AUDIO_ENABLE
684 PLAY_NOTE_ARRAY(tone_osx, false, 0);
685 #endif
686 return false;
687 break;
688 }
689 return true;
690}
691
692void matrix_init_user(void) {
693 #ifdef AUDIO_ENABLE
694 startup_user();
695 #endif
696 set_unicode_input_mode(UC_LNX);
697 led_init();
698}
699
700// void init_rgblight(void) {
701// for (uint8_t i = 0; i < RGBLED_NUM; i++) {
702// led[i].r = 255;
703// led[i].g = 85;
704// led[i].b = 0;
705// }
706// ws2812_setleds(led, RGBLED_NUM);
707// }
708
709
710#ifdef AUDIO_ENABLE
711
712void startup_user()
713{
714 _delay_ms(20); // gets rid of tick
715 PLAY_NOTE_ARRAY(tone_startup, false, 0);
716}
717
718void shutdown_user()
719{
720 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
721 _delay_ms(150);
722 stop_all_notes();
723}
724
725#endif \ No newline at end of file
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/readme.md b/keyboards/handwired/promethium/keymaps/priyadi/readme.md
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/readme.md
diff --git a/keyboards/handwired/promethium/keymaps/readme.md b/keyboards/handwired/promethium/keymaps/readme.md
new file mode 100644
index 0000000000..527691389e
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/readme.md
@@ -0,0 +1,22 @@
1# How to add your own keymap
2
3Folders can be named however you'd like (will be approved upon merging), or should follow the format with a preceding `_`:
4
5 _[ISO 3166-1 alpha-2 code*]_[layout variant]_[layout name/author]
6
7\* See full list: https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements
8
9and contain the following files:
10
11* `keymap.c`
12* `readme.md` *recommended*
13* `config.h` *optional*, found automatically when compiling
14* `Makefile` *optional*, found automatically when compling
15
16When adding your keymap to this list, keep it organised alphabetically (select list, edit->sort lines), and use this format:
17
18 * **folder_name** description
19
20# List of Promethium keymaps
21
22
diff --git a/keyboards/handwired/promethium/promethium.c b/keyboards/handwired/promethium/promethium.c
new file mode 100644
index 0000000000..a0035cce1a
--- /dev/null
+++ b/keyboards/handwired/promethium/promethium.c
@@ -0,0 +1,6 @@
1#include "promethium.h"
2
3void matrix_init_kb(void) {
4
5 matrix_init_user();
6} \ No newline at end of file
diff --git a/keyboards/handwired/promethium/promethium.h b/keyboards/handwired/promethium/promethium.h
new file mode 100644
index 0000000000..8f2a8c3be2
--- /dev/null
+++ b/keyboards/handwired/promethium/promethium.h
@@ -0,0 +1,101 @@
1#ifndef PROMETHIUM_H
2#define PROMETHIUM_H
3
4#include "quantum.h"
5
6#define PS2_INIT_DELAY 2000
7
8#define KEYMAP( \
9 k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
10 k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
11 k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
12 k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \
13) \
14{ \
15 {k11, k12, k13, k14, k15, k16}, \
16 {k21, k22, k23, k24, k25, k26}, \
17 {k31, k32, k33, k34, k35, k36}, \
18 {k41, k42, k43, k44, k45, k46}, \
19 {k17, k18, k19, k1a, k1b, k1c}, \
20 {k27, k28, k29, k2a, k2b, k2c}, \
21 {k37, k38, k39, k3a, k3b, k3c}, \
22 {k47, k48, k49, k4a, k4b, k4c} \
23}
24
25enum led_sequence {
26 LED_IND_EMOJI,
27 LED_IND_NUM,
28 LED_IND_FUNC,
29
30 LED_IND_BATTERY,
31 LED_IND_USB,
32 LED_IND_BLUETOOTH,
33
34 LED_TAB,
35 LED_ESC,
36 LED_LSFT,
37 LED_LCTL,
38
39 LED_LGUI,
40 LED_Z,
41 LED_A,
42 LED_Q,
43
44 LED_W,
45 LED_S,
46 LED_X,
47 LED_LALT,
48
49 LED_PUNC,
50 LED_C,
51 LED_D,
52 LED_E,
53
54 LED_R,
55 LED_F,
56 LED_V,
57 LED_NUM,
58
59 LED_LSPC,
60 LED_B,
61 LED_G,
62 LED_T,
63
64 LED_TRACKPOINT1,
65 LED_TRACKPOINT2,
66 LED_TRACKPOINT3,
67
68 LED_RSPC,
69 LED_N,
70 LED_HH,
71 LED_Y,
72
73 LED_U,
74 LED_J,
75 LED_M,
76 LED_FUNC,
77
78 LED_EMOJI,
79 LED_COMM,
80 LED_K,
81 LED_I,
82
83 LED_O,
84 LED_L,
85 LED_DOT,
86 LED_RALT,
87
88 LED_RGUI,
89 LED_SLSH,
90 LED_SCLN,
91 LED_P,
92
93 LED_BKSP,
94 LED_ENT,
95 LED_RSFT,
96 LED_RCTL
97};
98
99#endif
100
101
diff --git a/keyboards/handwired/promethium/readme.md b/keyboards/handwired/promethium/readme.md
new file mode 100644
index 0000000000..e63d2f1add
--- /dev/null
+++ b/keyboards/handwired/promethium/readme.md
@@ -0,0 +1,13 @@
1Promethium Keyboard Firmware
2============================
3A handwired Planck based keyboard using the Adafruit Feather 32u4 Bluefruit LE controller.
4
5Features:
6
7* Single piece split form factor
8* Columnar stagger
9* Trackpoint
10* Bluetooth LE *TBD*
11* Battery
12* Per switch RGB LED
13* Proximity sensor for energy conservation *TBD* \ No newline at end of file
diff --git a/keyboards/handwired/promethium/rgbsps.c b/keyboards/handwired/promethium/rgbsps.c
new file mode 100644
index 0000000000..ea922ec3fd
--- /dev/null
+++ b/keyboards/handwired/promethium/rgbsps.c
@@ -0,0 +1,24 @@
1#include "light_ws2812.h"
2#include "rgbsps.h"
3
4struct cRGB led[RGBSPS_NUM];
5
6void rgbsps_set(uint8_t index, uint8_t r, uint8_t g, uint8_t b) {
7 led[index].r = r;
8 led[index].g = g;
9 led[index].b = b;
10}
11
12void rgbsps_setall(uint8_t r, uint8_t g, uint8_t b) {
13 for (uint16_t i = 0; i < RGBSPS_NUM; i++) {
14 rgbsps_set(i, r, g, b);
15 }
16}
17
18void rgbsps_turnoff(void) {
19 rgbsps_setall(0, 0, 0);
20}
21
22void rgbsps_send(void) {
23 ws2812_setleds(led, RGBSPS_NUM);
24} \ No newline at end of file
diff --git a/keyboards/handwired/promethium/rgbsps.h b/keyboards/handwired/promethium/rgbsps.h
new file mode 100644
index 0000000000..6da197f75d
--- /dev/null
+++ b/keyboards/handwired/promethium/rgbsps.h
@@ -0,0 +1,4 @@
1void rgbsps_set(uint8_t index, uint8_t r, uint8_t g, uint8_t b);
2void rgbsps_setall(uint8_t r, uint8_t g, uint8_t b);
3void rgbsps_turnoff(void);
4void rgbsps_send(void); \ No newline at end of file
diff --git a/keyboards/handwired/promethium/rules.mk b/keyboards/handwired/promethium/rules.mk
new file mode 100644
index 0000000000..0842780cce
--- /dev/null
+++ b/keyboards/handwired/promethium/rules.mk
@@ -0,0 +1,74 @@
1
2# MCU name
3#MCU = at90usb1287
4MCU = atmega32u4
5
6# Processor frequency.
7# This will define a symbol, F_CPU, in all source code files equal to the
8# processor frequency in Hz. You can then use this symbol in your source code to
9# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
10# automatically to create a 32-bit value in your source code.
11#
12# This will be an integer division of F_USB below, as it is sourced by
13# F_USB after it has run through any CPU prescalers. Note that this value
14# does not *change* the processor frequency - it should merely be updated to
15# reflect the processor speed set externally so that the code can use accurate
16# software delays.
17F_CPU = 8000000
18
19#
20# LUFA specific
21#
22# Target architecture (see library "Board Types" documentation).
23ARCH = AVR8
24
25# Input clock frequency.
26# This will define a symbol, F_USB, in all source code files equal to the
27# input clock frequency (before any prescaling is performed) in Hz. This value may
28# differ from F_CPU if prescaling is used on the latter, and is required as the
29# raw input clock is fed directly to the PLL sections of the AVR for high speed
30# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
31# at the end, this will be done automatically to create a 32-bit value in your
32# source code.
33#
34# If no clock division is performed on the input clock inside the AVR (via the
35# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
36F_USB = $(F_CPU)
37
38# Interrupt driven control endpoint task(+60)
39OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
40
41
42# Boot Section Size in *bytes*
43# Teensy halfKay 512
44# Teensy++ halfKay 1024
45# Atmel DFU loader 4096
46# LUFA bootloader 4096
47# USBaspLoader 2048
48OPT_DEFS += -DBOOTLOADER_SIZE=4096
49
50# Build Options
51# change to "no" to disable the options, or define them in the Makefile in
52# the appropriate keymap folder that will get included automatically
53#
54BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
55MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
56EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
57CONSOLE_ENABLE ?= no # Console for debug(+400)
58COMMAND_ENABLE ?= no # Commands for debug and configuration
59NKRO_ENABLE ?= yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
60BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
61MIDI_ENABLE ?= no # MIDI controls
62AUDIO_ENABLE ?= no # Audio output on port C6
63UNICODE_ENABLE ?= no # Unicode
64UNICODEMAP_ENABLE = yes
65BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
66RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
67PS2_MOUSE_ENABLE ?= yes
68PS2_USE_INT ?= yes
69
70# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
71SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
72
73SRC += $(QUANTUM_DIR)/light_ws2812.c
74SRC += rgbsps.c \ No newline at end of file
diff --git a/quantum/config_common.h b/quantum/config_common.h
index f3897dc2ce..17c11faeb6 100644
--- a/quantum/config_common.h
+++ b/quantum/config_common.h
@@ -77,53 +77,7 @@
77 } while(0) 77 } while(0)
78# else 78# else
79# error "USART configuration is needed." 79# error "USART configuration is needed."
80#endif 80# endif
81
82// I'm fairly sure these aren't needed, but oh well - Jack
83
84/*
85 * PS/2 Interrupt configuration
86 */
87#ifdef PS2_USE_INT
88/* uses INT1 for clock line(ATMega32U4) */
89#define PS2_CLOCK_PORT PORTD
90#define PS2_CLOCK_PIN PIND
91#define PS2_CLOCK_DDR DDRD
92#define PS2_CLOCK_BIT 1
93
94#define PS2_DATA_PORT PORTD
95#define PS2_DATA_PIN PIND
96#define PS2_DATA_DDR DDRD
97#define PS2_DATA_BIT 0
98
99#define PS2_INT_INIT() do { \
100 EICRA |= ((1<<ISC11) | \
101 (0<<ISC10)); \
102} while (0)
103#define PS2_INT_ON() do { \
104 EIMSK |= (1<<INT1); \
105} while (0)
106#define PS2_INT_OFF() do { \
107 EIMSK &= ~(1<<INT1); \
108} while (0)
109#define PS2_INT_VECT INT1_vect
110#endif
111
112/*
113 * PS/2 Busywait configuration
114 */
115#ifdef PS2_USE_BUSYWAIT
116#define PS2_CLOCK_PORT PORTD
117#define PS2_CLOCK_PIN PIND
118#define PS2_CLOCK_DDR DDRD
119#define PS2_CLOCK_BIT 1
120
121#define PS2_DATA_PORT PORTD
122#define PS2_DATA_PIN PIND
123#define PS2_DATA_DDR DDRD
124#define PS2_DATA_BIT 0
125#endif
126
127#endif 81#endif
128 82
129#endif 83#endif
diff --git a/quantum/keymap_extras/keymap_jp.h b/quantum/keymap_extras/keymap_jp.h
new file mode 100644
index 0000000000..e81b5952e0
--- /dev/null
+++ b/quantum/keymap_extras/keymap_jp.h
@@ -0,0 +1,62 @@
1/* JP106-layout (Japanese Standard)
2 *
3 * For more information, see
4 * http://www2d.biglobe.ne.jp/~msyk/keyboard/layout/usbkeycode.html
5 * note: This website is written in Japanese.
6 */
7
8
9#ifndef KEYMAP_JP_H
10#define KEYMAP_JP_H
11
12
13#include "keymap.h"
14
15
16#define JP_ZHTG KC_GRV // hankaku/zenkaku|kanzi
17#define JP_YEN KC_INT3 // yen, |
18#define JP_CIRC KC_EQL // ^, ~
19#define JP_AT KC_LBRC // @, `
20#define JP_LBRC KC_RBRC // [, {
21#define JP_COLN KC_QUOT // :, *
22#define JP_RBRC KC_NUHS // ], }
23#define JP_BSLS KC_INT1 // \, _
24#define JP_MHEN KC_INT5 // muhenkan
25#define JP_HENK KC_INT4 // henkan
26#define JP_KANA KC_INT2 // katakana/hiragana|ro-mazi
27
28
29//Aliases for shifted symbols
30#define JP_DQT LSFT(KC_2) // "
31#define JP_AMPR LSFT(KC_6) // &
32#define JP_QUOT LSFT(KC_7) // '
33#define JP_LPRN LSFT(KC_8) // (
34#define JP_RPRN LSFT(KC_9) // )
35#define JP_EQL LSFT(KC_MINS) // =
36#define JP_TILD LSFT(JP_CIRC) // ~
37#define JP_PIPE LSFT(JP_YEN) // |
38#define JP_GRV LSFT(JP_AT) // `
39#define JP_LCBR LSFT(JP_LBRC) // {
40#define JP_PLUS LSFT(KC_SCLN) // +
41#define JP_ASTR LSFT(JP_COLN) // *
42#define JP_RCBR LSFT(JP_RBRC) // }
43#define JP_UNDS LSFT(JP_BSLS) // _
44
45
46// These symbols are correspond to US101-layout.
47#define JP_MINS KC_MINS // -
48#define JP_SCLN KC_SCLN // ;
49#define JP_COMM KC_COMM // ,
50#define JP_DOT KC_DOT // .
51#define JP_SLSH KC_SLSH // /
52// shifted
53#define JP_EXLM KC_EXLM // !
54#define JP_HASH KC_HASH // #
55#define JP_DLR KC_DLR // $
56#define JP_PERC KC_PERC // %
57#define JP_LT KC_LT // <
58#define JP_GT KC_GT // >
59#define JP_QUES KC_QUES // ?
60
61
62#endif
diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h
index 065eeb5f6a..f17cfa6cf2 100644
--- a/quantum/process_keycode/process_unicode.h
+++ b/quantum/process_keycode/process_unicode.h
@@ -22,6 +22,7 @@ void register_hex(uint16_t hex);
22bool process_unicode(uint16_t keycode, keyrecord_t *record); 22bool process_unicode(uint16_t keycode, keyrecord_t *record);
23 23
24#ifdef UNICODEMAP_ENABLE 24#ifdef UNICODEMAP_ENABLE
25void unicode_map_input_error(void);
25bool process_unicode_map(uint16_t keycode, keyrecord_t *record); 26bool process_unicode_map(uint16_t keycode, keyrecord_t *record);
26#endif 27#endif
27 28
diff --git a/readme.md b/readme.md
index 18ad1a7941..a92ae4c1dc 100644
--- a/readme.md
+++ b/readme.md
@@ -911,7 +911,33 @@ In `quantum/keymap_extras/`, you'll see various language files - these work the
911 911
912## Unicode support 912## Unicode support
913 913
914You can currently send 4 hex digits with your OS-specific modifier key (RALT for OSX with the "Unicode Hex Input" layout, see [this article](http://www.poynton.com/notes/misc/mac-unicode-hex-input.html) to learn more) - this is currently limited to supporting one OS at a time, and requires a recompile for switching. 8 digit hex codes are being worked on. The keycode function is `UC(n)`, where *n* is a 4 digit hexidecimal. Enable from the Makefile. 914There are three Unicode keymap definition method available in QMK:
915
916### UNICODE_ENABLE
917
918Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in
919keymap file, where *n* is a 4 digit hexadecimal.
920
921### UNICODEMAP_ENABLE
922
923Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping
924table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file.
925The keycode function is `X(n)` where *n* is the array index of the mapping
926table.
927
928### UCIS_ENABLE
929
930TBD
931
932Unicode input in QMK works by inputing a sequence of characters to the OS,
933sort of like macro. Unfortunately, each OS has different ideas on how Unicode is inputted.
934
935This is the current list of Unicode input method in QMK:
936
937* UC_OSX: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex.
938* UC_LNX: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else.
939* UC_WIN: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead.
940* UC_WINC: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows.
915 941
916## Backlight Breathing 942## Backlight Breathing
917 943
@@ -1157,6 +1183,135 @@ The firmware supports 5 different light effects, and the color (hue, saturation,
1157 1183
1158Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20. 1184Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20.
1159 1185
1186## PS/2 Mouse Support
1187
1188Its possible to hook up a PS/2 mouse (for example touchpads or trackpoints) to your keyboard as a composite device.
1189
1190Then, decide whether to use USART (best), interrupts (better) or busywait (not recommended), and enable the relevant option.
1191
1192### Busywait version
1193
1194Note: This is not recommended, you may encounter jerky movement or unsent inputs. Please use interrupt or USART version if possible.
1195
1196In rules.mk:
1197
1198```
1199PS2_MOUSE_ENABLE = yes
1200PS2_USE_BUSYWAIT = yes
1201```
1202
1203In your keyboard config.h:
1204
1205```
1206#ifdef PS2_USE_BUSYWAIT
1207# define PS2_CLOCK_PORT PORTD
1208# define PS2_CLOCK_PIN PIND
1209# define PS2_CLOCK_DDR DDRD
1210# define PS2_CLOCK_BIT 1
1211# define PS2_DATA_PORT PORTD
1212# define PS2_DATA_PIN PIND
1213# define PS2_DATA_DDR DDRD
1214# define PS2_DATA_BIT 2
1215#endif
1216```
1217
1218### Interrupt version
1219
1220The following example uses D2 for clock and D5 for data. You can use any INT or PCINT pin for clock, and any pin for data.
1221
1222In rules.mk:
1223
1224```
1225PS2_MOUSE_ENABLE = yes
1226PS2_USE_INT = yes
1227```
1228
1229In your keyboard config.h:
1230
1231```
1232#ifdef PS2_USE_INT
1233#define PS2_CLOCK_PORT PORTD
1234#define PS2_CLOCK_PIN PIND
1235#define PS2_CLOCK_DDR DDRD
1236#define PS2_CLOCK_BIT 2
1237#define PS2_DATA_PORT PORTD
1238#define PS2_DATA_PIN PIND
1239#define PS2_DATA_DDR DDRD
1240#define PS2_DATA_BIT 5
1241
1242#define PS2_INT_INIT() do { \
1243 EICRA |= ((1<<ISC21) | \
1244 (0<<ISC20)); \
1245} while (0)
1246#define PS2_INT_ON() do { \
1247 EIMSK |= (1<<INT2); \
1248} while (0)
1249#define PS2_INT_OFF() do { \
1250 EIMSK &= ~(1<<INT2); \
1251} while (0)
1252#define PS2_INT_VECT INT2_vect
1253#endif
1254```
1255
1256### USART version
1257
1258To use USART on the ATMega32u4, you have to use PD5 for clock and PD2 for data. If one of those are unavailable, you need to use interrupt version.
1259
1260In rules.mk:
1261
1262```
1263PS2_MOUSE_ENABLE = yes
1264PS2_USE_USART = yes
1265```
1266
1267In your keyboard config.h:
1268
1269```
1270#ifdef PS2_USE_USART
1271#define PS2_CLOCK_PORT PORTD
1272#define PS2_CLOCK_PIN PIND
1273#define PS2_CLOCK_DDR DDRD
1274#define PS2_CLOCK_BIT 5
1275#define PS2_DATA_PORT PORTD
1276#define PS2_DATA_PIN PIND
1277#define PS2_DATA_DDR DDRD
1278#define PS2_DATA_BIT 2
1279
1280/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
1281/* set DDR of CLOCK as input to be slave */
1282#define PS2_USART_INIT() do { \
1283 PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
1284 PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
1285 UCSR1C = ((1 << UMSEL10) | \
1286 (3 << UPM10) | \
1287 (0 << USBS1) | \
1288 (3 << UCSZ10) | \
1289 (0 << UCPOL1)); \
1290 UCSR1A = 0; \
1291 UBRR1H = 0; \
1292 UBRR1L = 0; \
1293} while (0)
1294#define PS2_USART_RX_INT_ON() do { \
1295 UCSR1B = ((1 << RXCIE1) | \
1296 (1 << RXEN1)); \
1297} while (0)
1298#define PS2_USART_RX_POLL_ON() do { \
1299 UCSR1B = (1 << RXEN1); \
1300} while (0)
1301#define PS2_USART_OFF() do { \
1302 UCSR1C = 0; \
1303 UCSR1B &= ~((1 << RXEN1) | \
1304 (1 << TXEN1)); \
1305} while (0)
1306#define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
1307#define PS2_USART_RX_DATA UDR1
1308#define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
1309#define PS2_USART_RX_VECT USART1_RX_vect
1310#endif
1311#endif
1312#endif
1313```
1314
1160## Safety Considerations 1315## Safety Considerations
1161 1316
1162You probably don't want to "brick" your keyboard, making it impossible 1317You probably don't want to "brick" your keyboard, making it impossible
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c
index 8a7272bbc5..0c81e83612 100644
--- a/tmk_core/common/avr/suspend.c
+++ b/tmk_core/common/avr/suspend.c
@@ -47,6 +47,7 @@ void suspend_idle(uint8_t time)
47 sleep_disable(); 47 sleep_disable();
48} 48}
49 49
50#ifndef NO_SUSPEND_POWER_DOWN
50/* Power down MCU with watchdog timer 51/* Power down MCU with watchdog timer
51 * wdto: watchdog timer timeout defined in <avr/wdt.h> 52 * wdto: watchdog timer timeout defined in <avr/wdt.h>
52 * WDTO_15MS 53 * WDTO_15MS
@@ -61,6 +62,7 @@ void suspend_idle(uint8_t time)
61 * WDTO_8S 62 * WDTO_8S
62 */ 63 */
63static uint8_t wdt_timeout = 0; 64static uint8_t wdt_timeout = 0;
65
64static void power_down(uint8_t wdto) 66static void power_down(uint8_t wdto)
65{ 67{
66#ifdef PROTOCOL_LUFA 68#ifdef PROTOCOL_LUFA
@@ -98,19 +100,19 @@ static void power_down(uint8_t wdto)
98 // Disable watchdog after sleep 100 // Disable watchdog after sleep
99 wdt_disable(); 101 wdt_disable();
100} 102}
103#endif
101 104
102void suspend_power_down(void) 105void suspend_power_down(void)
103{ 106{
107#ifndef NO_SUSPEND_POWER_DOWN
104 power_down(WDTO_15MS); 108 power_down(WDTO_15MS);
109#endif
105} 110}
106 111
107__attribute__ ((weak)) void matrix_power_up(void) {} 112__attribute__ ((weak)) void matrix_power_up(void) {}
108__attribute__ ((weak)) void matrix_power_down(void) {} 113__attribute__ ((weak)) void matrix_power_down(void) {}
109bool suspend_wakeup_condition(void) 114bool suspend_wakeup_condition(void)
110{ 115{
111#ifdef BACKLIGHT_ENABLE
112 backlight_set(0);
113#endif
114 matrix_power_up(); 116 matrix_power_up();
115 matrix_scan(); 117 matrix_scan();
116 matrix_power_down(); 118 matrix_power_down();
@@ -126,10 +128,9 @@ void suspend_wakeup_init(void)
126 // clear keyboard state 128 // clear keyboard state
127 clear_keyboard(); 129 clear_keyboard();
128#ifdef BACKLIGHT_ENABLE 130#ifdef BACKLIGHT_ENABLE
129 backlight_set(0);
130 backlight_init(); 131 backlight_init();
131#endif 132#endif
132led_set(host_keyboard_leds()); 133 led_set(host_keyboard_leds());
133} 134}
134 135
135#ifndef NO_SUSPEND_POWER_DOWN 136#ifndef NO_SUSPEND_POWER_DOWN
diff --git a/tmk_core/common/backlight.c b/tmk_core/common/backlight.c
index c9e8fd3fd2..0e0ad2d154 100644
--- a/tmk_core/common/backlight.c
+++ b/tmk_core/common/backlight.c
@@ -36,9 +36,9 @@ void backlight_increase(void)
36 if(backlight_config.level < BACKLIGHT_LEVELS) 36 if(backlight_config.level < BACKLIGHT_LEVELS)
37 { 37 {
38 backlight_config.level++; 38 backlight_config.level++;
39 backlight_config.enable = 1;
40 eeconfig_update_backlight(backlight_config.raw);
41 } 39 }
40 backlight_config.enable = 1;
41 eeconfig_update_backlight(backlight_config.raw);
42 dprintf("backlight increase: %u\n", backlight_config.level); 42 dprintf("backlight increase: %u\n", backlight_config.level);
43 backlight_set(backlight_config.level); 43 backlight_set(backlight_config.level);
44} 44}
diff --git a/tmk_core/protocol/ps2_mouse.c b/tmk_core/protocol/ps2_mouse.c
index c3e8b3c1c3..82f6966e8e 100644
--- a/tmk_core/protocol/ps2_mouse.c
+++ b/tmk_core/protocol/ps2_mouse.c
@@ -26,6 +26,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
26#include "print.h" 26#include "print.h"
27#include "debug.h" 27#include "debug.h"
28 28
29#ifndef PS2_INIT_DELAY
30#define PS2_INIT_DELAY 1000
31#endif
29 32
30static report_mouse_t mouse_report = {}; 33static report_mouse_t mouse_report = {};
31 34
@@ -39,7 +42,7 @@ uint8_t ps2_mouse_init(void) {
39 42
40 ps2_host_init(); 43 ps2_host_init();
41 44
42 _delay_ms(1000); // wait for powering up 45 _delay_ms(PS2_INIT_DELAY); // wait for powering up
43 46
44 // send Reset 47 // send Reset
45 rcv = ps2_host_send(0xFF); 48 rcv = ps2_host_send(0xFF);