Browse Source

Fix backlight issue for gh60 revB

led_matrix
Kai Ryu 10 years ago
parent
commit
54028c2b65
2 changed files with 5 additions and 7 deletions
  1. 4
    0
      keyboard/gh60/backlight.c
  2. 1
    7
      keyboard/gh60/config.h

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

@@ -82,6 +82,8 @@ void backlight_set(uint8_t level)
DDRF |= (1<<PF7 | 1<<PF6 | 1<<PF5 | 1<<PF4);
PORTF |= (1<<PF7 | 1<<PF6 | 1<<PF5 | 1<<PF4);
cli();
TCCR1A |= (1<<WGM10);
TCCR1B |= ((1<<CS11) | (1<<CS10));
TIMSK1 |= ((1<<OCIE1A) | (1<<TOIE1));
TIFR1 |= (1<<TOV1);
sei();
@@ -90,6 +92,8 @@ void backlight_set(uint8_t level)
else {
DDRF &= ~(1<<PF7 | 1<<PF6 | 1<<PF5 | 1<<PF4);
cli();
TCCR1A &= ~(1<<WGM10);
TCCR1B &= ~((1<<CS11) | (1<<CS10));
TIMSK1 |= ((1<<OCIE1A) | (1<<TOIE1));
TIFR1 |= (1<<TOV1);
sei();

+ 1
- 7
keyboard/gh60/config.h View File

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

/* number of backlight levels */
#if defined(GH60_REV_CHN)
# define BACKLIGHT_LEVELS 3
#elif defined(GH60_REV_CNY)
# define BACKLIGHT_LEVELS 3
#else
# define BACKLIGHT_LEVELS 1
#endif
#define BACKLIGHT_LEVELS 3

#ifdef GH60_REV_CNY
# define LED_MATRIX_ROWS 6