updates rgblight implementation, makes non-timer stuff compatible with audio
This commit is contained in:
		
							parent
							
								
									ad43d450ca
								
							
						
					
					
						commit
						57e08eb8ba
					
				
					 17 changed files with 160 additions and 74 deletions
				
			
		| 
						 | 
				
			
			@ -10,12 +10,12 @@ EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
 | 
			
		|||
CONSOLE_ENABLE = no         # Console for debug(+400)
 | 
			
		||||
COMMAND_ENABLE = yes        # 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
 | 
			
		||||
BACKLIGHT_ENABLE = no      # Enable keyboard backlight functionality
 | 
			
		||||
MIDI_ENABLE = no            # MIDI controls
 | 
			
		||||
AUDIO_ENABLE = yes           # Audio output on port C6
 | 
			
		||||
AUDIO_ENABLE = no           # Audio output on port C6
 | 
			
		||||
UNICODE_ENABLE = no         # Unicode
 | 
			
		||||
BLUETOOTH_ENABLE = no       # Enable Bluetooth with the Adafruit EZ-Key HID
 | 
			
		||||
RGBLIGHT_ENABLE = no        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
 | 
			
		||||
RGBLIGHT_ENABLE = yes        # Enable WS2812 RGB underlight.  Do not enable this with audio at the same time.
 | 
			
		||||
 | 
			
		||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
 | 
			
		||||
SLEEP_LED_ENABLE = no    # Breathing sleep LED during USB suspend
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,4 +6,12 @@
 | 
			
		|||
#define LEADER_TIMEOUT 300
 | 
			
		||||
#define BACKLIGHT_BREATHING
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* ws2812 RGB LED */
 | 
			
		||||
#define RGB_DI_PIN B1
 | 
			
		||||
#define RGBLIGHT_TIMER
 | 
			
		||||
#define RGBLED_NUM 8     // Number of LEDs
 | 
			
		||||
#define RGBLIGHT_HUE_STEP 10
 | 
			
		||||
#define RGBLIGHT_SAT_STEP 17
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,7 +15,7 @@ extern keymap_config_t keymap_config;
 | 
			
		|||
// 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 _QWERTY 0
 | 
			
		||||
#define _QWERTY 10
 | 
			
		||||
#define _COLEMAK 1
 | 
			
		||||
#define _DVORAK 2
 | 
			
		||||
#define _LOWER 3
 | 
			
		||||
| 
						 | 
				
			
			@ -31,7 +31,15 @@ enum planck_keycodes {
 | 
			
		|||
  LOWER,
 | 
			
		||||
  RAISE,
 | 
			
		||||
  BACKLIT,
 | 
			
		||||
  EXT_PLV
 | 
			
		||||
  EXT_PLV,
 | 
			
		||||
  RGBLED_TOGGLE,
 | 
			
		||||
  RGBLED_STEP_MODE,
 | 
			
		||||
  RGBLED_INCREASE_HUE,
 | 
			
		||||
  RGBLED_DECREASE_HUE,
 | 
			
		||||
  RGBLED_INCREASE_SAT,
 | 
			
		||||
  RGBLED_DECREASE_SAT,
 | 
			
		||||
  RGBLED_INCREASE_VAL,
 | 
			
		||||
  RGBLED_DECREASE_VAL,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// Fillers to make layering more clear
 | 
			
		||||
| 
						 | 
				
			
			@ -39,14 +47,20 @@ enum planck_keycodes {
 | 
			
		|||
#define XXXXXXX KC_NO
 | 
			
		||||
 | 
			
		||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 | 
			
		||||
[0] = {
 | 
			
		||||
  {KC_NO, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL},
 | 
			
		||||
  {KC_NO, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL},
 | 
			
		||||
  {KC_NO, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL},
 | 
			
		||||
  {KC_NO, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL}
 | 
			
		||||
},
 | 
			
		||||
 | 
			
		||||
/* Qwerty
 | 
			
		||||
 * ,-----------------------------------------------------------------------------------.
 | 
			
		||||
 ,-----------------------------------------------------------------------------------.
 | 
			
		||||
 * | Tab  |   Q  |   W  |   E  |   R  |   T  |   Y  |   U  |   I  |   O  |   P  | Bksp |
 | 
			
		||||
 * |------+------+------+------+------+-------------+------+------+------+------+------|
 | 
			
		||||
 * | Esc  |   A  |   S  |   D  |   F  |   G  |   H  |   J  |   K  |   L  |   ;  |  "   |
 | 
			
		||||
 * |------+------+------+------+------+------|------+------+------+------+------+------|
 | 
			
		||||
 * | Shift|   Z  |   X  |   C  |   V  |   B  |   N  |   M  |   ,  |   .  |   /  |Enter |
 | 
			
		||||
 * | Shift|   Z  |   X  |   C  |   V  |   B  |   N  |   M  |,  |   .  |   /  |Enter |
 | 
			
		||||
 * |------+------+------+------+------+------+------+------+------+------+------+------|
 | 
			
		||||
 * | Brite| Ctrl | Alt  | GUI  |Lower |    Space    |Raise | Left | Down |  Up  |Right |
 | 
			
		||||
 * `-----------------------------------------------------------------------------------'
 | 
			
		||||
| 
						 | 
				
			
			@ -292,6 +306,57 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
 | 
			
		|||
        break;
 | 
			
		||||
      return false;
 | 
			
		||||
 | 
			
		||||
    case RGBLED_TOGGLE:
 | 
			
		||||
      //led operations
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
        rgblight_toggle();
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
      break;
 | 
			
		||||
    case RGBLED_INCREASE_HUE:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
        rgblight_increase_hue();
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
      break;
 | 
			
		||||
    case RGBLED_DECREASE_HUE:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
        rgblight_decrease_hue();
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
      break;
 | 
			
		||||
    case RGBLED_INCREASE_SAT:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
        rgblight_increase_sat();
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
      break;
 | 
			
		||||
    case RGBLED_DECREASE_SAT:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
        rgblight_decrease_sat();
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
      break;
 | 
			
		||||
    case RGBLED_INCREASE_VAL:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
        rgblight_increase_val();
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
      break;
 | 
			
		||||
    case RGBLED_DECREASE_VAL:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
        rgblight_decrease_val();
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
      break;
 | 
			
		||||
    case RGBLED_STEP_MODE:
 | 
			
		||||
      if (record->event.pressed) {
 | 
			
		||||
        rgblight_step();
 | 
			
		||||
      }
 | 
			
		||||
      return false;
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      }
 | 
			
		||||
  return true;
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue