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

@@ -52,5 +52,14 @@ void backlight_set(uint8_t level)
}
}
#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

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

@@ -31,6 +31,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_ROWS 5
#define MATRIX_COLS 14

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

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

@@ -38,7 +42,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DEBOUNCE 5

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

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

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

@@ -57,6 +57,10 @@ uint8_t matrix_cols(void)

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

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