···217217 system_prepare_fw_start();
218218 /* if target defines lcd_enable() in bootloader, take this as a hint that
219219 * we should use it to properly stop the lcd before moving one, the
220220- * _backlight_off() routine is supposed to disable the lcd at the same time */
220220+ * backlight_hw_off() routine is supposed to disable the lcd at the same time */
221221#ifdef HAVE_LCD_ENABLE
222222- _backlight_off();
222222+ backlight_hw_off();
223223#endif
224224 disable_interrupt(IRQ_FIQ_STATUS);
225225 commit_discard_idcache();
···8282 }
8383#if 0
8484 if (button & BUTTON_SELECT){
8585- _backlight_off();
8585+ backlight_hw_off();
8686 }
8787 else{
8888- _backlight_on();
8888+ backlight_hw_on();
8989 }
9090#endif
9191 printf("Btn: 0x%08x",button);
···147147148148 show_logo();
149149150150- _backlight_on();
150150+ backlight_hw_on();
151151152152/* Only load the firmware if TCCBOOT is defined - this ensures SDRAM_START is
153153 available for loading the firmware. Otherwise display the debug screen. */
+4-4
firmware/backlight-sw-fading.c
···2828#include "backlight-sw-fading.h"
29293030/* To adapt a target do:
3131- * - make sure _backlight_on doesn't set the brightness to something other than
3131+ * - make sure backlight_hw_on doesn't set the brightness to something other than
3232 * the previous value (lowest brightness in most cases)
3333 * add proper #defines for software fading
3434 */
···4646{
4747 if (LIKELY(current_brightness < backlight_brightness))
4848 {
4949- _backlight_set_brightness(++current_brightness);
4949+ backlight_hw_brightness(++current_brightness);
5050 }
5151 return(current_brightness >= backlight_brightness);
5252}
···5656{
5757 if (LIKELY(current_brightness > MIN_BRIGHTNESS_SETTING))
5858 {
5959- _backlight_set_brightness(--current_brightness);
5959+ backlight_hw_brightness(--current_brightness);
6060 return false;
6161 }
6262 else
6363 {
6464 /* decrement once more, since backlight is off */
6565 current_brightness--;
6666- _backlight_off();
6666+ backlight_hw_off();
6767 return true;
6868 }
6969}
···28282929int buttonlight_is_on = 0;
30303131-void _backlight_set_brightness(int brightness)
3131+void backlight_hw_brightness(int brightness)
3232{
3333 ascodec_write(AS3514_DCDC15, brightness);
3434}
35353636-void _backlight_on(void)
3636+void backlight_hw_on(void)
3737{
3838#ifdef HAVE_LCD_ENABLE
3939 lcd_enable(true); /* power on lcd + visible display */
···4545#endif
4646}
47474848-void _backlight_off(void)
4848+void backlight_hw_off(void)
4949{
5050 ascodec_write(AS3514_DCDC15, 0x0);
5151#ifdef HAVE_LCD_ENABLE
···5353#endif
5454}
55555656-void _buttonlight_on(void)
5656+void buttonlight_hw_on(void)
5757{
5858 /* Needed for buttonlight and MicroSD to work at the same time */
5959 /* Turn ROD control on, as the OF does */
···6363 buttonlight_is_on = 1;
6464}
65656666-void _buttonlight_off(void)
6666+void buttonlight_hw_off(void)
6767{
6868 /* Needed for buttonlight and MicroSD to work at the same time */
6969 /* Turn ROD control off, as the OF does */
···6666 static int prev_scroll = -1;
6767 static int direction = 0;
6868 static int count = 0;
6969- static long next_backlight_on = 0;
6969+ static long nextbacklight_hw_on = 0;
70707171 static unsigned long last_wheel_usec = 0;
7272 static unsigned long wheel_delta = 1ul << 24;
···9696 }
97979898 /* poke backlight every 1/4s of activity */
9999- if (TIME_AFTER(current_tick, next_backlight_on)) {
9999+ if (TIME_AFTER(current_tick, nextbacklight_hw_on)) {
100100 backlight_on();
101101 reset_poweroff_timer();
102102- next_backlight_on = current_tick + HZ/4;
102102+ nextbacklight_hw_on = current_tick + HZ/4;
103103 }
104104105105 /* has wheel travelled far enough? */
···152152 wheel_velocity = v;
153153 /* ensure backlight never gets stuck for an extended period if tick
154154 * wrapped such that next poke is very far ahead */
155155- next_backlight_on = current_tick - 1;
155155+ nextbacklight_hw_on = current_tick - 1;
156156 }
157157 else {
158158 /* some velocity filtering to smooth things out */
+4-4
firmware/target/arm/ipod/button-mini1g.c
···6060 static int prev_scroll = -1;
6161 static int direction = 0;
6262 static int count = 0;
6363- static long next_backlight_on = 0;
6363+ static long nextbacklight_hw_on = 0;
64646565 int wheel_keycode = BUTTON_NONE;
6666 int scroll;
···9292 }
93939494 /* poke backlight every 1/4s of activity */
9595- if (TIME_AFTER(current_tick, next_backlight_on)) {
9595+ if (TIME_AFTER(current_tick, nextbacklight_hw_on)) {
9696 backlight_on();
9797 reset_poweroff_timer();
9898- next_backlight_on = current_tick + HZ/4;
9898+ nextbacklight_hw_on = current_tick + HZ/4;
9999 }
100100101101 if (++count < WHEEL_BASE_SENSITIVITY)
···144144 wheel_velocity = v;
145145 /* ensure backlight never gets stuck for an extended period if tick
146146 * wrapped such that next poke is very far ahead */
147147- next_backlight_on = current_tick - 1;
147147+ nextbacklight_hw_on = current_tick - 1;
148148 }
149149 else {
150150 /* some velocity filtering to smooth things out */
···8181 int(*reboot_point)(void);
8282 reboot_point=(void*)(unsigned char*) 0x00000000;
8383 /* turn off backlight and wait for 1 second */
8484- _backlight_off();
8585- _buttonlight_off();
8484+ backlight_hw_off();
8585+ buttonlight_hw_off();
8686 sleep(HZ);
87878888 /* Do this to allow the drive to properly reset when player restarts
···135135 static int prev_keypost = BUTTON_NONE;
136136 static int count = 0;
137137 static int fast_mode = 0;
138138- static long next_backlight_on = 0;
138138+ static long nextbacklight_hw_on = 0;
139139140140 static unsigned long prev_usec[WHEEL_BASE_SENSITIVITY] = { 0 };
141141 static unsigned long delta = 1ul << 24;
···166166 velocity = 0;
167167 }
168168169169- if (TIME_AFTER(current_tick, next_backlight_on))
169169+ if (TIME_AFTER(current_tick, nextbacklight_hw_on))
170170 {
171171 /* Poke backlight to turn it on or maintain it no more often
172172 * than every 1/4 second */
173173- next_backlight_on = current_tick + HZ/4;
173173+ nextbacklight_hw_on = current_tick + HZ/4;
174174 backlight_on();
175175#ifdef HAVE_BUTTON_LIGHT
176176 buttonlight_on();
···209209 velocity = v;
210210 /* Ensure backlight never gets stuck for an extended period if tick
211211 * wrapped such that next poke is very far ahead */
212212- next_backlight_on = current_tick - 1;
212212+ nextbacklight_hw_on = current_tick - 1;
213213 }
214214 else
215215 {
···7878void power_off(void)
7979{
8080 /* Turn the backlight off first to avoid a bright stripe on power-off */
8181- _backlight_off();
8181+ backlight_hw_off();
8282 sleep(HZ/10);
83838484 /* Power off the player using the same mechanism as the OF */