1
0

Fix backlight issue for gh60 revB

This commit is contained in:
Kai Ryu 2014-04-09 17:21:09 +09:00
parent ab3349724e
commit 54028c2b65
2 changed files with 5 additions and 7 deletions

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();

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