Browse Source

Modify files for Staryu normal version

old_master
Kai Ryu 9 years ago
parent
commit
3ab4b014eb
3 changed files with 42 additions and 12 deletions
  1. 5
    3
      keyboard/staryu/Makefile
  2. 2
    2
      keyboard/staryu/config.h
  3. 35
    7
      keyboard/staryu/keymap_default.c

+ 5
- 3
keyboard/staryu/Makefile View File

matrix.c \ matrix.c \
led.c \ led.c \
backlight.c \ backlight.c \
ledmap.c
ledmap.c \
light_ws2812.c \
rgb.c


ifdef KEYMAP ifdef KEYMAP
SRC := keymap_$(KEYMAP).c $(SRC) SRC := keymap_$(KEYMAP).c $(SRC)
SOFTPWM_LED_ENABLE = yes # Enable SoftPWM to drive backlight SOFTPWM_LED_ENABLE = yes # Enable SoftPWM to drive backlight
FADING_LED_ENABLE = yes # Enable fading backlight FADING_LED_ENABLE = yes # Enable fading backlight
BREATHING_LED_ENABLE = yes # Enable breathing backlight BREATHING_LED_ENABLE = yes # Enable breathing backlight
LEDMAP_ENABLE = yes # Enable LED mapping
LEDMAP_IN_EEPROM_ENABLE = yes # Read LED mapping from eeprom
#LEDMAP_ENABLE = yes # Enable LED mapping
#LEDMAP_IN_EEPROM_ENABLE = yes # Read LED mapping from eeprom




# Optimize size but this may cause error "relocation truncated to fit" # Optimize size but this may cause error "relocation truncated to fit"

+ 2
- 2
keyboard/staryu/config.h View File

#define DEBOUNCE 5 #define DEBOUNCE 5


/* number of backlight levels */ /* number of backlight levels */
#define BACKLIGHT_LEVELS 8
#define BACKLIGHT_LEVELS 7


/* number of LEDs */ /* number of LEDs */
#define LED_COUNT 5
#define LED_COUNT 6


/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE #define LOCKING_SUPPORT_ENABLE

+ 35
- 7
keyboard/staryu/keymap_default.c View File

#include "keycode.h" #include "keycode.h"
#include "action.h" #include "action.h"
#include "keymap_common.h" #include "keymap_common.h"
#include "rgb.h"


// Default // Default
#ifdef KEYMAP_SECTION_ENABLE #ifdef KEYMAP_SECTION_ENABLE
KEYMAP( MS_U,FN3, MS_L,MS_D,MS_R ), KEYMAP( MS_U,FN3, MS_L,MS_D,MS_R ),
/* Keymap 4 /* Keymap 4
* ,-----------. * ,-----------.
* | |Fn8|Fn4|
* | |Fn6|Fn4|
* |---+---+---| * |---+---+---|
* |Fn6|Fn5|Fn7|
* |Fn7|Fn5|Fn8|
* `-----------' * `-----------'
*/ */
KEYMAP( FN7, FN3, FN5, FN4, FN6 ),
KEYMAP( FN6, FN4, FN7, FN5, FN8 ),
};

enum function_id {
AF_RGB_TOGGLE = 0,
AF_RGB_DECREASE,
AF_RGB_INCREASE,
AF_RGB_STEP
}; };


/* /*
[2] = ACTION_DEFAULT_LAYER_SET(3), [2] = ACTION_DEFAULT_LAYER_SET(3),
[3] = ACTION_DEFAULT_LAYER_SET(4), [3] = ACTION_DEFAULT_LAYER_SET(4),
[4] = ACTION_DEFAULT_LAYER_SET(0), [4] = ACTION_DEFAULT_LAYER_SET(0),
[5] = ACTION_BACKLIGHT_TOGGLE(),
[6] = ACTION_BACKLIGHT_DECREASE(),
[7] = ACTION_BACKLIGHT_INCREASE(),
[8] = ACTION_BACKLIGHT_STEP()
[5] = ACTION_BACKLIGHT_DECREASE(),
[6] = ACTION_BACKLIGHT_INCREASE(),
[7] = ACTION_FUNCTION(AF_RGB_DECREASE),
[8] = ACTION_FUNCTION(AF_RGB_INCREASE)
#endif #endif
}; };


return sizeof(fn_actions) / sizeof(fn_actions[0]); return sizeof(fn_actions) / sizeof(fn_actions[0]);
} }
#endif #endif

void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
{
if (record->event.pressed) {
switch (id) {
case AF_RGB_TOGGLE:
rgb_toggle();
break;
case AF_RGB_DECREASE:
rgb_decrease();
break;
case AF_RGB_INCREASE:
rgb_increase();
break;
case AF_RGB_STEP:
rgb_step();
break;
}
}
}