summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbootloader/mrobe500.c23
-rwxr-xr-xfirmware/target/arm/tms320dm320/debug-dm320.c34
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c53
3 files changed, 72 insertions, 38 deletions
diff --git a/bootloader/mrobe500.c b/bootloader/mrobe500.c
index ede05aa25c..1dbe7b8edb 100755
--- a/bootloader/mrobe500.c
+++ b/bootloader/mrobe500.c
@@ -103,7 +103,7 @@ int brightness = 0;
void mrdebug(void)
{
- int button=0, *address=0x0;
+ int button=0;
#if 0
use_calibration(false);
touchpad_calibrate_screen();
@@ -123,19 +123,14 @@ void mrdebug(void)
printf("reset");
IO_GIO_BITSET1|=1<<10;
}
- if(button==BUTTON_RC_PLAY)
- address+=0x02;
- else if (button==BUTTON_RC_DOWN)
- address-=0x02;
- else if (button==BUTTON_RC_FF)
- address+=0x1000;
- else if (button==BUTTON_RC_REW)
- address-=0x1000;
- else if (button==BUTTON_RC_VOL_DOWN) {
+ if (button==BUTTON_RC_VOL_DOWN)
+ {
brightness = (brightness - 5) & 0x7f;
bl_command[2] = brightness;
spi_block_transfer(SPI_target_BACKLIGHT, bl_command, 4, 0, 0);
- } else if (button==BUTTON_RC_VOL_UP) {
+ }
+ else if (button==BUTTON_RC_VOL_UP)
+ {
brightness = (brightness + 5) & 0x7f;
bl_command[2] = brightness;
spi_block_transfer(SPI_target_BACKLIGHT, bl_command, 4, 0, 0);
@@ -145,14 +140,10 @@ void mrdebug(void)
// tsc2100_read_values(&x, &y, &z1, &z2);
// printf("x: %04x y: %04x z1: %04x z2: %04x", x, y, z1, z2);
// printf("tsadc: %4x", tsc2100_readreg(TSADC_PAGE, TSADC_ADDRESS)&0xffff);
- printf("current tick: %04x", current_tick);
- printf("Address: 0x%08x Data: 0x%08x", address, *address);
- printf("Address: 0x%08x Data: 0x%08x", address+1, *(address+1));
- printf("Address: 0x%08x Data: 0x%08x", address+2, *(address+2));
// // tsc2100_keyclick(); /* doesnt work :( */
// line -= 6;
// }
-#if 0
+#if 1
if (button&BUTTON_TOUCHPAD)
{
if (button&BUTTON_REL)
diff --git a/firmware/target/arm/tms320dm320/debug-dm320.c b/firmware/target/arm/tms320dm320/debug-dm320.c
index 417dfee961..e12d86a03d 100755
--- a/firmware/target/arm/tms320dm320/debug-dm320.c
+++ b/firmware/target/arm/tms320dm320/debug-dm320.c
@@ -35,7 +35,7 @@ bool __dbg_ports(void)
bool __dbg_hw_info(void)
{
- int line = 0, button;
+ int line = 0, button, oldline;
int *address=0x0;
bool done=false;
char buf[100];
@@ -43,11 +43,25 @@ bool __dbg_hw_info(void)
lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
lcd_clear_display();
+
+ /* Put all the static text befor the while loop */
lcd_puts(0, line++, "[Hardware info]");
+
+ lcd_puts(0, line++, "Clock info:");
+ snprintf(buf, sizeof(buf), "IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x",
+ IO_CLK_PLLA, IO_CLK_PLLB, IO_CLK_SEL0, IO_CLK_SEL1); lcd_puts(0, line++, buf);
+ snprintf(buf, sizeof(buf), "IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x",
+ IO_CLK_SEL2, IO_CLK_DIV0, IO_CLK_DIV1, IO_CLK_DIV2); lcd_puts(0, line++, buf);
+ snprintf(buf, sizeof(buf), "IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x",
+ IO_CLK_DIV3, IO_CLK_DIV4, IO_CLK_BYP, IO_CLK_INV); lcd_puts(0, line++, buf);
+ snprintf(buf, sizeof(buf), "IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x",
+ IO_CLK_MOD0, IO_CLK_MOD1, IO_CLK_MOD2, IO_CLK_LPCTL0); lcd_puts(0, line++, buf);
+ line++;
+ oldline=line;
while(!done)
{
- line = 0;
+ line = oldline;
button = button_get(false);
button&=~BUTTON_REPEAT;
if (button == BUTTON_POWER)
@@ -61,14 +75,14 @@ bool __dbg_hw_info(void)
else if (button==BUTTON_RC_REW)
address-=0x800;
- snprintf(buf, sizeof(buf), "current tick: %04x", (unsigned int)current_tick);
- lcd_puts(0, line++, buf);
- snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x", (unsigned int)address, *address);
- lcd_puts(0, line++, buf);
- snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x", (unsigned int)(address+1), *(address+1));
- lcd_puts(0, line++, buf);
- snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x", (unsigned int)(address+2), *(address+2));
- lcd_puts(0, line++, buf);
+ snprintf(buf, sizeof(buf), "current tick: %08x Seconds running: %08d",
+ (unsigned int)current_tick, (unsigned int)current_tick/100); lcd_puts(0, line++, buf);
+ snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x",
+ (unsigned int)address, *address); lcd_puts(0, line++, buf);
+ snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x",
+ (unsigned int)(address+1), *(address+1)); lcd_puts(0, line++, buf);
+ snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x",
+ (unsigned int)(address+2), *(address+2)); lcd_puts(0, line++, buf);
lcd_update();
}
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c
index 837677250f..5b20300594 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/button-mr500.c
@@ -47,9 +47,13 @@ void use_calibration(bool enable)
using_calibration = enable;
}
/* Jd's tests.. These will hopefully work for everyone so we dont have to
- create a calibration screen. and
-(0,0) = 0x00c0, 0xf40
-(480,320) = 0x0f19, 0x00fc
+ * create a calibration screen.
+ * Portait:
+ * (0,0) = 200, 3900
+ * (480,640) = 3880, 270
+ * Landscape:
+ * (0,0) = 200, 270
+ * (640,480) = 3880, 3900
*/
void set_calibration_points(struct touch_calibration_point *tl,
struct touch_calibration_point *br)
@@ -57,16 +61,25 @@ void set_calibration_points(struct touch_calibration_point *tl,
memcpy(&topleft, tl, sizeof(struct touch_calibration_point));
memcpy(&bottomright, br, sizeof(struct touch_calibration_point));
}
+
static int touch_to_pixels(short val_x, short val_y)
{
short x,y;
- int x1,x2;
+
+#ifdef SCREEN_ROTATE /* portait */
+ x=val_x;
+ y=val_y;
+#else
+ x=val_y;
+ y=val_x;
+#endif
+
if (!using_calibration)
return (val_x<<16)|val_y;
- x1 = topleft.val_x; x2 = bottomright.val_x;
- x = (val_x-x1)*(bottomright.px_x - topleft.px_x) / (x2 - x1) + topleft.px_x;
- x1 = topleft.val_y; x2 = bottomright.val_y;
- y = (val_y-x1)*(bottomright.px_y - topleft.px_y) / (x2 - x1) + topleft.px_y;
+
+ x = (x-topleft.val_x)*(bottomright.px_x - topleft.px_x) / (bottomright.val_x - topleft.val_x) + topleft.px_x;
+ y = (y-topleft.val_y)*(bottomright.px_y - topleft.px_y) / (bottomright.val_y - topleft.val_y) + topleft.px_y;
+
if (x < 0)
x = 0;
if (y < 0)
@@ -79,11 +92,27 @@ void button_init_device(void)
touch_available = false;
/* GIO is the power button, set as input */
IO_GIO_DIR0 |= 0x01;
- topleft.px_x = 0; topleft.px_y = 0;
- topleft.val_x = 0x00c0; topleft.val_y = 0xf40;
+
+#ifdef SCREEN_ROTATE /* portait */
+ topleft.val_x = 200;
+ topleft.val_y = 3900;
+
+ bottomright.val_x = 3880;
+ bottomright.val_y = 270;
+#else /* landscape */
+ topleft.val_x = 270;
+ topleft.val_y = 200;
+
+ bottomright.val_x = 3900;
+ bottomright.val_y = 3880;
+#endif
+
+ topleft.px_x = 0;
+ topleft.px_y = 0;
- bottomright.px_x = LCD_WIDTH; bottomright.px_y = LCD_HEIGHT;
- bottomright.val_x = 0x0f19; bottomright.val_y = 0x00fc;
+ bottomright.px_x = LCD_WIDTH;
+ bottomright.px_y = LCD_HEIGHT;
+
using_calibration = true;
/* Enable the touchscreen interrupt */