1
0

Support backlight for GH60 revB

This commit is contained in:
Kai Ryu 2014-01-10 09:17:28 +09:00
parent ffaff2845a
commit e35fdfc5c7
3 changed files with 22 additions and 1 deletions

View File

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

View File

@ -31,6 +31,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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
@ -38,7 +42,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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

View File

@ -57,6 +57,10 @@ uint8_t matrix_cols(void)
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();