summaryrefslogtreecommitdiff
path: root/bootloader
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader')
-rwxr-xr-xbootloader/mrobe500.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/bootloader/mrobe500.c b/bootloader/mrobe500.c
index 1bfadd4769..3c98ae25f3 100755
--- a/bootloader/mrobe500.c
+++ b/bootloader/mrobe500.c
@@ -38,8 +38,9 @@
38#include "common.h" 38#include "common.h"
39#include "rbunicode.h" 39#include "rbunicode.h"
40#include "usb.h" 40#include "usb.h"
41#include "spi-target.h" 41#include "spi.h"
42#include "uart-target.h" 42#include "uart-target.h"
43#include "tsc2100.h"
43 44
44extern int line; 45extern int line;
45 46
@@ -59,7 +60,7 @@ void main(void)
59 uartSetup(); 60 uartSetup();
60 lcd_init(); 61 lcd_init();
61 font_init(); 62 font_init();
62 dm320_spi_init(); 63 spi_init();
63 64
64 lcd_setfont(FONT_SYSFIXED); 65 lcd_setfont(FONT_SYSFIXED);
65 66
@@ -102,7 +103,7 @@ void main(void)
102 103
103 printf("ATA"); 104 printf("ATA");
104 105
105 outw(inw(IO_GIO_DIR1)&~(1<<10), IO_GIO_DIR1); // set GIO26 to output 106 outw(inw(IO_GIO_DIR1)&~(1<<10), IO_GIO_DIR1); // set GIO26 (reset pin) to output
106 while(true) 107 while(true)
107 { 108 {
108 if (button_read_device() == BUTTON_POWER) 109 if (button_read_device() == BUTTON_POWER)
@@ -110,20 +111,15 @@ void main(void)
110 printf("reset"); 111 printf("reset");
111 outw(1<<10, IO_GIO_BITSET1); 112 outw(1<<10, IO_GIO_BITSET1);
112 } 113 }
113 114 // if ((inw(IO_GIO_BITSET0)&(1<<14)) == 0)
114 // Read X, Y, Z1, Z2 touchscreen coordinates. 115 {
115 int page = 0, address = 0; 116 short x,y,z1,z2, reg;
116 unsigned short command = 0x8000|(page << 11)|(address << 5); 117 tsc2100_read_values(&x, &y, &z1, &z2);
117 unsigned char out[] = {command >> 8, command & 0xff}; 118 printf("x: %04x y: %04x z1: %04x z2: %04x", x, y, z1, z2);
118 unsigned char in[8]; 119 printf("tsadc: %4x", tsc2100_readreg(TSADC_PAGE, TSADC_ADDRESS)&0xffff);
119 dm320_spi_block_transfer(out, sizeof(out), in, sizeof(in)); 120 tsc2100_keyclick(); /* doesnt work :( */
120 121 line -= 2;
121 printf("%02x%02x %02x%02x %02x%02x %02x%02x\n", 122 }
122 in[0], in[1],
123 in[2], in[3],
124 in[4], in[5],
125 in[6], in[7]);
126 line--;
127 123
128 } 124 }
129#if 0 125#if 0