| Index: apps/installer-nano2g/Makefile |
| — | — | @@ -153,6 +153,8 @@ |
| 154 | 154 | flashfiles: $(FLASHFILES)
|
| 155 | 155 | @touch flashfiles.built
|
| 156 | 156 |
|
| | 157 | +$(UNINSTDIR)/build/uninstaller-nano2g.embiosapp.ucl: uninstaller-nano2g
|
| | 158 | +
|
| 157 | 159 | flashfiles/uninstaller-nano2g.embiosapp.ucl: $(UNINSTDIR)/build/uninstaller-nano2g.embiosapp.ucl uninstaller-nano2g
|
| 158 | 160 | @echo [CP] $@
|
| 159 | 161 | @cp $< $@
|
| — | — | @@ -165,10 +167,14 @@ |
| 166 | 168 | @echo [UCL] $<
|
| 167 | 169 | @$(UCLPACK) $< $@
|
| 168 | 170 |
|
| | 171 | +$(ILOADERDIR)/build/iloader.embiosapp.ucl: iloader
|
| | 172 | +
|
| 169 | 173 | flashfiles/iloader.embiosapp.ucl: $(ILOADERDIR)/build/iloader.embiosapp.ucl iloader
|
| 170 | 174 | @echo [CP] $@
|
| 171 | 175 | @cp $< $@
|
| 172 | 176 |
|
| | 177 | +$(EMBIOSDIR)/loader/ipodnano2g/build/embiosldr-ipodnano2g.dfu: embiosldr-ipodnano2g
|
| | 178 | +
|
| 173 | 179 | flashfiles/embiosldr-ipodnano2g.dfu: $(EMBIOSDIR)/loader/ipodnano2g/build/embiosldr-ipodnano2g.dfu embiosldr-ipodnano2g
|
| 174 | 180 | @echo [CP] $@
|
| 175 | 181 | @cp $< $@
|
| — | — | @@ -177,7 +183,9 @@ |
| 178 | 184 | @echo [UCL] $<
|
| 179 | 185 | @$(UCLPACK) $< $@
|
| 180 | 186 |
|
| 181 | | - flashfiles/embios-ipodnano2g.bin: $(EMBIOSDIR)/build/ipodnano2g/embios.bin embios
|
| | 187 | +$(EMBIOSDIR)/build/ipodnano2g/embios.bin: embios
|
| | 188 | +
|
| | 189 | +flashfiles/embios-ipodnano2g.bin: $(EMBIOSDIR)/build/ipodnano2g/embios.bin embios
|
| 182 | 190 | @echo [EMBCFG] $@
|
| 183 | 191 | @$(EMBIOSBOOTCFG) $< $@ --file=/iLoader/boot.embiosapp --file-compressed --file-run-from=0x08000000 \
|
| 184 | 192 | --flash=iloader --flash-compressed --flash-run-from=0x09e00000
|
| Index: embios/trunk/target/ipodnano2g/lcd.S |
| — | — | @@ -34,6 +34,69 @@ |
| 35 | 35 | mov pc, lr
|
| 36 | 36 | .size lcd_init, .-lcd_init
|
| 37 | 37 |
|
| | 38 | +.section .icode.lcd_shutdown, "ax", %progbits
|
| | 39 | +.align 2
|
| | 40 | +.global lcd_shutdown
|
| | 41 | +.type lcd_shutdown, %function
|
| | 42 | +lcd_shutdown:
|
| | 43 | + stmfd sp!, {r4, lr}
|
| | 44 | + bl displaylcd_detectlcd
|
| | 45 | + sub r12, r12, #0x04900000
|
| | 46 | + cmp r0, #2
|
| | 47 | + beq lcd_shutdown_type2
|
| | 48 | + mov r0, #0x28
|
| | 49 | + bl displaylcd_sendlcdc
|
| | 50 | + mov r0, #0x10
|
| | 51 | + bl displaylcd_sendlcdc
|
| | 52 | + b lcd_shutdown_done
|
| | 53 | +lcd_shutdown_type2:
|
| | 54 | + mov r0, #0x07
|
| | 55 | + bl displaylcd_sendlcd2c
|
| | 56 | + mov r0, #0x200
|
| | 57 | + orr r0, r0, #0x32
|
| | 58 | + bl displaylcd_sendlcd2d
|
| | 59 | + mov r0, #0x13
|
| | 60 | + bl displaylcd_sendlcd2c
|
| | 61 | + mov r0, #0x1100
|
| | 62 | + orr r0, #0x37
|
| | 63 | + bl displaylcd_sendlcd2d
|
| | 64 | + mov r0, #0x07
|
| | 65 | + bl displaylcd_sendlcd2c
|
| | 66 | + mov r0, #0x200
|
| | 67 | + orr r0, r0, #0x01
|
| | 68 | + bl displaylcd_sendlcd2d
|
| | 69 | + mov r0, #0x13
|
| | 70 | + bl displaylcd_sendlcd2c
|
| | 71 | + mov r0, #0x100
|
| | 72 | + orr r0, #0x37
|
| | 73 | + bl displaylcd_sendlcd2d
|
| | 74 | + mov r0, #0x07
|
| | 75 | + bl displaylcd_sendlcd2c
|
| | 76 | + mov r0, #0x200
|
| | 77 | + bl displaylcd_sendlcd2d
|
| | 78 | + mov r0, #0x10
|
| | 79 | + bl displaylcd_sendlcd2c
|
| | 80 | + mov r0, #0x680
|
| | 81 | + bl displaylcd_sendlcd2d
|
| | 82 | + mov r0, #0x12
|
| | 83 | + bl displaylcd_sendlcd2c
|
| | 84 | + mov r0, #0x160
|
| | 85 | + bl displaylcd_sendlcd2d
|
| | 86 | + mov r0, #0x13
|
| | 87 | + bl displaylcd_sendlcd2c
|
| | 88 | + mov r0, #0x100
|
| | 89 | + orr r0, r0, #0x27
|
| | 90 | + bl displaylcd_sendlcd2d
|
| | 91 | + mov r0, #0x10
|
| | 92 | + bl displaylcd_sendlcd2c
|
| | 93 | + mov r0, #0x600
|
| | 94 | + bl displaylcd_sendlcd2d
|
| | 95 | +lcd_shutdown_done:
|
| | 96 | + ldmfd sp!, {r4, lr}
|
| | 97 | + mov r0, #5120
|
| | 98 | + b sleep
|
| | 99 | +.size lcd_shutdown, .-lcd_shutdown
|
| | 100 | +
|
| 38 | 101 | .section .text.lcd_get_width, "ax", %progbits
|
| 39 | 102 | .align 2
|
| 40 | 103 | .global lcd_get_width
|
| Index: embios/trunk/target/ipodnano2g/backlight.c |
| — | — | @@ -1,42 +1,42 @@ |
| 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 | | -void backlight_on(bool on) |
| 31 | | -{ |
| | 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 | +void backlight_on(bool on)
|
| | 31 | +{
|
| 32 | 32 | i2c_sendbyte(0, 0xe6, 0x29, on ? 1 : 0);
|
| 33 | | -} |
| 34 | | - |
| 35 | | -void backlight_set_fade(uint8_t fade) |
| 36 | | -{ |
| | 33 | +}
|
| | 34 | +
|
| | 35 | +void backlight_set_fade(uint8_t fade)
|
| | 36 | +{
|
| 37 | 37 | i2c_sendbyte(0, 0xe6, 0x2b, fade);
|
| 38 | | -} |
| 39 | | - |
| 40 | | -void backlight_set_brightness(uint8_t brightness) |
| 41 | | -{ |
| | 38 | +}
|
| | 39 | +
|
| | 40 | +void backlight_set_brightness(uint8_t brightness)
|
| | 41 | +{
|
| 42 | 42 | i2c_sendbyte(0, 0xe6, 0x28, (46 * (brightness & 0xff)) >> 8);
|
| 43 | | -} |
| | 43 | +}
|
| Index: embios/trunk/target/ipodnano2g/target.h |
| — | — | @@ -41,6 +41,7 @@ |
| 42 | 42 | #define USB_NUM_ENDPOINTS 5
|
| 43 | 43 |
|
| 44 | 44 | #define HAVE_LCD
|
| | 45 | +#define HAVE_LCD_SHUTDOWN
|
| 45 | 46 | #define LCD_WIDTH 176
|
| 46 | 47 | #define LCD_HEIGHT 132
|
| 47 | 48 | #define LCD_FORMAT rgb565
|
| Index: embios/trunk/lcd.h |
| — | — | @@ -32,6 +32,7 @@ |
| 33 | 33 |
|
| 34 | 34 |
|
| 35 | 35 | void lcd_init() INITCODE_ATTR;
|
| | 36 | +void lcd_shutdown();
|
| 36 | 37 | int lcd_get_width() ICODE_ATTR;
|
| 37 | 38 | int lcd_get_height() ICODE_ATTR;
|
| 38 | 39 | int lcd_get_bytes_per_pixel() ICODE_ATTR;
|
| Index: embios/trunk/shutdown.c |
| — | — | @@ -31,4 +31,14 @@ |
| 32 | 32 | #ifdef HAVE_STORAGE_FLUSH
|
| 33 | 33 | storage_flush();
|
| 34 | 34 | #endif
|
| | 35 | + if (shutdownhw)
|
| | 36 | + {
|
| | 37 | +#ifdef HAVE_BACKLIGHT
|
| | 38 | + backlight_set_fade(0);
|
| | 39 | + backlight_on(false);
|
| | 40 | +#endif
|
| | 41 | +#ifdef HAVE_LCD_SHUTDOWN
|
| | 42 | + lcd_shutdown();
|
| | 43 | +#endif
|
| | 44 | + }
|
| 35 | 45 | }
|