Compare commits

...
10 Commits
Author SHA1 Message Date
Wilba6582 66ef1e3d67 RAMA M6-B and IS31FL3218 driver (#4021)
* Initial RAMA M6-B commit.

* Moved IS31FL3218 driver, minor cleanups

* Refactor, added dynamic keymap.

* Added dynamic keymaps to RAMA M6-A

* Refactor M6-A and M6-B to use common code.

* Formatting

* Cleanup

* Cleanup

* Changes from review
2018-09-30 11:35:10 -04:00
Wilba6582 6734cd9c5c Keyboard: Zeal60: Fix getting backlight values "id_*_indicator_row_col" (#4030) 2018-09-30 07:31:23 -07:00
Alexander Kagno 3875d6f581 Keymap: Added Leader Key Functionality (#4025)
* deleting arkag branch, forcibly moving changes over to master

* fade_color function added, not tested

* added half functions some stuff

* surround_type function implemented and working.

* added flashing function and removed fading, flashing supports infinite flashing along with controlled number flashes

* added a fade state machine and functionality

* build optimizations, changed fade to bounce between bounds rather than roll over, added a HALMAK layout

* changes to sleep breath function, changed how I will switch to HALMAK

* support for halmak added

* support for activity detection added, condensed fading and flashing state machines, removed support for HALMAK and COLEMAK because arkag is stupid

* changed sleep and inactive behaviors, now the color shifting reverses on state change, yay! save_color and reset_color are made to enable layer color changing to look cooler.

* reformatted some if statements in state detection

* changes to force fade to pause on boot, or plug in.

* Attempting to move over to userspace, pushing to repository for help

* userspace stuff....

* userspace stuff....

* layout changes, working userspace,

Removed left side shift and replaced it with a MT() for LSFT and SPC. Userspace seems to be working properly now! HURRAY

* Layout change

Removed space/shift and reset modifiers to what they were originally. Added homerow modifiers.

* Removed excessive tabs in files

* Moved mods on homerow around...

* changes recommended by @drashna

* removed homerow mods, more flashy lighting!

* changed delays for lighting.

* velocikey code retro fit into userspace to match typing speed

currently "working" but isn't as reactive as I want.

* Readme and other documentation hidden throughout code

* Added a pretty picture

* pretty picture actually added

* More readme updates

* Velocikey now working inside my userspace!

* Changed repo macro and fixed readme

* Removed media layer, moved media control to LAZY layer

* fixed more merge issues when I had to merge...

* implemented some leader key stuff

* removed merge garbage...

* changes requested by @drashna, leader key switch from macros
2018-09-29 17:51:06 -07:00
Yan-Fa Li 170507896d Keyboard: Update info.json to match LAYOUT (#4027)
* Update info.json to match LAYOUT

* update mf68_ble info.json

LAYOUT -> LAYOUT_68_ansi
2018-09-29 16:16:21 -07:00
izzy84075 92d95ba1e1 Keyboard: Add basic support for the YD68 / YD68v2 PCBs. (#4020)
* Add basic support for the YD68 / YD68v2.

Keymap and WS2812 underlighting work. Capslock LED should work, though I don't have one populated to test. Backlight LEDs are not set up, as they're not on a hardware PWM pin, could be set up as software.

* Fix Imgur link

* Fix default keymap to match the stock firmware

* Fix the Hardware Supported line and add a short description
2018-09-29 12:44:54 -07:00
noroadsleft 68854f0735 Keyboard: converter/hp_46010a: rename layout macro to LAYOUT (#4024)
Messed up in my previous PR (#4017) by providing the wrong matrix name.

Fixing by changing the matrix name instead, because there's only one at this point. Thought it made more sense this way.
2018-09-29 12:44:12 -07:00
Takeshi ISHII cd215209ef Helix led_test keymap reduce size (#4023)
* Helix: make rgblight modes selectable.

No change in build result.

* edit the comment of helix/rev2/keymaps/default/keymap.c

* Helix led_test keymap: reduced the size.
2018-09-29 10:40:54 -07:00
marksard 4f64951080 Keymap: Fixed a possible of buffer overflow. (#4016)
Update inline funnction to static inline function.
Fixed error of if enabe ADJUST_MACRO_ENABLE.
2018-09-29 10:25:03 -07:00
Shaleen Jain 1da2f8d546 Keymap: tada68: add shalzz's layout (#4019) 2018-09-29 08:49:51 -07:00
noroadsleft 9f8bbe2f3f Keyboard: converter/hp_46010a: Configurator support (#4017) 2018-09-29 08:47:16 -07:00
46 changed files with 1855 additions and 569 deletions

No files matched your search

+102
View File
@@ -0,0 +1,102 @@
/* Copyright 2018 Jason Williams (Wilba)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "is31fl3218.h"
#include "i2c_master.h"
// This is the full 8-bit address
#define ISSI_ADDRESS 0b10101000
// These are the register addresses
#define ISSI_REG_SHUTDOWN 0x00
#define ISSI_REG_PWM 0x01
#define ISSI_REG_CONTROL 0x13
#define ISSI_REG_UPDATE 0x16
#define ISSI_REG_RESET 0x17
// Default timeout if no I2C response
#define ISSI_TIMEOUT 100
// Reusable buffer for transfers
uint8_t g_twi_transfer_buffer[20];
// IS31FL3218 has 18 PWM outputs and a fixed I2C address, so no chaining.
// If used as RGB LED driver, LEDs are assigned RGB,RGB,RGB,RGB,RGB,RGB
uint8_t g_pwm_buffer[18];
bool g_pwm_buffer_update_required = false;
void IS31FL3218_write_register( uint8_t reg, uint8_t data )
{
g_twi_transfer_buffer[0] = reg;
g_twi_transfer_buffer[1] = data;
i2c_transmit( ISSI_ADDRESS, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
}
void IS31FL3218_write_pwm_buffer( uint8_t *pwm_buffer )
{
g_twi_transfer_buffer[0] = ISSI_REG_PWM;
for ( int i=0; i<18; i++ ) {
g_twi_transfer_buffer[1+i] = pwm_buffer[i];
}
i2c_transmit( ISSI_ADDRESS, g_twi_transfer_buffer, 19, ISSI_TIMEOUT);
}
void IS31FL3218_init(void)
{
// In case we ever want to reinitialize (?)
IS31FL3218_write_register( ISSI_REG_RESET, 0x00 );
// Turn off software shutdown
IS31FL3218_write_register( ISSI_REG_SHUTDOWN, 0x01 );
// Set all PWM values to zero
for ( uint8_t i = 0; i < 18; i++ ) {
IS31FL3218_write_register( ISSI_REG_PWM+i, 0x00 );
}
// Enable all channels
for ( uint8_t i = 0; i < 3; i++ ) {
IS31FL3218_write_register( ISSI_REG_CONTROL+i, 0b00111111 );
}
// Load PWM registers and LED Control register data
IS31FL3218_write_register( ISSI_REG_UPDATE, 0x01 );
}
void IS31FL3218_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
{
g_pwm_buffer[index * 3 + 0] = red;
g_pwm_buffer[index * 3 + 1] = green;
g_pwm_buffer[index * 3 + 2] = blue;
g_pwm_buffer_update_required = true;
}
void IS31FL3218_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
{
for ( int i = 0; i < 6; i++ ) {
IS31FL3218_set_color( i, red, green, blue );
}
}
void IS31FL3218_update_pwm_buffers(void)
{
if ( g_pwm_buffer_update_required ) {
IS31FL3218_write_pwm_buffer( g_pwm_buffer );
// Load PWM registers and LED Control register data
IS31FL3218_write_register( ISSI_REG_UPDATE, 0x01 );
}
g_pwm_buffer_update_required = false;
}
+24
View File
@@ -0,0 +1,24 @@
/* Copyright 2018 Jason Williams (Wilba)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
void IS31FL3218_init(void);
void IS31FL3218_set_color( int index, uint8_t red, uint8_t green, uint8_t blue );
void IS31FL3218_set_color_all( uint8_t red, uint8_t green, uint8_t blue );
void IS31FL3218_update_pwm_buffers(void);
+1 -3
View File
@@ -35,7 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* `-----------------------------------------------------------------------------------' `-------------------' * `-----------------------------------------------------------------------------------' `-------------------'
*/ */
#define LAYOUT_HP_46010A( \ #define LAYOUT( \
KEY_RES, KEY_STOP, KEY_F1, KEY_F2, KEY_F3, KEY_F4,KEY_MENU,KEY_USER, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_CLRL, KEY_CLRD, KEY_B1, KEY_B2, KEY_B3, KEY_B4, \ KEY_RES, KEY_STOP, KEY_F1, KEY_F2, KEY_F3, KEY_F4,KEY_MENU,KEY_USER, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_CLRL, KEY_CLRD, KEY_B1, KEY_B2, KEY_B3, KEY_B4, \
KEY_GRAV, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_0, KEY_MINU, KEY_PLUS, KEY_BACK, KEY_INSL, KEY_DELL, KEY_MULT, KEY_DIV, KEY_ADD, KEY_SUBT, \ KEY_GRAV, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_0, KEY_MINU, KEY_PLUS, KEY_BACK, KEY_INSL, KEY_DELL, KEY_MULT, KEY_DIV, KEY_ADD, KEY_SUBT, \
KEY_TAB, KEY_Q,KEY_W, KEY_E, KEY_R, KEY_T, KEY_Y, KEY_U, KEY_I, KEY_O, KEY_P, KEY_LBRA, KEY_RBRA, KEY_PIPE, KEY_INSC, KEY_DELC, KEY_P7, KEY_P8, KEY_P9, KEY_PADE, \ KEY_TAB, KEY_Q,KEY_W, KEY_E, KEY_R, KEY_T, KEY_Y, KEY_U, KEY_I, KEY_O, KEY_P, KEY_LBRA, KEY_RBRA, KEY_PIPE, KEY_INSC, KEY_DELC, KEY_P7, KEY_P8, KEY_P9, KEY_PADE, \
@@ -58,5 +58,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{KEY_B1, KEY_P0, KEY_B2, KC_NO, KEY_B3, KEY_PDOT, KEY_B4, KC_NO }, \ {KEY_B1, KEY_P0, KEY_B2, KC_NO, KEY_B3, KEY_PDOT, KEY_B4, KC_NO }, \
{KEY_B, KEY_V, KEY_C, KEY_X, KEY_Z, KEY_PRNT, KEY_DELE, KEY_N }, \ {KEY_B, KEY_V, KEY_C, KEY_X, KEY_Z, KEY_PRNT, KEY_DELE, KEY_N }, \
} }
#define LAYOUT LAYOUT_HP_46010A
+115
View File
@@ -3,4 +3,119 @@
"keyboard_folder": "converter/HP_46010A", "keyboard_folder": "converter/HP_46010A",
"url": "https://deskthority.net/wiki/HP_46010A", "url": "https://deskthority.net/wiki/HP_46010A",
"maintainer": "listofoptions", "maintainer": "listofoptions",
"width": 22,
"height": 7,
"layouts": {
"LAYOUT": {
"layout": [
{"label":"Reset", "x":0, "y":0},
{"label":"Stop", "x":1, "y":0},
{"label":"F1", "x":2.5, "y":0, "w":1.25},
{"label":"F2", "x":3.75, "y":0, "w":1.25},
{"label":"F3", "x":5, "y":0, "w":1.25},
{"label":"F4", "x":6.25, "y":0, "w":1.25},
{"label":"Menu", "x":7.5, "y":0},
{"label":"User", "x":8.5, "y":0},
{"label":"F5", "x":9.5, "y":0, "w":1.25},
{"label":"F6", "x":10.75, "y":0, "w":1.25},
{"label":"F7", "x":12, "y":0, "w":1.25},
{"label":"F8", "x":13.25, "y":0, "w":1.25},
{"label":"Clear line", "x":15, "y":0},
{"label":"Clear display", "x":16, "y":0},
{"x":18, "y":0},
{"x":19, "y":0},
{"x":20, "y":0},
{"x":21, "y":0},
{"label":"`", "x":0, "y":2, "w":1.25},
{"label":"1", "x":1.25, "y":2},
{"label":"2", "x":2.25, "y":2},
{"label":"3", "x":3.25, "y":2},
{"label":"4", "x":4.25, "y":2},
{"label":"5", "x":5.25, "y":2},
{"label":"6", "x":6.25, "y":2},
{"label":"7", "x":7.25, "y":2},
{"label":"8", "x":8.25, "y":2},
{"label":"9", "x":9.25, "y":2},
{"label":"0", "x":10.25, "y":2},
{"label":"-", "x":11.25, "y":2},
{"label":"=", "x":12.25, "y":2},
{"label":"Backspace", "x":13.25, "y":2, "w":1.5},
{"label":"Insert line", "x":15, "y":2},
{"label":"Delete line", "x":16, "y":2},
{"label":"*", "x":18, "y":2},
{"label":"/", "x":19, "y":2},
{"label":"+", "x":20, "y":2},
{"label":"-", "x":21, "y":2},
{"label":"Tab", "x":0, "y":3, "w":1.75},
{"label":"Q", "x":1.75, "y":3},
{"label":"W", "x":2.75, "y":3},
{"label":"E", "x":3.75, "y":3},
{"label":"R", "x":4.75, "y":3},
{"label":"T", "x":5.75, "y":3},
{"label":"Y", "x":6.75, "y":3},
{"label":"U", "x":7.75, "y":3},
{"label":"I", "x":8.75, "y":3},
{"label":"O", "x":9.75, "y":3},
{"label":"P", "x":10.75, "y":3},
{"label":"[", "x":11.75, "y":3},
{"label":"]", "x":12.75, "y":3},
{"label":"\\", "x":13.75, "y":3},
{"label":"Insert char", "x":15, "y":3},
{"label":"Delete char", "x":16, "y":3},
{"label":"7", "x":18, "y":3},
{"label":"8", "x":19, "y":3},
{"label":"9", "x":20, "y":3},
{"label":"Enter", "x":21, "y":3},
{"label":"Caps Lock", "x":0, "y":4},
{"label":"Ctrl", "x":1, "y":4},
{"label":"A", "x":2, "y":4},
{"label":"S", "x":3, "y":4},
{"label":"D", "x":4, "y":4},
{"label":"F", "x":5, "y":4},
{"label":"G", "x":6, "y":4},
{"label":"H", "x":7, "y":4},
{"label":"J", "x":8, "y":4},
{"label":"K", "x":9, "y":4},
{"label":"L", "x":10, "y":4},
{"label":";", "x":11, "y":4},
{"label":"'", "x":12, "y":4},
{"label":"Return", "x":13, "y":4, "w":1.75},
{"label":"Cursor", "x":15, "y":4},
{"label":"Prev", "x":16, "y":4},
{"label":"4", "x":18, "y":4},
{"label":"5", "x":19, "y":4},
{"label":"6", "x":20, "y":4},
{"label":",", "x":21, "y":4},
{"label":"Del", "x":0, "y":5},
{"label":"Shift", "x":1.25, "y":5, "w":1.25},
{"label":"Z", "x":2.5, "y":5},
{"label":"X", "x":3.5, "y":5},
{"label":"C", "x":4.5, "y":5},
{"label":"V", "x":5.5, "y":5},
{"label":"B", "x":6.5, "y":5},
{"label":"N", "x":7.5, "y":5},
{"label":"M", "x":8.5, "y":5},
{"label":",", "x":9.5, "y":5},
{"label":".", "x":10.5, "y":5},
{"label":"/", "x":11.5, "y":5},
{"label":"Shift", "x":12.5, "y":5, "w":1.25},
{"label":"Select", "x":14, "y":5},
{"label":"Up", "x":15, "y":5},
{"label":"Next", "x":16, "y":5},
{"label":"1", "x":18, "y":5},
{"label":"2", "x":19, "y":5},
{"label":"3", "x":20, "y":5},
{"label":"Tab", "x":21, "y":5, "h":2},
{"label":"Win", "x":0, "y":6},
{"label":"Extend Char", "x":2.5, "y":6},
{"x":3.5, "y":6, "w":8},
{"label":"Extend Char", "x":11.5, "y":6},
{"label":"Left", "x":14, "y":6},
{"label":"Down", "x":15, "y":6},
{"label":"Right", "x":16, "y":6},
{"label":"0", "x":18, "y":6, "w":2},
{"label":".", "x":20, "y":6}
]
}
}
} }
+13
View File
@@ -48,4 +48,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DISABLE_LEADER #define DISABLE_LEADER
#endif // USE_Link_Time_Optimization #endif // USE_Link_Time_Optimization
#if defined(LED_ANIMATIONS) || defined(RGBLIGHT_ANIMATIONS)
#undef RGBLIGHT_ANIMATIONS
#define RGBLIGHT_EFFECT_BREATHING
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
#define RGBLIGHT_EFFECT_SNAKE
#define RGBLIGHT_EFFECT_KNIGHT
#define RGBLIGHT_EFFECT_CHRISTMAS
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
#define RGBLIGHT_EFFECT_RGB_TEST
#define RGBLIGHT_EFFECT_ALTERNATING
#endif
#endif /* CONFIG_H */ #endif /* CONFIG_H */
@@ -512,7 +512,7 @@ void music_scale_user(void)
// hook point for 'led_test' keymap // hook point for 'led_test' keymap
// 'default' keymap's led_test_init() is empty function, do nothing // 'default' keymap's led_test_init() is empty function, do nothing
// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(35); // 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST);
__attribute__ ((weak)) __attribute__ ((weak))
void led_test_init(void) {} void led_test_init(void) {}
@@ -214,7 +214,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
#endif #endif
#ifdef SSD1306OLED #ifdef SSD1306OLED
char keylog[20] = {}; char keylog[24] = {};
const char code_to_name[60] = { const char code_to_name[60] = {
' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
@@ -223,7 +223,7 @@ const char code_to_name[60] = {
'R', 'E', 'B', 'T', ' ', '-', ' ', '@', ' ', ' ', 'R', 'E', 'B', 'T', ' ', '-', ' ', '@', ' ', ' ',
' ', ';', ':', ' ', ',', '.', '/', ' ', ' ', ' '}; ' ', ';', ':', ' ', ',', '.', '/', ' ', ' ', ' '};
inline void set_keylog(uint16_t keycode, keyrecord_t *record) static inline void set_keylog(uint16_t keycode, keyrecord_t *record)
{ {
char name = ' '; char name = ' ';
uint8_t leds = host_keyboard_leds(); uint8_t leds = host_keyboard_leds();
@@ -246,6 +246,12 @@ inline void set_keylog(uint16_t keycode, keyrecord_t *record)
} }
#endif #endif
#ifdef RGBLIGHT_ENABLE
#define RGBLIGHT(mode) rgblight_mode(mode)
#else
#define RGBLIGHT(mode)
#endif
// define variables for reactive RGB // define variables for reactive RGB
int RGB_current_mode; int RGB_current_mode;
#ifdef ADJUST_MACRO_ENABLE #ifdef ADJUST_MACRO_ENABLE
@@ -263,12 +269,6 @@ void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
#define ADJUST_MACRO(layer1, layer2, layer3) #define ADJUST_MACRO(layer1, layer2, layer3)
#endif #endif
#ifdef RGBLIGHT_ENABLE
#define RGBLIGHT(mode) rgblight_mode(mode)
#else
#define RGBLIGHT(mode)
#endif
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef SSD1306OLED #ifdef SSD1306OLED
if (record->event.pressed) { if (record->event.pressed) {
@@ -344,7 +344,7 @@ void matrix_scan_user(void) {
iota_gfx_task(); // this is what updates the display continuously iota_gfx_task(); // this is what updates the display continuously
} }
inline void matrix_update(struct CharacterMatrix *dest, static inline void matrix_update(struct CharacterMatrix *dest,
const struct CharacterMatrix *source) { const struct CharacterMatrix *source) {
if (memcmp(dest->display, source->display, sizeof(dest->display))) { if (memcmp(dest->display, source->display, sizeof(dest->display))) {
memcpy(dest->display, source->display, sizeof(dest->display)); memcpy(dest->display, source->display, sizeof(dest->display));
@@ -367,13 +367,15 @@ const char helix_logo[]={
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,
0}; 0};
inline void render_logo(struct CharacterMatrix *matrix) {
static inline void render_logo(struct CharacterMatrix *matrix) {
matrix_write(matrix, helix_logo); matrix_write(matrix, helix_logo);
} }
const char mac_win_logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; const char mac_win_logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}};
inline void render_status(struct CharacterMatrix *matrix) {
static inline void render_status(struct CharacterMatrix *matrix) {
char buf[20]; char buf[20];
// Render to mode icon // Render to mode icon
+13 -3
View File
@@ -21,9 +21,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef CONFIG_USER_H #ifndef CONFIG_USER_H
#define CONFIG_USER_H #define CONFIG_USER_H
// if you need more program area, try uncomment follow line
#include "serial_config_simpleapi.h"
// place overrides here // place overrides here
// If you need more program area, try select and reduce rgblight modes to use.
// Selection of RGBLIGHT MODE to use.
#undef RGBLIGHT_EFFECT_BREATHING
#undef RGBLIGHT_EFFECT_RAINBOW_MOOD
#undef RGBLIGHT_EFFECT_RAINBOW_SWIRL
#undef RGBLIGHT_EFFECT_SNAKE
#undef RGBLIGHT_EFFECT_KNIGHT
#undef RGBLIGHT_EFFECT_CHRISTMAS
#undef RGBLIGHT_EFFECT_STATIC_GRADIENT
//#undef RGBLIGHT_EFFECT_RGB_TEST // led_test keymap need only this.
#undef RGBLIGHT_EFFECT_ALTERNATING
#endif /* CONFIG_USER_H */ #endif /* CONFIG_USER_H */
@@ -5,7 +5,7 @@ void led_test_init(void) {
static int scan_count = 0; static int scan_count = 0;
if( scan_count == 2 ) { if( scan_count == 2 ) {
rgblight_enable_noeeprom(); rgblight_enable_noeeprom();
rgblight_mode_noeeprom(35); rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST);
} }
if( scan_count < 3 ) scan_count ++; if( scan_count < 3 ) scan_count ++;
} }
@@ -15,6 +15,6 @@ void led_test_init(void) {
// can use this? // can use this?
void startup_user(void) { void startup_user(void) {
rgblight_enable_noeeprom(); rgblight_enable_noeeprom();
rgblight_mode_noeeprom(35); rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST);
} }
#endif #endif
+1 -1
View File
@@ -3,5 +3,5 @@
// save me space! // save me space!
#define NO_ACTION_MACRO #define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION #define NO_ACTION_FUNCTION
#define DISABLE_LEADER // #define DISABLE_LEADER
#define NO_MUSIC_MODE #define NO_MUSIC_MODE
+7 -7
View File
@@ -8,10 +8,10 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_2u_space_ortho( [_QWERTY] = LAYOUT_2u_space_ortho(
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_LEAD, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, QUOTE, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, QUOTE,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT,
M_PMOD, LRALT, M_SMOD, LOWER, RAISE, KC_SPC, KC_SLSH, LAZY, KC_LEFT, KC_DOWN, KC_RGHT), M_PMOD, LRALT, M_SMOD, LOWER, RAISE, KC_SPC, KC_SLSH, KC_BSLS, KC_LEFT, KC_DOWN, KC_RGHT),
[_RAISE] = LAYOUT_2u_space_ortho( [_RAISE] = LAYOUT_2u_space_ortho(
GRAVE, KC_1, KC_2, THREE, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, GRAVE, KC_1, KC_2, THREE, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
@@ -20,10 +20,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, KEEB, _______, _______, _______, M_OS, KC_PSLS, KC_PMNS, KC_PAST), _______, _______, _______, KEEB, _______, _______, _______, M_OS, KC_PSLS, KC_PMNS, KC_PAST),
[_LOWER] = LAYOUT_2u_space_ortho( [_LOWER] = LAYOUT_2u_space_ortho(
_______, _______, _______, _______, _______, _______, _______, M_ULIN, M_ITAL, _______, M_P_B, M_C_A_D, KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, M_P_B, M_C_A_D,
_______, _______, STRIKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
KC_CAPS, KC_DEL, _______, _______, _______, M_BOLD, _______, _______, _______, _______, KC_PGUP, _______, KC_CAPS, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______,
_______, _______, _______, _______, _______, _______, KC_BSLS, M_CALC, KC_HOME, KC_PGDN, KC_END), _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END),
[_KEEB] = LAYOUT_2u_space_ortho( [_KEEB] = LAYOUT_2u_space_ortho(
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
@@ -35,5 +35,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, M_TM, _______, M_SNIPT, M_SHRUG, _______, _______, KC_MUTE, _______, _______, _______, _______, _______, M_TM, _______, M_SNIPT, M_SHRUG, _______, _______, KC_MUTE,
_______, _______, _______, _______, _______, M_GGT, _______, M_UF, M_LOD, M_REPO, _______, _______, _______, _______, _______, _______, _______, M_GGT, _______, M_UF, M_LOD, M_REPO, _______, _______,
_______, _______, _______, _______, _______, _______, _______, M_TF, M_LENNY, _______, KC_VOLU, KC_MPLY, _______, _______, _______, _______, _______, _______, _______, M_TF, M_LENNY, _______, KC_VOLU, KC_MPLY,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), _______, _______, _______, _______, _______, _______, M_CALC, _______, KC_MPRV, KC_VOLD, KC_MNXT),
}; };
@@ -11,6 +11,7 @@ AUDIO_ENABLE = no
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
TAP_DANCE_ENABLE = yes TAP_DANCE_ENABLE = yes
UNICODE_ENABLE = yes UNICODE_ENABLE = yes
LEADER_ENABLE = yes
# save me space! # save me space!
EXTRAFLAGS += -flto EXTRAFLAGS += -flto
+1 -1
View File
@@ -5,7 +5,7 @@
"width": 17.25, "width": 17.25,
"height": 5, "height": 5,
"layouts": { "layouts": {
"LAYOUT": { "LAYOUT_68_ansi": {
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}] "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}]
} }
} }
+1 -1
View File
@@ -5,7 +5,7 @@
"width": 17.25, "width": 17.25,
"height": 5, "height": 5,
"layouts": { "layouts": {
"LAYOUT": { "LAYOUT_68_ansi": {
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}] "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}]
} }
} }
+21 -3
View File
@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef CONFIG_H #pragma once
#define CONFIG_H
#include "config_common.h" #include "config_common.h"
@@ -187,4 +186,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 1 //#define MIDI_TONE_KEYCODE_OCTAVES 1
#endif #define RGB_BACKLIGHT_ENABLED 0
#define DYNAMIC_KEYMAP_LAYER_COUNT 4
// EEPROM usage
// TODO: refactor with new user EEPROM code (coming soon)
#define EEPROM_MAGIC 0x451F
#define EEPROM_MAGIC_ADDR 32
// Bump this every time we change what we store
// This will automatically reset the EEPROM with defaults
// and avoid loading invalid data from the EEPROM
#define EEPROM_VERSION 0x07
#define EEPROM_VERSION_ADDR 34
// Backlight config starts after EEPROM version
#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35
// Dynamic keymap starts after backlight config (35+37)
#define DYNAMIC_KEYMAP_EEPROM_ADDR 72
+4 -312
View File
@@ -3,322 +3,14 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LAYOUT( LAYOUT(
TO(1), KC_A, KC_B, KC_C, KC_D, KC_E), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6),
LAYOUT( LAYOUT(
TO(2), KC_F, KC_G, KC_H, KC_I, KC_J), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO),
LAYOUT( LAYOUT(
TO(3), KC_K, KC_L, KC_M, KC_N, KC_O), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO),
LAYOUT( LAYOUT(
TO(4), KC_P, KC_Q, KC_R, KC_S, KC_T), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO) };
LAYOUT(
TO(5), KC_U, KC_V, KC_W, KC_X, KC_Y),
LAYOUT(
TO(0), KC_Z, KC_1, KC_2, KC_3, KC_4)};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
//keyevent_t event = record->event;
switch (id)
{
case 0:
if (record->event.pressed)
{
return MACRO(T(T), T(G), T(L), T(H), T(F), T(ENT), END);
}
break;
case 1:
if (record->event.pressed)
{
return MACRO(T(T), T(G), T(G), T(ENT), END);
}
break;
case 2:
if (record->event.pressed)
{
return MACRO(D(NO), T(L), U(NO), END);
}
break;
case 3:
if (record->event.pressed)
{
return MACRO(D(LCTL), T(Z), U(LCTL), END);
}
break;
case 4:
if (record->event.pressed)
{
return MACRO(D(LCTL), D(LSFT), T(Z), U(LSFT), U(LCTL), END);
}
break;
case 5:
if (record->event.pressed)
{
return MACRO(D(LCTL), T(X), U(LCTL), END);
}
break;
case 6:
if (record->event.pressed)
{
return MACRO(D(LCTL), T(C), U(LCTL), END);
}
break;
case 7:
if (record->event.pressed)
{
return MACRO(D(LCTL), T(V), U(LCTL), END);
}
break;
}
return MACRO_NONE;
}
// M6-A LEDs are connected to D6, B6, F5, B4, C7, F7
// This is 1-based because I copied it from Knops code.
void set_switch_led(int ledId, bool state)
{
if (state)
{
switch (ledId)
{
case 1:
PORTD |= (1 << 6);
break;
case 2:
PORTB |= (1 << 6);
break;
case 3:
PORTF |= (1 << 5);
break;
case 4:
PORTB |= (1 << 4);
break;
case 5:
PORTC |= (1 << 7);
break;
case 6:
PORTF |= (1 << 7);
break;
}
}
else
{
switch (ledId)
{
case 1:
PORTD &= ~(1 << 6);
break;
case 2:
PORTB &= ~(1 << 6);
break;
case 3:
PORTF &= ~(1 << 5);
break;
case 4:
PORTB &= ~(1 << 4);
break;
case 5:
PORTC &= ~(1 << 7);
break;
case 6:
PORTF &= ~(1 << 7);
break;
}
}
}
void set_layer_led(int layerId)
{
// UNUSED
}
void led_set_layer(int layer);
void matrix_init_user(void)
{
led_init_ports();
led_set_layer(0);
}
void matrix_scan_user(void)
{
}
// M6-A LEDs are connected to D6, B6, F5, B4, C7, F7
void led_init_ports()
{
// Switch #1
DDRD |= (1 << 6);
PORTD &= ~(1 << 6);
// Switch #2
DDRB |= (1 << 6);
PORTB &= ~(1 << 6);
// Switch #3
DDRF |= (1 << 5);
PORTF &= ~(1 << 5);
// Switch #4
DDRB |= (1 << 4);
PORTB &= ~(1 << 4);
// Switch #5
DDRC |= (1 << 7);
PORTC &= ~(1 << 7);
// Switch #6
DDRF |= (1 << 7);
PORTF &= ~(1 << 7);
}
void led_set_user(uint8_t usb_led)
{
if (usb_led & (1 << USB_LED_NUM_LOCK))
{
}
else
{
}
if (usb_led & (1 << USB_LED_CAPS_LOCK))
{
}
else
{
}
if (usb_led & (1 << USB_LED_SCROLL_LOCK))
{
}
else
{
}
if (usb_led & (1 << USB_LED_COMPOSE))
{
}
else
{
}
if (usb_led & (1 << USB_LED_KANA))
{
}
else
{
}
}
void led_set_layer(int layer)
{
switch (layer)
{
case 0:
set_switch_led(1, true);
set_switch_led(2, false);
set_switch_led(3, false);
set_switch_led(4, false);
set_switch_led(5, false);
set_switch_led(6, false);
break;
case 1:
set_switch_led(1, false);
set_switch_led(2, true);
set_switch_led(3, false);
set_switch_led(4, false);
set_switch_led(5, false);
set_switch_led(6, false);
break;
case 2:
set_switch_led(1, false);
set_switch_led(2, false);
set_switch_led(3, true);
set_switch_led(4, false);
set_switch_led(5, false);
set_switch_led(6, false);
break;
case 3:
set_switch_led(1, false);
set_switch_led(2, false);
set_switch_led(3, false);
set_switch_led(4, true);
set_switch_led(5, false);
set_switch_led(6, false);
break;
case 4:
set_switch_led(1, false);
set_switch_led(2, false);
set_switch_led(3, false);
set_switch_led(4, false);
set_switch_led(5, true);
set_switch_led(6, false);
break;
case 5:
set_switch_led(1, false);
set_switch_led(2, false);
set_switch_led(3, false);
set_switch_led(4, false);
set_switch_led(5, false);
set_switch_led(6, true);
break;
default:
set_switch_led(1, true);
set_switch_led(2, true);
set_switch_led(3, true);
set_switch_led(4, true);
set_switch_led(5, true);
set_switch_led(6, true);
break;
}
}
bool process_record_user(uint16_t keycode, keyrecord_t *record)
{
switch (keycode)
{
case TO(0):
if (record->event.pressed)
{
led_set_layer(0);
}
break;
case TO(1):
if (record->event.pressed)
{
led_set_layer(1);
}
break;
case TO(2):
if (record->event.pressed)
{
led_set_layer(2);
}
break;
case TO(3):
if (record->event.pressed)
{
led_set_layer(3);
}
break;
case TO(4):
if (record->event.pressed)
{
led_set_layer(4);
}
break;
case TO(5):
if (record->event.pressed)
{
led_set_layer(5);
}
break;
}
return true;
}
+1 -30
View File
@@ -1,4 +1,4 @@
/* Copyright 2018 Wilba /* Copyright 2018 Jason Williams (Wilba)
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -13,32 +13,3 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "m6_a.h"
/*
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}
*/
+1 -1
View File
@@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment):
make rama/m6_a:default make rama/m6_a:default
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. See 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).
+21 -23
View File
@@ -1,5 +1,7 @@
# project specific files
SRC = keyboards/rama/m6_b/m6_b.c
# MCU name # MCU name
#MCU = at90usb1286
MCU = atmega32u4 MCU = atmega32u4
# Processor frequency. # Processor frequency.
@@ -38,31 +40,27 @@ F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60) # Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section
# Boot Section Size in *bytes* BOOTLOADER = atmel-dfu
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options # Build Options
# change yes to no to disable # change yes to no to disable
# #
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= yes # Console for debug(+400) CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE ?= yes # Commands for debug and configuration COMMAND_ENABLE = no # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE ?= no # USB Nkey Rollover NKRO_ENABLE = yes # USB Nkey Rollover
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config) MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE ?= no # Unicode UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE ?= no # Audio output on port C6 AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
RAW_ENABLE = yes
DYNAMIC_KEYMAP_ENABLE = yes
+129
View File
@@ -0,0 +1,129 @@
/* Copyright 2018 Jason Williams (Wilba)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0x5241 // "RW"
#define PRODUCT_ID 0x006B // 6-B
#define DEVICE_VER 0x0001
#define MANUFACTURER RAMA.WORKS
#define PRODUCT RAMA M6-B
#define DESCRIPTION RAMA M6-B Macropad
/* key matrix size */
#define MATRIX_ROWS 1
#define MATRIX_COLS 6
/*
* Keyboard Matrix Assignments
*
* Change this to how you wired your keyboard
* COLS: AVR pins used for columns, left to right
* ROWS: AVR pins used for rows, top to bottom
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
*
*/
#define MATRIX_ROW_PINS { E6 }
#define MATRIX_COL_PINS { D4, B5, F4, D7, C6, F6 }
#define UNUSED_PINS
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
#define DIODE_DIRECTION COL2ROW
// #define BACKLIGHT_PIN B7
// #define BACKLIGHT_BREATHING
// #define BACKLIGHT_LEVELS 3
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCING_DELAY 5
/* define if matrix has ghost (lacks anti-ghosting diodes) */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
*/
// #define GRAVE_ESC_CTRL_OVERRIDE
/*
* Force NKRO
*
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
* makefile for this to work.)
*
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
* until the next keyboard reset.
*
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
* fully operational during normal computer usage.
*
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
* power-up.
*
*/
//#define FORCE_NKRO
/*
* Magic Key Options
*
* Magic keys are hotkey commands that allow control over firmware functions of
* the keyboard. They are best used in combination with the HID Listen program,
* found here: https://www.pjrc.com/teensy/hid_listen.html
*
* The options below allow the magic key functionality to be changed. This is
* useful if your keyboard/keypad is missing keys and you want magic key support.
*
*/
/* key combination for magic key command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
#define RGB_BACKLIGHT_ENABLED 1
#define DYNAMIC_KEYMAP_LAYER_COUNT 4
// EEPROM usage
// TODO: refactor with new user EEPROM code (coming soon)
#define EEPROM_MAGIC 0x451F
#define EEPROM_MAGIC_ADDR 32
// Bump this every time we change what we store
// This will automatically reset the EEPROM with defaults
// and avoid loading invalid data from the EEPROM
#define EEPROM_VERSION 0x07
#define EEPROM_VERSION_ADDR 34
// Backlight config starts after EEPROM version
#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35
// Dynamic keymap starts after backlight config (35+37)
#define DYNAMIC_KEYMAP_EEPROM_ADDR 72
+19
View File
@@ -0,0 +1,19 @@
{
"keyboard_name": "m6-b",
"url": "",
"maintainer": "qmk",
"width": 3,
"height": 2,
"layouts": {
"LAYOUT": {
"layout": [
{ "x": 0, "y": 0 },
{ "x": 1, "y": 0 },
{ "x": 2, "y": 0 },
{ "x": 0, "y": 1 },
{ "x": 1, "y": 1 },
{ "x": 2, "y": 1 }
]
}
}
}
@@ -0,0 +1,16 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LAYOUT(
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6),
LAYOUT(
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO),
LAYOUT(
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO),
LAYOUT(
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO) };
+230
View File
@@ -0,0 +1,230 @@
/* Copyright 2018 Jason Williams (Wilba)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "m6_b.h"
#include "m6_b_api.h"
// Check that no backlight functions are called
#if RGB_BACKLIGHT_ENABLED
#include "rgb_backlight.h"
#endif // RGB_BACKLIGHT_ENABLED
#include "raw_hid.h"
#include "dynamic_keymap.h"
#include "timer.h"
#include "tmk_core/common/eeprom.h"
bool eeprom_is_valid(void)
{
return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC &&
eeprom_read_byte(((void*)EEPROM_VERSION_ADDR)) == EEPROM_VERSION);
}
void eeprom_set_valid(bool valid)
{
eeprom_update_word(((void*)EEPROM_MAGIC_ADDR), valid ? EEPROM_MAGIC : 0xFFFF);
eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF);
}
void eeprom_reset(void)
{
// Set the keyboard-specific EEPROM state as invalid.
eeprom_set_valid(false);
// Set the TMK/QMK EEPROM state as invalid.
eeconfig_disable();
}
#ifdef RAW_ENABLE
void raw_hid_receive( uint8_t *data, uint8_t length )
{
uint8_t *command_id = &(data[0]);
uint8_t *command_data = &(data[1]);
switch ( *command_id )
{
case id_get_protocol_version:
{
command_data[0] = PROTOCOL_VERSION >> 8;
command_data[1] = PROTOCOL_VERSION & 0xFF;
break;
}
case id_get_keyboard_value:
{
if ( command_data[0] == id_uptime )
{
uint32_t value = timer_read32();
command_data[1] = (value >> 24 ) & 0xFF;
command_data[2] = (value >> 16 ) & 0xFF;
command_data[3] = (value >> 8 ) & 0xFF;
command_data[4] = value & 0xFF;
}
else
{
*command_id = id_unhandled;
}
break;
}
#ifdef DYNAMIC_KEYMAP_ENABLE
case id_dynamic_keymap_get_keycode:
{
uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] );
command_data[3] = keycode >> 8;
command_data[4] = keycode & 0xFF;
break;
}
case id_dynamic_keymap_set_keycode:
{
dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] );
break;
}
case id_dynamic_keymap_reset:
{
dynamic_keymap_reset();
break;
}
#endif // DYNAMIC_KEYMAP_ENABLE
#if RGB_BACKLIGHT_ENABLED
case id_backlight_config_set_value:
{
//backlight_config_set_value(command_data);
break;
}
case id_backlight_config_get_value:
{
//backlight_config_get_value(command_data);
break;
}
case id_backlight_config_save:
{
//backlight_config_save();
break;
}
#endif // RGB_BACKLIGHT_ENABLED
case id_eeprom_reset:
{
eeprom_reset();
break;
}
case id_bootloader_jump:
{
// Need to send data back before the jump
// Informs host that the command is handled
raw_hid_send( data, length );
// Give host time to read it
wait_ms(100);
bootloader_jump();
break;
}
default:
{
// Unhandled message.
*command_id = id_unhandled;
break;
}
}
// Return same buffer with values changed
raw_hid_send( data, length );
}
#endif
void main_init(void)
{
// If the EEPROM has the magic, the data is good.
// OK to load from EEPROM.
if (eeprom_is_valid()) {
#if RGB_BACKLIGHT_ENABLED
//backlight_config_load();
#endif // RGB_BACKLIGHT_ENABLED
} else {
#if RGB_BACKLIGHT_ENABLED
// If the EEPROM has not been saved before, or is out of date,
// save the default values to the EEPROM. Default values
// come from construction of the zeal_backlight_config instance.
//backlight_config_save();
#endif // RGB_BACKLIGHT_ENABLED
#ifdef DYNAMIC_KEYMAP_ENABLE
// This resets the keymaps in EEPROM to what is in flash.
dynamic_keymap_reset();
#endif
// Save the magic number last, in case saving was interrupted
eeprom_set_valid(true);
}
#if RGB_BACKLIGHT_ENABLED
// Initialize LED drivers for backlight.
backlight_init_drivers();
backlight_timer_init();
backlight_timer_enable();
#endif // RGB_BACKLIGHT_ENABLED
}
void bootmagic_lite(void)
{
// The lite version of TMK's bootmagic.
// 100% less potential for accidentally making the
// keyboard do stupid things.
// We need multiple scans because debouncing can't be turned off.
matrix_scan();
wait_ms(DEBOUNCING_DELAY);
wait_ms(DEBOUNCING_DELAY);
matrix_scan();
// If the Esc (matrix 0,0) is held down on power up,
// reset the EEPROM valid state and jump to bootloader.
if ( matrix_get_row(0) & (1<<0) ) {
eeprom_reset();
bootloader_jump();
}
}
void matrix_init_kb(void) {
bootmagic_lite();
main_init();
matrix_init_user();
}
void matrix_scan_kb(void) {
#if RGB_BACKLIGHT_ENABLED
// This only updates the LED driver buffers if something has changed.
backlight_update_pwm_buffers();
#endif // BACKLIGHT_ENABLED
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
led_set_user(usb_led);
}
void suspend_power_down_kb(void)
{
#if RGB_BACKLIGHT_ENABLED
//backlight_set_suspend_state(true);
#endif // BACKLIGHT_ENABLED
}
void suspend_wakeup_init_kb(void)
{
#if RGB_BACKLIGHT_ENABLED
//backlight_set_suspend_state(false);
#endif // BACKLIGHT_ENABLED
}
+28
View File
@@ -0,0 +1,28 @@
/* Copyright 2018 Jason Williams (Wilba)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "quantum.h"
// This a shortcut to help you visually see your layout.
// The first section contains all of the arguments
// The second converts the arguments into a two-dimensional array
#define LAYOUT( \
K00, K01, K02, K03, K04, K05) \
{ \
{K00, K01, K02, K03, K04, K05}, \
}
+39
View File
@@ -0,0 +1,39 @@
/* Copyright 2017 Jason Williams (Wilba)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define PROTOCOL_VERSION 0x0001
enum m6_b_command_id
{
id_get_protocol_version = 0x01, // always 0x01
id_get_keyboard_value,
id_set_keyboard_value,
id_dynamic_keymap_get_keycode,
id_dynamic_keymap_set_keycode,
id_dynamic_keymap_reset,
id_backlight_config_set_value,
id_backlight_config_get_value,
id_backlight_config_save,
id_eeprom_reset,
id_bootloader_jump,
id_unhandled = 0xFF,
};
enum m6_b_keyboard_value_id
{
id_uptime = 0x01
};
+15
View File
@@ -0,0 +1,15 @@
# RAMA M6-B
![RAMA M6-B](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/t/59fc7b1053450adf5bf9a852/1515932239307/RAMA-RAMA-M6-DSA-XO-CAPS.73-3_1.jpg?format=1500w)
A 6-key companion keyboard. [More info at RAMA WORKS](https://rama.works/m6a)
Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582)
Hardware Supported: RAMA M6-B PCB
Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/)
Make example for this keyboard (after setting up your build environment):
make rama/m6_b:default
See 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).
+139
View File
@@ -0,0 +1,139 @@
/* Copyright 2018 Jason Williams (Wilba)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if RGB_BACKLIGHT_ENABLED
#include "rgb_backlight.h"
//#include "rgb_backlight_api.h"
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#include "progmem.h"
#include "quantum/color.h"
#include "drivers/avr/i2c_master.h"
#include "drivers/issi/is31fl3218.h"
bool g_suspend_state = false;
// Global tick at 20 Hz
uint32_t g_tick = 0;
uint8_t g_config_effect_speed = 0;
uint8_t g_config_brightness = 255;
void backlight_update_pwm_buffers(void)
{
IS31FL3218_update_pwm_buffers();
}
void backlight_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
{
IS31FL3218_set_color( index, red, green, blue );
}
void backlight_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
{
IS31FL3218_set_color_all( red, green, blue );
}
// This is (F_CPU/1024) / 20 Hz
// = 15625 Hz / 20 Hz
// = 781
#define TIMER3_TOP 260
void backlight_timer_init(void)
{
static uint8_t backlight_timer_is_init = 0;
if ( backlight_timer_is_init )
{
return;
}
backlight_timer_is_init = 1;
// Timer 3 setup
TCCR3B = _BV(WGM32) | // CTC mode OCR3A as TOP
_BV(CS32) | _BV(CS30); // prescale by /1024
// Set TOP value
uint8_t sreg = SREG;
cli();
OCR3AH = (TIMER3_TOP >> 8) & 0xff;
OCR3AL = TIMER3_TOP & 0xff;
SREG = sreg;
}
void backlight_timer_enable(void)
{
TIMSK3 |= _BV(OCIE3A);
}
void backlight_timer_disable(void)
{
TIMSK3 &= ~_BV(OCIE3A);
}
void backlight_set_suspend_state(bool state)
{
g_suspend_state = state;
}
void backlight_effect_cycle_all(void)
{
uint8_t hueOffset = ( g_tick << g_config_effect_speed ) & 0xFF;
uint8_t satOffset = 127;
// Relies on hue being 8-bit and wrapping
for ( int i=0; i<6; i++ )
{
HSV hsv = { .h = hueOffset, .s = satOffset, .v = g_config_brightness };
RGB rgb = hsv_to_rgb( hsv );
backlight_set_color( i, rgb.r, rgb.g, rgb.b );
}
}
ISR(TIMER3_COMPA_vect)
{
// delay 1 second before driving LEDs or doing anything else
static uint8_t startup_tick = 0;
if ( startup_tick < 20 )
{
startup_tick++;
return;
}
g_tick++;
if ( g_suspend_state )
{
backlight_set_color_all( 0, 0, 0 );
}
else
{
//HSV hsv = { .h = 240, .s = 255, .v = g_config_brightness };
//RGB rgb = hsv_to_rgb( hsv );
//backlight_set_color_all( rgb.r, rgb.g, rgb.b );
backlight_effect_cycle_all();
}
}
void backlight_init_drivers(void)
{
// Initialize I2C
i2c_init();
IS31FL3218_init();
}
#endif // RGB_BACKLIGHT_ENABLED
+34
View File
@@ -0,0 +1,34 @@
/* Copyright 2018 Jason Williams (Wilba)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#if RGB_BACKLIGHT_ENABLED
#else
#error rgb_backlight.h included when RGB_BACKLIGHT_ENABLED == 0
#endif // RGB_BACKLIGHT_ENABLED
#include <stdint.h>
#include <stdbool.h>
#include "quantum/color.h"
void backlight_init_drivers(void);
void backlight_update_pwm_buffers(void);
void backlight_timer_init(void);
void backlight_timer_enable(void);
void backlight_timer_disable(void);
void backlight_set_suspend_state(bool state);
+77
View File
@@ -0,0 +1,77 @@
# project specific files
SRC = rgb_backlight.c \
quantum/color.c \
drivers/issi/is31fl3218.c \
drivers/avr/i2c_master.c
# MCU name
MCU = atmega32u4
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section
BOOTLOADER = atmel-dfu
# Do not put the microcontroller into power saving mode
# when we get USB suspend event. We want it to keep updating
# backlight effects.
OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = yes # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
RAW_ENABLE = yes
DYNAMIC_KEYMAP_ENABLE = yes
CIE1931_CURVE = yes
+4
View File
@@ -0,0 +1,4 @@
#pragma once
#define DISABLE_SPACE_CADET_ROLLOVER
#define GRAVE_ESC_ALT_OVERRIDE
+53
View File
@@ -0,0 +1,53 @@
#include QMK_KEYBOARD_H
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BL 0
#define _FL 1
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* ,----------------------------------------------------------------.
* |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` |
* |----------------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del |
* |----------------------------------------------------------------|
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp|
* |----------------------------------------------------------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn|
* |----------------------------------------------------------------|
* |Ctrl|Win |Alt | Space |FN |Alt|Ctrl|Lef|Dow|Rig |
* `----------------------------------------------------------------'
*
* Note: Shift + Esc = ~
* Win + Esc = `
*/
[_BL] = LAYOUT_ansi(
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,KC_GRV, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS,KC_DEL, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,KC_PGUP, \
KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSPC,KC_UP,KC_PGDN, \
KC_LCTL, KC_LGUI,KC_LALT, LT(_BL, KC_SPC), MO(_FL),KC_RALT,KC_RCTRL, KC_LEFT,KC_DOWN,KC_RGHT),
/* Keymap _FL: Function Layer
* ,----------------------------------------------------------------.
* | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |PRSC|
* |----------------------------------------------------------------|
* | | |Up | | | | | | | | | | | |Ins |
* |----------------------------------------------------------------|
* | |<- |Dn | ->| | |<- |Dn |Up | ->| | | |Hme |
* |----------------------------------------------------------------|
* | ( | | |Bl-|BL |BL+| | |VU-|VU+|MUT| ) | |End |
* |----------------------------------------------------------------|
* | | | | | | | | | | |
* `----------------------------------------------------------------'
*/
[_FL] = LAYOUT_ansi(
_______, KC_F1 ,KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_PSCR, \
_______,_______, KC_UP,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______, _______,KC_INS, \
_______,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______,KC_LEFT,KC_DOWN,KC_UP,KC_RGHT,_______,_______, _______,KC_HOME, \
KC_LPRN,_______,_______,BL_DEC, BL_TOGG,BL_INC, _______,_______,KC_VOLD,KC_VOLU,KC_MUTE,KC_RPRN, _______, KC_END, \
_______,_______,_______, _______, _______,_______,_______,_______,_______, _______),
};
+43
View File
@@ -0,0 +1,43 @@
# Shalzz's Unix layout
This layout is based on the Unix Layout with a few changes.
```
Base Layer
,----------------------------------------------------------------.
|Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` |
|----------------------------------------------------------------|
|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del |
|----------------------------------------------------------------|
|CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp|
|----------------------------------------------------------------|
|Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn|
|----------------------------------------------------------------|
|Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig |
`----------------------------------------------------------------'
Note: Shift + Esc = ~
Win + Esc = `
Fn + LShift = (
Fn + RShift = )
Fn Layer
,----------------------------------------------------------------.
| | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |PRSC|
|----------------------------------------------------------------|
| | |Up | | | | | | | | | | | |Ins |
|----------------------------------------------------------------|
| |<- |Dn | ->| | |<- |Dn |Up | ->| | | |Hme |
|----------------------------------------------------------------|
| ( | | |Bl-|BL |BL+| | |VU-|VU+|MUT| ) | |End |
|----------------------------------------------------------------|
| | | | | | | | | | |
`----------------------------------------------------------------'
```
The changes that were applied over the Unix layout:
* Left and Right Shift when pressed alone emit `(` and `)` respectively. Hold shift for normal behaviour.
* Fn + Left and Right Shift also act as actual `(` and `)` keys respectively.
* Changed PrintSc to `Fn+``
* Fixed Holding down space activating the function layer instead of the lower layer.
+12
View File
@@ -0,0 +1,12 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
AUDIO_ENABLE = no # Audio output on port C6
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
+224
View File
@@ -0,0 +1,224 @@
/*
Copyright 2018 Ryan "Izzy" Bales
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6060
#define DEVICE_VER 0x0002
#define MANUFACTURER YANG
#define PRODUCT YD68v2
#define DESCRIPTION 65% board with Bluetooth
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 15
/*
* Keyboard Matrix Assignments
*
* Change this to how you wired your keyboard
* COLS: AVR pins used for columns, left to right
* ROWS: AVR pins used for rows, top to bottom
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
*
*/
#define MATRIX_ROW_PINS { B5, C6, C7, D7, B4 }
#define MATRIX_COL_PINS { B6, F7, F6, F5, F4, F1, F0, E6, B0, B7, D0, D1, D2, D3, D5 }
#define UNUSED_PINS
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
#define DIODE_DIRECTION COL2ROW
// #define BACKLIGHT_PIN B7
// #define BACKLIGHT_BREATHING
// #define BACKLIGHT_LEVELS 3
#define RGB_DI_PIN B3
#ifdef RGB_DI_PIN
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 10
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#endif
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCING_DELAY 5
/* define if matrix has ghost (lacks anti-ghosting diodes) */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
//#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
//#define LOCKING_RESYNC_ENABLE
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
*/
// #define GRAVE_ESC_CTRL_OVERRIDE
/*
* Force NKRO
*
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
* makefile for this to work.)
*
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
* until the next keyboard reset.
*
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
* fully operational during normal computer usage.
*
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
* power-up.
*
*/
//#define FORCE_NKRO
/*
* Magic Key Options
*
* Magic keys are hotkey commands that allow control over firmware functions of
* the keyboard. They are best used in combination with the HID Listen program,
* found here: https://www.pjrc.com/teensy/hid_listen.html
*
* The options below allow the magic key functionality to be changed. This is
* useful if your keyboard/keypad is missing keys and you want magic key support.
*
*/
/* key combination for magic key command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/* control how magic key switches layers */
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
/* override magic key keymap */
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
//#define MAGIC_KEY_HELP1 H
//#define MAGIC_KEY_HELP2 SLASH
//#define MAGIC_KEY_DEBUG D
//#define MAGIC_KEY_DEBUG_MATRIX X
//#define MAGIC_KEY_DEBUG_KBD K
//#define MAGIC_KEY_DEBUG_MOUSE M
//#define MAGIC_KEY_VERSION V
//#define MAGIC_KEY_STATUS S
//#define MAGIC_KEY_CONSOLE C
//#define MAGIC_KEY_LAYER0_ALT1 ESC
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
//#define MAGIC_KEY_LAYER0 0
//#define MAGIC_KEY_LAYER1 1
//#define MAGIC_KEY_LAYER2 2
//#define MAGIC_KEY_LAYER3 3
//#define MAGIC_KEY_LAYER4 4
//#define MAGIC_KEY_LAYER5 5
//#define MAGIC_KEY_LAYER6 6
//#define MAGIC_KEY_LAYER7 7
//#define MAGIC_KEY_LAYER8 8
//#define MAGIC_KEY_LAYER9 9
//#define MAGIC_KEY_BOOTLOADER PAUSE
//#define MAGIC_KEY_LOCK CAPS
//#define MAGIC_KEY_EEPROM E
//#define MAGIC_KEY_NKRO N
//#define MAGIC_KEY_SLEEP_LED Z
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
/*
* MIDI options
*/
/* Prevent use of disabled MIDI features in the keymap */
//#define MIDI_ENABLE_STRICT 1
/* enable basic MIDI features:
- MIDI notes can be sent when in Music mode is on
*/
//#define MIDI_BASIC
/* enable advanced MIDI features:
- MIDI notes can be added to the keymap
- Octave shift and transpose
- Virtual sustain, portamento, and modulation wheel
- etc.
*/
//#define MIDI_ADVANCED
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 1
/*
* HD44780 LCD Display Configuration
*/
/*
#define LCD_LINES 2 //< number of visible lines of the display
#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display
#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode
#if LCD_IO_MODE
#define LCD_PORT PORTB //< port for the LCD lines
#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0
#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1
#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2
#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3
#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0
#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1
#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2
#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3
#define LCD_RS_PORT LCD_PORT //< port for RS line
#define LCD_RS_PIN 3 //< pin for RS line
#define LCD_RW_PORT LCD_PORT //< port for RW line
#define LCD_RW_PIN 2 //< pin for RW line
#define LCD_E_PORT LCD_PORT //< port for Enable line
#define LCD_E_PIN 1 //< pin for Enable line
#endif
*/
+13
View File
@@ -0,0 +1,13 @@
{
"keyboard_name": "YD68",
"url": "",
"maintainer": "qmk",
"width": 16,
"height": 5,
"layouts": {
"LAYOUT_ansi": {
"key_count": 68,
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"Win", "x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}]
}
}
}
@@ -1,4 +1,4 @@
/* Copyright 2018 Wilba /* Copyright 2018 Ryan "Izzy" Bales
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -14,11 +14,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef CONFIG_USER_H #pragma once
#define CONFIG_USER_H
#include "../../config.h"
// place overrides here // place overrides here
#endif
+65
View File
@@ -0,0 +1,65 @@
/* Copyright 2018 Ryan "Izzy" Bales
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
// Defines the keycodes used by our macros in process_record_user
enum custom_keycodes {
YD68_BT_PWR = SAFE_RANGE,
YD68_RGB_PWR,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ansi( /* Base */
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,KC_HOME, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS,KC_END, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, KC_PGUP, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,KC_UP, KC_PGDN, \
KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_RCTRL,KC_LEFT,KC_DOWN,KC_RGHT \
),
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case YD68_BT_PWR:
if (record->event.pressed) {
// when keycode YD68_BT_PWR is pressed
} else {
// when keycode YD68_BT_PWR is released
}
break;
case YD68_RGB_PWR:
if (record->event.pressed) {
// when keycode YD68_RGB_PWR is pressed
PORTE ^= (1<<2);
} else {
// when keycode YD68_RGB_PWR is released
}
break;
}
return true;
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
}
+1
View File
@@ -0,0 +1 @@
# The default keymap for yd68
+15
View File
@@ -0,0 +1,15 @@
# yd68
[yd68](https://imgur.com/gallery/Ygo668L)
A 68-key board with RGB underlighting and bluetooth.
Keyboard Maintainer: [Izzy84075](https://github.com/izzy84075)
Hardware Supported: YD68/YD68v2
Hardware Availability: [KBDFans](https://kbdfans.cn/collections/diy-kit/products/yd68-65-bluetooth-custom-keyboard-pcb)
Make example for this keyboard (after setting up your build environment):
make yd68:default
See 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).
+81
View File
@@ -0,0 +1,81 @@
# MCU name
#MCU = at90usb1286
MCU = atmega32u4
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# atmega32a bootloadHID
BOOTLOADER = atmel-dfu
# If you don't know the bootloader type, then you can specify the
# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
+73
View File
@@ -0,0 +1,73 @@
/* Copyright 2018 Ryan "Izzy" Bales
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "yd68.h"
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
//Capslock LED Output Low
DDRD |= (1<<4);
PORTD &= ~(1<<4);
//Backlight LEDs Output Low
DDRD |= (1<<6);
PORTD &= ~(1<<6);
//RGB power output low
DDRE |= (1<<2);
PORTE &= ~(1<<2);
//Bluetooth power output high
DDRB |= (1<<2);
PORTB |= (1<<2);
//RGB data output low
DDRB |= (1<<3);
PORTB &= ~(1<<3);
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
// output low
DDRD |= (1<<4);
PORTD &= ~(1<<4);
} else {
// output high
DDRD |= (1<<4);
PORTD |= (1<<4);
}
led_set_user(usb_led);
}
+62
View File
@@ -0,0 +1,62 @@
/* Copyright 2018 Ryan "Izzy" Bales
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef YD68_H
#define YD68_H
#include "quantum.h"
#define XXX KC_NO
/* This a shortcut to help you visually see your layout.
*
* The first section contains all of the arguments representing the physical
* layout of the board and position of the keys.
*
* The second converts the arguments into a two-dimensional array which
* represents the switch matrix.
*/
/* YD68 ANSI layout
* ,----------------------------------------------------------------.
* | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0e | 48 |
* |----------------------------------------------------------------|
* | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d | 1e |
* |----------------------------------------------------------------|
* | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2d | 2e |
* |----------------------------------------------------------------|
* | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3c | 3d| 3e |
* |----------------------------------------------------------------|
* | 40 | 41 | 42 | 46 | 49| 4a| 4b| 4c| 4d| 4e |
* `----------------------------------------------------------------'
*/
// The first section contains all of the arguments
// The second converts the arguments into a two-dimensional array
#define LAYOUT_ansi( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, k48, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, k2e, \
k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \
k40, k41, k42, k46, k49, k4a, k4b, k4c, k4d, k4e \
) \
{ \
{k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, XXX, k0e}, \
{k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e}, \
{k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d, k2e}, \
{k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e}, \
{k40, k41, k42, XXX, XXX, XXX, k46, XXX, k48, k49, k4a, k4b, k4c, k4d, k4e} \
}
#endif
+29 -4
View File
@@ -916,6 +916,31 @@ void backlight_set_indicator_index( uint8_t *index, uint8_t row, uint8_t column
} }
} }
void backlight_get_indicator_row_col( uint8_t index, uint8_t *row, uint8_t *column )
{
if ( index == 255 || index == 254 )
{
// Special value, 255=none, 254=all
*row = index;
*column = 0;
return;
}
for ( uint8_t r = 0; r < MATRIX_ROWS; r++ )
{
for ( uint8_t c = 0; c < MATRIX_COLS; c++ )
{
uint8_t i = 255;
map_row_column_to_led( r, c, &i );
if ( i == index )
{
*row = r;
*column = c;
return;
}
}
}
}
// Some helpers for setting/getting HSV // Some helpers for setting/getting HSV
void _set_color( HSV *color, uint8_t *data ) void _set_color( HSV *color, uint8_t *data )
{ {
@@ -1146,7 +1171,7 @@ void backlight_config_get_value( uint8_t *data )
} }
case id_caps_lock_indicator_row_col: case id_caps_lock_indicator_row_col:
{ {
//*value_data = g_config.caps_lock_indicator.index; backlight_get_indicator_row_col( g_config.caps_lock_indicator.index, &(value_data[0]), &(value_data[1]) );
break; break;
} }
case id_layer_1_indicator_color: case id_layer_1_indicator_color:
@@ -1156,7 +1181,7 @@ void backlight_config_get_value( uint8_t *data )
} }
case id_layer_1_indicator_row_col: case id_layer_1_indicator_row_col:
{ {
//*value_data = g_config.layer_1_indicator.index; backlight_get_indicator_row_col( g_config.layer_1_indicator.index, &(value_data[0]), &(value_data[1]) );
break; break;
} }
case id_layer_2_indicator_color: case id_layer_2_indicator_color:
@@ -1166,7 +1191,7 @@ void backlight_config_get_value( uint8_t *data )
} }
case id_layer_2_indicator_row_col: case id_layer_2_indicator_row_col:
{ {
//*value_data = g_config.layer_2_indicator.index; backlight_get_indicator_row_col( g_config.layer_2_indicator.index, &(value_data[0]), &(value_data[1]) );
break; break;
} }
case id_layer_3_indicator_color: case id_layer_3_indicator_color:
@@ -1176,7 +1201,7 @@ void backlight_config_get_value( uint8_t *data )
} }
case id_layer_3_indicator_row_col: case id_layer_3_indicator_row_col:
{ {
//*value_data = g_config.layer_3_indicator.index; backlight_get_indicator_row_col( g_config.layer_3_indicator.index, &(value_data[0]), &(value_data[1]) );
break; break;
} }
case id_alphas_mods: case id_alphas_mods:
+1 -1
View File
@@ -17,7 +17,7 @@
#include "config.h" #include "config.h"
#include "keymap.h" // to get keymaps[][][] #include "keymap.h" // to get keymaps[][][]
#include "tmk_core/common/eeprom.h" #include "tmk_core/common/eeprom.h"
#include "progmem.h"// to read default from flash #include "progmem.h" // to read default from flash
#include "dynamic_keymap.h" #include "dynamic_keymap.h"
+105 -156
View File
@@ -370,10 +370,115 @@ void matrix_init_user(void) {
set_os(current_os, false); set_os(current_os, false);
} }
LEADER_EXTERNS();
void matrix_scan_user(void) { void matrix_scan_user(void) {
check_state(); check_state();
flash_rgb(); flash_rgb();
fade_rgb(); fade_rgb();
LEADER_DICTIONARY() {
leading = false;
leader_end();
// begin OS functions
SEQ_TWO_KEYS(KC_P, KC_B) {
if (current_os == OS_WIN) {
SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_PAUSE) SS_UP(X_LGUI));
} else {
}
}
SEQ_THREE_KEYS(KC_C, KC_A, KC_D) {
if (current_os == OS_WIN) {
SEND_STRING(SS_DOWN(X_LCTRL) SS_DOWN(X_LALT) SS_TAP(X_DELETE) SS_UP(X_LALT) SS_UP(X_LCTRL));
} else {
}
}
SEQ_FOUR_KEYS(KC_C, KC_A, KC_L, KC_C) {
if (current_os == OS_WIN) {
SEND_STRING(SS_TAP(X_CALCULATOR));
} else if (current_os == OS_MAC) {
SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_SPACE) SS_UP(X_LGUI) "calculator" SS_TAP(X_ENTER));
}
}
// end OS functions
// begin format functions
SEQ_ONE_KEY(KC_B) {
surround_type(4, KC_8, true);
}
SEQ_ONE_KEY(KC_I) {
surround_type(2, KC_8, true);
}
SEQ_ONE_KEY(KC_U) {
surround_type(4, KC_MINS, true);
}
SEQ_ONE_KEY(KC_S) {
surround_type(4, KC_GRAVE, true);
}
SEQ_TWO_KEYS(KC_S, KC_S) {
if (current_os == OS_MAC) {
long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_4});
} else if (current_os == OS_WIN) {
long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_S});
} else {
return;
}
}
SEQ_ONE_KEY(KC_C) {
surround_type(2, KC_GRAVE, false);
}
SEQ_TWO_KEYS(KC_C, KC_C) {
surround_type(6, KC_GRAVE, false);
}
// end format functions
// start fancy functions
SEQ_THREE_KEYS(KC_C, KC_C, KC_C) {
surround_type(6, KC_GRAVE, false);
pri_mod(true);
tap_key(KC_V);
pri_mod(false);
tap_key(KC_RGHT);
tap_key(KC_RGHT);
tap_key(KC_RGHT);
tap_key(KC_ENTER);
}
// end fancy functions
// start typing functions
SEQ_TWO_KEYS(KC_T, KC_M) {
// ™
send_unicode_hex_string("2122");
}
SEQ_THREE_KEYS(KC_G, KC_G, KC_T) {
SEND_STRING("@GrahamGoldenTech.com");
}
SEQ_THREE_KEYS(KC_L, KC_O, KC_D) {
// ಠ__ಠ
send_unicode_hex_string("0CA0 005F 005F 0CA0");
}
SEQ_FOUR_KEYS(KC_R, KC_E, KC_P, KC_O) {
SEND_STRING("https://github.com/qmk/qmk_firmware/tree/master/users/arkag");
}
SEQ_FOUR_KEYS(KC_F, KC_L, KC_I, KC_P) {
// (╯‵Д′)╯彡┻━┻
send_unicode_hex_string("0028 256F 2035 0414 2032 0029 256F 5F61 253B 2501 253B");
}
SEQ_FIVE_KEYS(KC_U, KC_F, KC_L, KC_I, KC_P) {
// ┬─┬ノ( º _ º ノ)
send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 0020 30CE 0029");
}
SEQ_FIVE_KEYS(KC_L, KC_E, KC_N, KC_N, KC_Y) {
// ( ͡° ͜ʖ ͡°)
send_unicode_hex_string("0028 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029");
}
SEQ_FIVE_KEYS(KC_S, KC_H, KC_R, KC_U, KC_G) {
// ¯\_(ツ)_/¯
send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF");
}
// end typing functions
}
} }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
@@ -394,138 +499,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
return false; return false;
case M_P_B:
if (record->event.pressed) {
if (current_os == OS_WIN) {
SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_PAUSE) SS_UP(X_LGUI));
} else {
}
}
return false;
case M_C_A_D:
if (record->event.pressed) {
if (current_os == OS_WIN) {
SEND_STRING(SS_DOWN(X_LCTRL) SS_DOWN(X_LALT) SS_TAP(X_DELETE) SS_UP(X_LALT) SS_UP(X_LCTRL));
} else {
}
}
return false;
case M_CALC:
if (record->event.pressed) {
if (current_os == OS_WIN) {
SEND_STRING(SS_TAP(X_CALCULATOR));
} else if (current_os == OS_MAC) {
SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_SPACE) SS_UP(X_LGUI) "calculator" SS_TAP(X_ENTER));
}
}
return false;
case M_OS: case M_OS:
if (record->event.pressed) { if (record->event.pressed) {
set_os((current_os+1) % _OS_COUNT, true); set_os((current_os+1) % _OS_COUNT, true);
} }
return false; return false;
case M_LOD:
if (record->event.pressed) {
send_unicode_hex_string("0CA0 005F 005F 0CA0");
}
return false;
case M_LENNY:
if (record->event.pressed) {
send_unicode_hex_string("0028 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029");
}
return false;
case M_TF:
if (record->event.pressed) {
send_unicode_hex_string("0028 256F 2035 0414 2032 0029 256F 5F61 253B 2501 253B");
}
return false;
case M_UF:
if (record->event.pressed) {
send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 0020 30CE 0029");
}
return false;
case M_SHRUG:
if (record->event.pressed) {
send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF");
}
return false;
case M_TM:
if (record->event.pressed) {
send_unicode_hex_string("2122");
}
return false;
case M_REPO:
if (record->event.pressed) {
SEND_STRING("https://github.com/qmk/qmk_firmware/tree/master/users/arkag");
}
return false;
case M_GGT:
if (record->event.pressed) {
SEND_STRING("@GrahamGoldenTech.com");
}
return false;
case M_SNIPT:
if (record->event.pressed) {
surround_type(6, KC_GRAVE, false);
pri_mod(true);
tap_key(KC_V);
pri_mod(false);
tap_key(KC_RGHT);
tap_key(KC_RGHT);
tap_key(KC_RGHT);
tap_key(KC_ENTER);
}
return false;
case M_BOLD:
if (record->event.pressed) {
surround_type(4, KC_8, true);
}
return false;
case M_ITAL:
if (record->event.pressed) {
surround_type(2, KC_8, true);
}
return false;
case M_ULIN:
if (record->event.pressed) {
surround_type(4, KC_MINS, true);
}
return false;
case KC_LSFT:
if (record->event.pressed) {
save_color(underglow);
underglow = mod_color(underglow, true, 75);
SEND_STRING(SS_DOWN(X_LSHIFT));
} else {
reset_color();
SEND_STRING(SS_UP(X_LSHIFT));
}
return false;
case MEDIA:
case LAZY:
case KEEB:
case RAISE:
case LOWER:
return true;
default: default:
if (record->event.pressed) { if (record->event.pressed) {
state = active; state = active;
@@ -535,36 +514,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
} }
uint32_t layer_state_set_user(uint32_t state) {
switch (biton32(state)) {
case _LAZY:
save_color(underglow);
underglow = mod_color(underglow, true, 50);
break;
case _MEDIA:
save_color(underglow);
underglow = mod_color(underglow, true, 150);
break;
case _KEEB:
save_color(underglow);
underglow = mod_color(underglow, false, 150);
break;
case _LOWER:
save_color(underglow);
underglow = mod_color(underglow, false, 100);
break;
case _RAISE:
save_color(underglow);
underglow = mod_color(underglow, true, 100);
break;
default:
reset_color();
break;
}
set_color(underglow, false);
return state;
}
//Tap Dance Definitions //Tap Dance Definitions
qk_tap_dance_action_t tap_dance_actions[] = { qk_tap_dance_action_t tap_dance_actions[] = {
[TD_3_GRV_ACT] = ACTION_TAP_DANCE_FN (dance_3), [TD_3_GRV_ACT] = ACTION_TAP_DANCE_FN (dance_3),
+3 -2
View File
@@ -1,5 +1,6 @@
#pragma once #pragma once
#define TAPPING_TERM 200 #define TAPPING_TERM 200
#define LEADER_TIMEOUT 250
#define IGNORE_MOD_TAP_INTERRUPT #define LEADER_PER_KEY_TIMING