summaryrefslogtreecommitdiff
path: root/bootloader/mrobe500.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader/mrobe500.c')
-rw-r--r--bootloader/mrobe500.c145
1 files changed, 0 insertions, 145 deletions
diff --git a/bootloader/mrobe500.c b/bootloader/mrobe500.c
index e503baa01d..9052cbdc3c 100644
--- a/bootloader/mrobe500.c
+++ b/bootloader/mrobe500.c
@@ -46,147 +46,6 @@
46#include "time.h" 46#include "time.h"
47#include "system-arm.h" 47#include "system-arm.h"
48 48
49//#define MRDEBUG
50
51#if defined(MRDEBUG)
52
53extern int line;
54#if 0
55struct touch_calibration_point tl, br;
56
57void touchscreen_get_one_point(struct touch_calibration_point *p)
58{
59 int data = 0;
60 int start = current_tick;
61 while (TIME_AFTER(start+(HZ/3), current_tick))
62 {
63 if (button_read_device()&BUTTON_TOUCHSCREEN)
64 {
65 data = button_get_last_touch();
66 p->val_x = data>>16;
67 p->val_y = data&0xffff;
68 start = current_tick;
69 }
70 else if (data == 0)
71 start = current_tick;
72 }
73}
74
75#define MARGIN 25
76#define LEN 7
77void touchscreen_calibrate_screen(void)
78{
79 reset_screen();
80 printf("touch the center of the crosshairs to calibrate");
81 /* get the topleft value */
82 lcd_hline(MARGIN-LEN, MARGIN+LEN, MARGIN);
83 lcd_vline(MARGIN, MARGIN-LEN, MARGIN+LEN);
84 lcd_update();
85 tl.px_x = MARGIN; tl.px_y = MARGIN;
86 touchscreen_get_one_point(&tl);
87 reset_screen();
88 printf("touch the center of the crosshairs to calibrate");
89 /* get the topright value */
90 lcd_hline(LCD_WIDTH-MARGIN-LEN, LCD_WIDTH-MARGIN+LEN, LCD_HEIGHT-MARGIN);
91 lcd_vline(LCD_WIDTH-MARGIN, LCD_HEIGHT-MARGIN-LEN, LCD_HEIGHT-MARGIN+LEN);
92 lcd_update();
93 br.px_x = LCD_WIDTH-MARGIN; br.px_y = LCD_HEIGHT-MARGIN;
94 touchscreen_get_one_point(&br);
95 reset_screen();
96 line++;
97 printf("tl %d %d", tl.val_x, tl.val_y);
98 printf("br %d %d", br.val_x, br.val_y);
99 line++;
100 set_calibration_points(&tl, &br);
101}
102#endif
103static uint8_t bl_command[] = {0xa4, 0x00, 0x00, 0xbb};
104int brightness = 0;
105
106void mrdebug(void)
107{
108 int button=0;
109#if 0
110 use_calibration(false);
111 touchscreen_calibrate_screen();
112 use_calibration(true);
113#endif
114
115 while(true)
116 {
117#if 0
118 struct tm *t = get_time();
119 printf("%d:%d:%d %d %d %d", t->tm_hour, t->tm_min, t->tm_sec, t->tm_mday, t->tm_mon, t->tm_year);
120 printf("time: %d", mktime(t));
121#endif
122 button = button_get(false);
123 if (button == BUTTON_POWER)
124 {
125 printf("reset");
126 IO_GIO_BITSET1|=1<<10;
127 }
128 if (button==BUTTON_RC_VOL_DOWN)
129 {
130 brightness = (brightness - 5) & 0x7f;
131 bl_command[2] = brightness;
132 spi_block_transfer(SPI_target_BACKLIGHT, bl_command, 4, 0, 0);
133 }
134 else if (button==BUTTON_RC_VOL_UP)
135 {
136 brightness = (brightness + 5) & 0x7f;
137 bl_command[2] = brightness;
138 spi_block_transfer(SPI_target_BACKLIGHT, bl_command, 4, 0, 0);
139 }
140// {
141// short x,y,z1,z2;
142// tsc2100_read_values(&x, &y, &z1, &z2);
143// printf("x: %04x y: %04x z1: %04x z2: %04x", x, y, z1, z2);
144// printf("tsadc: %4x", tsc2100_readreg(TSADC_PAGE, TSADC_ADDRESS)&0xffff);
145// // tsc2100_keyclick(); /* doesnt work :( */
146// line -= 6;
147// }
148 else if (button == BUTTON_RC_HEART)
149 {
150 printf("POINT");
151 touchscreen_set_mode(TOUCHSCREEN_POINT);
152 }
153 else if (button == BUTTON_RC_MODE)
154 {
155 printf("BUTTON");
156 touchscreen_set_mode(TOUCHSCREEN_BUTTON);
157 }
158#if 1
159 else if (button&BUTTON_TOUCHSCREEN)
160 {
161 if (button&BUTTON_REL)
162 continue;
163 unsigned int data = button_get_data();
164 int x = (data&0xffff0000)>>16, y = data&0x0000ffff;
165 reset_screen();
166 line = 9;
167 printf("BB: %x %d %d", button, x,y);
168 lcd_hline(x-5, x+5, y);
169 lcd_vline(x, y-5, y+5);
170 lcd_update();
171 }
172 else if (button == BUTTON_RC_PLAY)
173 {
174 reset_screen();
175 }
176
177 else if (button)
178 {
179 // if (button&BUTTON_REL)
180 {
181 printf("%08x %s\n", button, (button&BUTTON_REL)?"yes":"no");
182 }
183 }
184
185#endif
186 }
187}
188#endif
189
190void main(void) 49void main(void)
191{ 50{
192 unsigned char* loadbuffer; 51 unsigned char* loadbuffer;
@@ -252,10 +111,6 @@ void main(void)
252 lcd_update(); 111 lcd_update();
253 } 112 }
254 113
255#if defined(MRDEBUG)
256 mrdebug();
257#endif
258
259 sleep(50); 114 sleep(50);
260 115
261 printf("ATA"); 116 printf("ATA");