summaryrefslogtreecommitdiff
path: root/firmware/backlight.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/backlight.c')
-rw-r--r--firmware/backlight.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 98b2d9a40d..d40f00f163 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -114,7 +114,7 @@ void TIMER1(void)
114 114
115 if (bl_dim_current > 0 && bl_dim_current < BL_PWM_COUNT) 115 if (bl_dim_current > 0 && bl_dim_current < BL_PWM_COUNT)
116 { 116 {
117 GPIO1_OUT &= ~0x00020000; 117 and_l(~0x00020000, &GPIO1_OUT);
118 bl_pwm_counter = bl_dim_current; 118 bl_pwm_counter = bl_dim_current;
119 timer_period = timer_period * bl_pwm_counter / BL_PWM_COUNT; 119 timer_period = timer_period * bl_pwm_counter / BL_PWM_COUNT;
120 bl_dim_state = DIM_STATE_MAIN; 120 bl_dim_state = DIM_STATE_MAIN;
@@ -122,9 +122,9 @@ void TIMER1(void)
122 else 122 else
123 { 123 {
124 if (bl_dim_current) 124 if (bl_dim_current)
125 GPIO1_OUT &= ~0x00020000; 125 and_l(~0x00020000, &GPIO1_OUT);
126 else 126 else
127 GPIO1_OUT |= 0x00020000; 127 or_l(0x00020000, &GPIO1_OUT);
128 if (bl_dim_current == bl_dim_target) 128 if (bl_dim_current == bl_dim_target)
129 idle = true; 129 idle = true;
130 } 130 }
@@ -133,7 +133,7 @@ void TIMER1(void)
133 133
134 /* Dim main screen */ 134 /* Dim main screen */
135 case DIM_STATE_MAIN: 135 case DIM_STATE_MAIN:
136 GPIO1_OUT |= 0x00020000; 136 or_l(0x00020000, &GPIO1_OUT);
137 bl_dim_state = DIM_STATE_START; 137 bl_dim_state = DIM_STATE_START;
138 timer_period = timer_period * (BL_PWM_COUNT - bl_pwm_counter) / BL_PWM_COUNT; 138 timer_period = timer_period * (BL_PWM_COUNT - bl_pwm_counter) / BL_PWM_COUNT;
139 break ; 139 break ;
@@ -182,9 +182,9 @@ void backlight_allow_timer(bool on)
182 TMR1 = 0; 182 TMR1 = 0;
183 183
184 if (bl_dim_current) 184 if (bl_dim_current)
185 GPIO1_OUT &= ~0x00020000; 185 and_l(~0x00020000, &GPIO1_OUT);
186 else 186 else
187 GPIO1_OUT |= 0x00020000; 187 or_l(0x00020000, &GPIO1_OUT);
188 } 188 }
189} 189}
190 190
@@ -207,7 +207,7 @@ static void __backlight_off(void)
207 else 207 else
208 { 208 {
209 bl_dim_target = bl_dim_current = 0; 209 bl_dim_target = bl_dim_current = 0;
210 GPIO1_OUT |= 0x00020000; 210 or_l(0x00020000, &GPIO1_OUT);
211 } 211 }
212#elif CONFIG_BACKLIGHT == BL_RTC 212#elif CONFIG_BACKLIGHT == BL_RTC
213 /* Disable square wave */ 213 /* Disable square wave */
@@ -229,7 +229,7 @@ static void __backlight_on(void)
229 else 229 else
230 { 230 {
231 bl_dim_target = bl_dim_current = BL_PWM_COUNT; 231 bl_dim_target = bl_dim_current = BL_PWM_COUNT;
232 GPIO1_OUT &= ~0x00020000; 232 and_l(~0x00020000, &GPIO1_OUT);
233 } 233 }
234#elif CONFIG_BACKLIGHT == BL_RTC 234#elif CONFIG_BACKLIGHT == BL_RTC
235 /* Enable square wave */ 235 /* Enable square wave */
@@ -409,8 +409,8 @@ void backlight_init(void)
409 sizeof(backlight_stack), backlight_thread_name); 409 sizeof(backlight_stack), backlight_thread_name);
410 410
411#if CONFIG_BACKLIGHT == BL_IRIVER 411#if CONFIG_BACKLIGHT == BL_IRIVER
412 GPIO1_ENABLE |= 0x00020000; 412 or_l(0x00020000, &GPIO1_ENABLE);
413 GPIO1_FUNCTION |= 0x00020000; 413 or_l(0x00020000, &GPIO1_FUNCTION);
414#elif CONFIG_BACKLIGHT == BL_PA14_LO || CONFIG_BACKLIGHT == BL_PA14_HI 414#elif CONFIG_BACKLIGHT == BL_PA14_LO || CONFIG_BACKLIGHT == BL_PA14_HI
415 PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */ 415 PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
416 or_b(0x40, &PAIORH); /* ..and output */ 416 or_b(0x40, &PAIORH); /* ..and output */