1
0
Fork 0

Fixed plank keymaps so that they will compile for planck light

This commit is contained in:
Brian Choromanski 2018-03-12 18:18:40 -04:00 committed by Jack Humbert
parent 2dacf25f28
commit 4464d90f4d
10 changed files with 90 additions and 29 deletions

View file

@ -3,8 +3,10 @@
#include "config_common.h" #include "config_common.h"
#ifndef LIGHT_CONFIG_H
#define BACKLIGHT_BREATHING #define BACKLIGHT_BREATHING
#define BREATHING_PERIOD 3 #define BREATHING_PERIOD 3
#endif
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PLANCK_SOUND) #define STARTUP_SONG SONG(PLANCK_SOUND)

View file

@ -126,14 +126,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case QWERTY: case QWERTY:
if (record->event.pressed) { if (record->event.pressed) {
set_single_persistent_default_layer(_QWERTY); set_single_persistent_default_layer(_QWERTY);
breathing_self_disable(); #ifdef BACKLIGHT_BREATHING
breathing_self_disable();
#endif
} }
return false; return false;
break; break;
case DATA: case DATA:
if (record->event.pressed) { if (record->event.pressed) {
set_single_persistent_default_layer(_DATA); set_single_persistent_default_layer(_DATA);
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_BREATHING
breathing_enable(); breathing_enable();
#endif #endif
} }
@ -144,7 +146,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
layer_on(_LOWER); layer_on(_LOWER);
uint8_t default_layer = biton32(default_layer_state); uint8_t default_layer = biton32(default_layer_state);
if (default_layer == _QWERTY) { if (default_layer == _QWERTY) {
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_BREATHING
breathing_enable(); breathing_enable();
#endif #endif
} }
@ -153,7 +155,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
layer_off(_LOWER); layer_off(_LOWER);
uint8_t default_layer = biton32(default_layer_state); uint8_t default_layer = biton32(default_layer_state);
if (default_layer == _QWERTY) { if (default_layer == _QWERTY) {
breathing_self_disable(); #ifdef BACKLIGHT_BREATHING
breathing_self_disable();
#endif
} }
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
@ -164,7 +168,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
layer_on(_RAISE); layer_on(_RAISE);
uint8_t default_layer = biton32(default_layer_state); uint8_t default_layer = biton32(default_layer_state);
if (default_layer == _QWERTY) { if (default_layer == _QWERTY) {
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_BREATHING
breathing_enable(); breathing_enable();
#endif #endif
} }
@ -173,7 +177,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
layer_off(_RAISE); layer_off(_RAISE);
uint8_t default_layer = biton32(default_layer_state); uint8_t default_layer = biton32(default_layer_state);
if (default_layer == _QWERTY) { if (default_layer == _QWERTY) {
breathing_self_disable(); #ifdef BACKLIGHT_BREATHING
breathing_self_disable();
#endif
} }
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
@ -182,7 +188,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case BACKLIT: case BACKLIT:
if (record->event.pressed) { if (record->event.pressed) {
register_code(KC_RSFT); register_code(KC_RSFT);
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_BREATHING
backlight_step(); backlight_step();
#endif #endif
} else { } else {

View file

@ -27,7 +27,10 @@
#include "../../config.h" #include "../../config.h"
#define LEADER_TIMEOUT 300 #define LEADER_TIMEOUT 300
#ifndef LIGHT_CONFIG_H
#define BACKLIGHT_BREATHING #define BACKLIGHT_BREATHING
#endif
/* cbbrowne user configuration */ /* cbbrowne user configuration */

View file

@ -219,7 +219,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
if (record->event.pressed) if (record->event.pressed)
{ {
layer_on(_RAISE); layer_on(_RAISE);
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_BREATHING
breathing_period_set(2); breathing_period_set(2);
breathing_pulse(); breathing_pulse();
#endif #endif
@ -235,7 +235,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
if (record->event.pressed) if (record->event.pressed)
{ {
layer_on(_LOWER); layer_on(_LOWER);
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_BREATHING
breathing_period_set(2); breathing_period_set(2);
breathing_pulse(); breathing_pulse();
#endif #endif

View file

@ -12,7 +12,9 @@
} }
#endif #endif
#ifndef LIGHT_CONFIG_H
#define BACKLIGHT_BREATHING #define BACKLIGHT_BREATHING
#endif
#define TAPPING_TERM 150 #define TAPPING_TERM 150
#define MUSIC_MASK (keycode != KC_NO) #define MUSIC_MASK (keycode != KC_NO)

View file

@ -123,22 +123,30 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch(id) { switch(id) {
case MACRO_BREATH_TOGGLE: case MACRO_BREATH_TOGGLE:
if (record->event.pressed) { if (record->event.pressed) {
breathing_toggle(); #ifdef BACKLIGHT_BREATHING
breathing_toggle();
#endif
} }
break; break;
case MACRO_BREATH_SPEED_INC: case MACRO_BREATH_SPEED_INC:
if (record->event.pressed) { if (record->event.pressed) {
breathing_period_inc(); #ifdef BACKLIGHT_BREATHING
breathing_period_inc();
#endif
} }
break; break;
case MACRO_BREATH_SPEED_DEC: case MACRO_BREATH_SPEED_DEC:
if (record->event.pressed) { if (record->event.pressed) {
breathing_period_dec(); #ifdef BACKLIGHT_BREATHING
breathing_period_dec();
#endif
} }
break; break;
case MACRO_BREATH_DEFAULT: case MACRO_BREATH_DEFAULT:
if (record->event.pressed) { if (record->event.pressed) {
breathing_period_default(); #ifdef BACKLIGHT_BREATHING
breathing_period_default();
#endif
} }
break; break;
} }

View file

@ -25,9 +25,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_COLS 12 #define MATRIX_COLS 12
/* Planck PCB default pin-out */ /* Planck PCB default pin-out */
#ifndef LIGHT_CONFIG_H
#define MATRIX_ROW_PINS { D0, D5, B5, B6 } #define MATRIX_ROW_PINS { D0, D5, B5, B6 }
#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } #define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
#define UNUSED_PINS #define UNUSED_PINS
#endif
/* /*
* MIDI options * MIDI options
@ -69,7 +71,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Only print user print statements */ /* Only print user print statements */
#define USER_PRINT #define USER_PRINT
#ifndef LIGHT_CONFIG_H
#define BACKLIGHT_BREATHING #define BACKLIGHT_BREATHING
#endif
/* disable action features */ /* disable action features */
//#define NO_ACTION_LAYER //#define NO_ACTION_LAYER

View file

@ -316,28 +316,36 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case MACRO_BREATH_TOGGLE: case MACRO_BREATH_TOGGLE:
if (record->event.pressed) if (record->event.pressed)
{ {
#ifdef BACKLIGHT_BREATHING
breathing_toggle(); breathing_toggle();
#endif
} }
break; break;
case MACRO_BREATH_SPEED_INC: case MACRO_BREATH_SPEED_INC:
if (record->event.pressed) if (record->event.pressed)
{ {
#ifdef BACKLIGHT_BREATHING
breathing_period_inc(); breathing_period_inc();
#endif
} }
break; break;
case MACRO_BREATH_SPEED_DEC: case MACRO_BREATH_SPEED_DEC:
if (record->event.pressed) if (record->event.pressed)
{ {
#ifdef BACKLIGHT_BREATHING
breathing_period_dec(); breathing_period_dec();
#endif
} }
break; break;
case MACRO_BREATH_DEFAULT: case MACRO_BREATH_DEFAULT:
if (record->event.pressed) if (record->event.pressed)
{ {
#ifdef BACKLIGHT_BREATHING
breathing_period_default(); breathing_period_default();
#endif
} }
break; break;
@ -352,8 +360,10 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
if (record->event.pressed) if (record->event.pressed)
{ {
layer_on(LAYER_UPPER); layer_on(LAYER_UPPER);
breathing_period_set(2); #ifdef BACKLIGHT_BREATHING
breathing_pulse(); breathing_period_set(2);
breathing_pulse();
#endif
update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST);
} }
else else
@ -367,8 +377,10 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
if (record->event.pressed) if (record->event.pressed)
{ {
layer_on(LAYER_LOWER); layer_on(LAYER_LOWER);
breathing_period_set(2); #ifdef BACKLIGHT_BREATHING
breathing_pulse(); breathing_period_set(2);
breathing_pulse();
#endif
update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST);
} }
else else
@ -381,14 +393,18 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case MACRO_FUNCTION: case MACRO_FUNCTION:
if (record->event.pressed) if (record->event.pressed)
{ {
breathing_period_set(3); #ifdef BACKLIGHT_BREATHING
breathing_enable(); breathing_period_set(3);
breathing_enable();
#endif
layer_on(LAYER_FUNCTION); layer_on(LAYER_FUNCTION);
} }
else else
{ {
breathing_period_set(1); #ifdef BACKLIGHT_BREATHING
breathing_self_disable(); breathing_period_set(1);
breathing_self_disable();
#endif
layer_off(LAYER_FUNCTION); layer_off(LAYER_FUNCTION);
} }
break; break;

View file

@ -26,9 +26,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_COLS 12 #define MATRIX_COLS 12
/* Planck PCB default pin-out */ /* Planck PCB default pin-out */
#ifndef LIGHT_CONFIG_H
#define MATRIX_ROW_PINS { D0, D5, B5, B6 } #define MATRIX_ROW_PINS { D0, D5, B5, B6 }
#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } #define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
#define UNUSED_PINS #define UNUSED_PINS
#endif
/* Prevent use of disabled MIDI features in the keymap */ /* Prevent use of disabled MIDI features in the keymap */
//#define MIDI_ENABLE_STRICT 1 //#define MIDI_ENABLE_STRICT 1
@ -64,7 +66,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Only print user print statements */ /* Only print user print statements */
#define USER_PRINT #define USER_PRINT
#ifndef LIGHT_CONFIG_H
#define BACKLIGHT_BREATHING #define BACKLIGHT_BREATHING
#endif
/* disable action features */ /* disable action features */
//#define NO_ACTION_LAYER //#define NO_ACTION_LAYER

View file

@ -325,28 +325,36 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case MACRO_BREATH_TOGGLE: case MACRO_BREATH_TOGGLE:
if (record->event.pressed) if (record->event.pressed)
{ {
#ifdef BACKLIGHT_BREATHING
breathing_toggle(); breathing_toggle();
#endif
} }
break; break;
case MACRO_BREATH_SPEED_INC: case MACRO_BREATH_SPEED_INC:
if (record->event.pressed) if (record->event.pressed)
{ {
#ifdef BACKLIGHT_BREATHING
breathing_period_inc(); breathing_period_inc();
#endif
} }
break; break;
case MACRO_BREATH_SPEED_DEC: case MACRO_BREATH_SPEED_DEC:
if (record->event.pressed) if (record->event.pressed)
{ {
#ifdef BACKLIGHT_BREATHING
breathing_period_dec(); breathing_period_dec();
#endif
} }
break; break;
case MACRO_BREATH_DEFAULT: case MACRO_BREATH_DEFAULT:
if (record->event.pressed) if (record->event.pressed)
{ {
#ifdef BACKLIGHT_BREATHING
breathing_period_default(); breathing_period_default();
#endif
} }
break; break;
@ -361,8 +369,10 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
if (record->event.pressed) if (record->event.pressed)
{ {
layer_on(LAYER_UPPER); layer_on(LAYER_UPPER);
breathing_period_set(2); #ifdef BACKLIGHT_BREATHING
breathing_pulse(); breathing_period_set(2);
breathing_pulse();
#endif
update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST);
} }
else else
@ -376,8 +386,10 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
if (record->event.pressed) if (record->event.pressed)
{ {
layer_on(LAYER_LOWER); layer_on(LAYER_LOWER);
breathing_period_set(2); #ifdef BACKLIGHT_BREATHING
breathing_pulse(); breathing_period_set(2);
breathing_pulse();
#endif
update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST); update_tri_layer(LAYER_LOWER, LAYER_UPPER, LAYER_ADJUST);
} }
else else
@ -390,14 +402,18 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
case MACRO_FUNCTION: case MACRO_FUNCTION:
if (record->event.pressed) if (record->event.pressed)
{ {
breathing_period_set(3); #ifdef BACKLIGHT_BREATHING
breathing_enable(); breathing_period_set(3);
breathing_enable();
#endif
layer_on(LAYER_FUNCTION); layer_on(LAYER_FUNCTION);
} }
else else
{ {
breathing_period_set(1); #ifdef BACKLIGHT_BREATHING
breathing_self_disable(); breathing_period_set(1);
breathing_self_disable();
#endif
layer_off(LAYER_FUNCTION); layer_off(LAYER_FUNCTION);
} }
break; break;