From d7c3d80258859d154475d7930becfe1c6639f58b Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Thu, 20 Sep 2007 14:16:25 +0000 Subject: (mr500) reset if power is pressed, not very nice, but im sick of using the remote to reset git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14780 a1c6a512-1295-4272-9138-f99709370657 --- bootloader/mrobe500.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/bootloader/mrobe500.c b/bootloader/mrobe500.c index fd2587e..d0b9c2b 100755 --- a/bootloader/mrobe500.c +++ b/bootloader/mrobe500.c @@ -17,7 +17,7 @@ * ****************************************************************************/ - #include "inttypes.h" +#include "inttypes.h" #include "string.h" #include "cpu.h" #include "system.h" @@ -55,6 +55,7 @@ void main(void) uartSetup(); lcd_init(); font_init(); + // dm320_spi_init(); lcd_setfont(FONT_SYSFIXED); @@ -98,18 +99,20 @@ void main(void) printf("ATA"); int count = 0, i = 0, c = 0; char data[64]; + unsigned short out[] = {0x8000}; + unsigned short in[2]; + outw(inw(IO_GIO_DIR1)&~(1<<10), IO_GIO_DIR1); // set GIO26 to output + while(true) { - i = button_read_device(); - c++; - if (i) + if (button_read_device() == BUTTON_POWER) { - c = 0; - __backlight_on(); - printf("button: %x", i); + printf("reset"); + outw(1<<10, IO_GIO_BITSET1); } - else if (c>50) - __backlight_off(); + // dm320_spi_block_transfer(0, out, 16, 16, in, 0); + // printf("%x", in[0]); + } #if 0 rc = ata_init(); -- cgit v1.1