Browse Source

Support backlight for GH60 revB

led_matrix
Kai Ryu 10 years ago
parent
commit
e35fdfc5c7
3 changed files with 22 additions and 1 deletions
  1. 10
    1
      keyboard/gh60/backlight.c
  2. 8
    0
      keyboard/gh60/config.h
  3. 4
    0
      keyboard/gh60/matrix.c

+ 10
- 1
keyboard/gh60/backlight.c View File

} }
} }
#else #else
void backlight_set(uint8_t level) {}
void backlight_set(uint8_t level)
{
if (level > 0) {
DDRF |= (1<<PF7 | 1<<PF6 | 1<<PF5 | 1<<PF4);
PORTF &= ~(1<<PF7 | 1<<PF6 | 1<<PF5 | 1<<PF4);
}
else {
DDRF &= ~(1<<PF7 | 1<<PF6 | 1<<PF5 | 1<<PF4);
}
}
#endif #endif

+ 8
- 0
keyboard/gh60/config.h View File

#define MATRIX_ROWS 5 #define MATRIX_ROWS 5
#define MATRIX_COLS 14 #define MATRIX_COLS 14


/* keymap in eeprom */
#define FN_ACTIONS_COUNT 32
#define KEYMAPS_COUNT 8

/* define if matrix has ghost */ /* define if matrix has ghost */
//#define MATRIX_HAS_GHOST //#define MATRIX_HAS_GHOST


#define DEBOUNCE 5 #define DEBOUNCE 5


/* number of backlight levels */ /* number of backlight levels */
#ifdef GH60_REV_CHN
#define BACKLIGHT_LEVELS 3 #define BACKLIGHT_LEVELS 3
#else
#define BACKLIGHT_LEVELS 1
#endif


/* 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

+ 4
- 0
keyboard/gh60/matrix.c View File



void matrix_init(void) void matrix_init(void)
{ {
// disable JTAG
MCUCR = (1<<JTD);
MCUCR = (1<<JTD);

// initialize row and col // initialize row and col
unselect_rows(); unselect_rows();
init_cols(); init_cols();