summaryrefslogtreecommitdiffstats
path: root/apps/plugins/test_grey.c
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2010-06-16 09:12:46 +0000
committerMarcin Bukat <marcin.bukat@gmail.com>2010-06-16 09:12:46 +0000
commit23b9df2890480e2a6e20f13f041f8f8bc2a2ccef (patch)
tree05b11edf01b3f73ff971971d0a8ec027e77c1606 /apps/plugins/test_grey.c
parent0d48448500129669c35f3316d86a98a41c0c8452 (diff)
downloadrockbox-23b9df2890480e2a6e20f13f041f8f8bc2a2ccef.tar.gz
rockbox-23b9df2890480e2a6e20f13f041f8f8bc2a2ccef.tar.bz2
rockbox-23b9df2890480e2a6e20f13f041f8f8bc2a2ccef.zip
Add interpolation so output file contains lcdlinear[] matrix dump
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26869 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/test_grey.c')
-rw-r--r--apps/plugins/test_grey.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/apps/plugins/test_grey.c b/apps/plugins/test_grey.c
index be28bedfb3..31f63100aa 100644
--- a/apps/plugins/test_grey.c
+++ b/apps/plugins/test_grey.c
@@ -85,7 +85,7 @@ PLUGIN_HEADER
#elif CONFIG_KEYPAD == MPIO_HD200_PAD
#define GREY_QUIT (BUTTON_REC|BUTTON_PLAY)
-#define GREY_OK BUTTON_SELECT
+#define GREY_OK BUTTON_PLAY
#define GREY_PREV BUTTON_PREV
#define GREY_NEXT BUTTON_NEXT
#define GREY_UP BUTTON_VOL_UP
@@ -158,7 +158,7 @@ enum plugin_status plugin_start(const void* parameter)
{
bool done = false;
int cur_step = 1;
- int button, i, l, fd;
+ int button, i, j, l, fd;
unsigned char filename[MAX_PATH];
/* standard stuff */
@@ -182,6 +182,8 @@ enum plugin_status plugin_start(const void* parameter)
grey_clear_display();
grey_show(true);
+ rb->lcd_setfont(FONT_SYSFIXED);
+
while (!done)
{
fill_rastered(-3, -3, 2, 2, cur_step - 1);
@@ -235,14 +237,29 @@ enum plugin_status plugin_start(const void* parameter)
break;
case GREY_OK:
+
+ /* dump result in form suitable for lcdlinear[] */
rb->create_numbered_filename(filename, "/", "test_grey_",
".txt", 2 IF_CNFN_NUM_(, NULL));
fd = rb->open(filename, O_RDWR|O_CREAT|O_TRUNC, 0666);
if (fd >= 0)
{
+ rb->fdprintf(fd, "Adjusted grey shades\n");
for (i = 0; i <= STEPS; i++)
rb->fdprintf(fd, "%3d: %3d\n", input_levels[i],
lcd_levels[i]);
+ rb->fdprintf(fd,"\n\nInterpolated lcdlinear matrix\n");
+
+ for (i = 1; i <= STEPS; i++)
+ {
+ for (j=0; j < STEPS; j++)
+ {
+ rb->fdprintf(fd, "%3d, ",
+ lcd_levels[i-1] +
+ ((lcd_levels[i] - lcd_levels[i-1])*j)/STEPS);
+ }
+ rb->fdprintf(fd, "\n");
+ }
rb->close(fd);
}
/* fall through */