| Index: embios/trunk/init.c |
| — | — | @@ -48,6 +48,9 @@ |
| 49 | 49 | #ifdef HAVE_BOOTFLASH
|
| 50 | 50 | #include "bootflash.h"
|
| 51 | 51 | #endif
|
| | 52 | +#ifdef HAVE_BOOTFLASH
|
| | 53 | +#include "backlight.h"
|
| | 54 | +#endif
|
| 52 | 55 |
|
| 53 | 56 |
|
| 54 | 57 | struct bootinfo_t
|
| — | — | @@ -176,6 +179,9 @@ |
| 177 | 180 | usb_init();
|
| 178 | 181 | #endif
|
| 179 | 182 | cputs(CONSOLE_BOOT, welcomestring);
|
| | 183 | +#ifdef HAVE_BACKLIGHT
|
| | 184 | + backlight_init();
|
| | 185 | +#endif
|
| 180 | 186 | #ifdef HAVE_BUTTON
|
| 181 | 187 | button_init();
|
| 182 | 188 | #endif
|
| Index: embios/trunk/target/ipodnano2g/backlight.c |
| — | — | @@ -26,6 +26,11 @@ |
| 27 | 27 | #include "backlight.h"
|
| 28 | 28 |
|
| 29 | 29 |
|
| | 30 | +void backlight_init()
|
| | 31 | +{
|
| | 32 | + i2c_sendbyte(0, 0xe6, 0x2a, 6);
|
| | 33 | +}
|
| | 34 | +
|
| 30 | 35 | void backlight_on(bool on)
|
| 31 | 36 | {
|
| 32 | 37 | i2c_sendbyte(0, 0xe6, 0x29, on ? 1 : 0);
|
| Index: embios/trunk/target/ipodnano4g/backlight.c |
| — | — | @@ -1,45 +1,49 @@ |
| 2 | | -// |
| 3 | | -// |
| 4 | | -// Copyright 2010 TheSeven |
| 5 | | -// |
| 6 | | -// |
| 7 | | -// This file is part of emBIOS. |
| 8 | | -// |
| 9 | | -// emBIOS is free software: you can redistribute it and/or |
| 10 | | -// modify it under the terms of the GNU General Public License as |
| 11 | | -// published by the Free Software Foundation, either version 2 of the |
| 12 | | -// License, or (at your option) any later version. |
| 13 | | -// |
| 14 | | -// emBIOS is distributed in the hope that it will be useful, |
| 15 | | -// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | | -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 17 | | -// See the GNU General Public License for more details. |
| 18 | | -// |
| 19 | | -// You should have received a copy of the GNU General Public License along |
| 20 | | -// with emBIOS. If not, see <http://www.gnu.org/licenses/>. |
| 21 | | -// |
| 22 | | -// |
| 23 | | - |
| 24 | | - |
| 25 | | -#include "global.h" |
| 26 | | -#include "i2c.h" |
| 27 | | -#include "backlight.h" |
| 28 | | - |
| 29 | | - |
| 30 | | -static bool backlight_fade; |
| 31 | | - |
| 32 | | - |
| 33 | | -void backlight_on(bool on) |
| 34 | | -{ |
| | 2 | +//
|
| | 3 | +//
|
| | 4 | +// Copyright 2010 TheSeven
|
| | 5 | +//
|
| | 6 | +//
|
| | 7 | +// This file is part of emBIOS.
|
| | 8 | +//
|
| | 9 | +// emBIOS is free software: you can redistribute it and/or
|
| | 10 | +// modify it under the terms of the GNU General Public License as
|
| | 11 | +// published by the Free Software Foundation, either version 2 of the
|
| | 12 | +// License, or (at your option) any later version.
|
| | 13 | +//
|
| | 14 | +// emBIOS is distributed in the hope that it will be useful,
|
| | 15 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| | 16 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
| | 17 | +// See the GNU General Public License for more details.
|
| | 18 | +//
|
| | 19 | +// You should have received a copy of the GNU General Public License along
|
| | 20 | +// with emBIOS. If not, see <http://www.gnu.org/licenses/>.
|
| | 21 | +//
|
| | 22 | +//
|
| | 23 | +
|
| | 24 | +
|
| | 25 | +#include "global.h"
|
| | 26 | +#include "i2c.h"
|
| | 27 | +#include "backlight.h"
|
| | 28 | +
|
| | 29 | +
|
| | 30 | +static bool backlight_fade;
|
| | 31 | +
|
| | 32 | +
|
| | 33 | +void backlight_init()
|
| | 34 | +{
|
| | 35 | +}
|
| | 36 | +
|
| | 37 | +void backlight_on(bool on)
|
| | 38 | +{
|
| 35 | 39 | i2c_sendbyte(0, 0xe6, 0x31, (backlight_fade ? 2 : 0) + (on ? 1 : 0));
|
| 36 | | -} |
| 37 | | - |
| 38 | | -void backlight_set_fade(uint8_t fade) |
| 39 | | -{ |
| | 40 | +}
|
| | 41 | +
|
| | 42 | +void backlight_set_fade(uint8_t fade)
|
| | 43 | +{
|
| 40 | 44 | backlight_fade = fade;
|
| 41 | | -} |
| 42 | | - |
| 43 | | -void backlight_set_brightness(uint8_t brightness) |
| 44 | | -{ |
| | 45 | +}
|
| | 46 | +
|
| | 47 | +void backlight_set_brightness(uint8_t brightness)
|
| | 48 | +{
|
| 45 | 49 | i2c_sendbyte(0, 0xe6, 0x30, (250 * (brightness & 0xff)) >> 8);
|
| 46 | | -} |
| | 50 | +}
|