summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-09-04 12:34:13 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-09-04 12:34:13 +0000
commit0f387e913abb2cb53578088246eff81eca7beaf2 (patch)
treedbf30fccfbb8a958857cb31b1877efc32e7c4763 /firmware
parentdb6242c719be17af57f8fdace2f28d107afe9288 (diff)
downloadrockbox-0f387e913abb2cb53578088246eff81eca7beaf2.tar.gz
rockbox-0f387e913abb2cb53578088246eff81eca7beaf2.zip
Added (disabled) screendump feature
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2172 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/serial.c54
1 files changed, 53 insertions, 1 deletions
diff --git a/firmware/drivers/serial.c b/firmware/drivers/serial.c
index 112e45c1e4..91e2a6911f 100644
--- a/firmware/drivers/serial.c
+++ b/firmware/drivers/serial.c
@@ -27,7 +27,7 @@
#include "lcd.h"
#include "serial.h"
-/* Recieved byte identifiers */
+/* Received byte identifiers */
#define PLAY 0xC1
#define STOP 0xC2
#define PREV 0xC4
@@ -35,6 +35,12 @@
#define VOLUP 0xD0
#define VOLDN 0xE0
+#ifdef SCREENDUMP
+#define SCRDMP 0xF0
+
+static void screen_dump(void);
+#endif
+
void serial_setup (void)
{
char dummy;
@@ -86,6 +92,12 @@ static void process_byte(int byte)
case NEXT:
btn = BUTTON_RIGHT;
break;
+
+#ifdef SCREENDUMP
+ case SCRDMP:
+ screen_dump();
+ break;
+#endif
}
if ( btn ) {
@@ -110,3 +122,43 @@ void RXI1 (void)
SSR1 = SSR1 & ~0x40; /* Clear RDRF */
process_byte(serial_byte);
}
+
+#ifdef SCREENDUMP
+static void serial_enable_tx(void)
+{
+ SCR1 |= 0x20;
+}
+
+static void serial_tx(unsigned char ch)
+{
+ while (!(SSR1 & SCI_TDRE))
+ {
+ ;
+ }
+
+ /*
+ * Write data into TDR and clear TDRE
+ */
+ TDR1 = ch;
+ SSR1 &= ~SCI_TDRE;
+}
+
+static void screen_dump(void)
+{
+ int x, y;
+ int level;
+
+ serial_enable_tx();
+
+ level = set_irq_level(15);
+ for(y = 0;y < LCD_HEIGHT/8;y++)
+ {
+ for(x = 0;x < LCD_WIDTH;x++)
+ {
+ serial_tx(lcd_framebuffer[x][y]);
+ }
+ }
+ set_irq_level(level);
+}
+
+#endif