1
0
Fork 0
forked from len0rd/rockbox

(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
This commit is contained in:
Jonathan Gordon 2007-09-20 14:16:25 +00:00
parent 4d853fff2f
commit d7c3d80258

View file

@ -17,7 +17,7 @@
* *
****************************************************************************/ ****************************************************************************/
#include "inttypes.h" #include "inttypes.h"
#include "string.h" #include "string.h"
#include "cpu.h" #include "cpu.h"
#include "system.h" #include "system.h"
@ -55,6 +55,7 @@ void main(void)
uartSetup(); uartSetup();
lcd_init(); lcd_init();
font_init(); font_init();
// dm320_spi_init();
lcd_setfont(FONT_SYSFIXED); lcd_setfont(FONT_SYSFIXED);
@ -98,18 +99,20 @@ void main(void)
printf("ATA"); printf("ATA");
int count = 0, i = 0, c = 0; int count = 0, i = 0, c = 0;
char data[64]; 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) while(true)
{ {
i = button_read_device(); if (button_read_device() == BUTTON_POWER)
c++;
if (i)
{ {
c = 0; printf("reset");
__backlight_on(); outw(1<<10, IO_GIO_BITSET1);
printf("button: %x", i);
} }
else if (c>50) // dm320_spi_block_transfer(0, out, 16, 16, in, 0);
__backlight_off(); // printf("%x", in[0]);
} }
#if 0 #if 0
rc = ata_init(); rc = ata_init();