diff options
author | wdenk <wdenk> | 2003-05-20 20:49:01 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2003-05-20 20:49:01 +0000 |
commit | 82226bf4d2fe87076d7f5d7e2677fdd5d0e35fc2 (patch) | |
tree | 5d03167fc333d401f2eea37dcad640b77516d4d3 /common/cmd_vfd.c | |
parent | 7f70e85309c6367138c0ebd14abdd49964b8d50a (diff) | |
download | u-boot-imx-82226bf4d2fe87076d7f5d7e2677fdd5d0e35fc2.zip u-boot-imx-82226bf4d2fe87076d7f5d7e2677fdd5d0e35fc2.tar.gz u-boot-imx-82226bf4d2fe87076d7f5d7e2677fdd5d0e35fc2.tar.bz2 |
* Add support for arbitrary bitmaps for TRAB's VFD command
* Patch by Christian Geißinger, 19 May 2002:
On TRAB: wait until the dummy byte has been completely sent
Diffstat (limited to 'common/cmd_vfd.c')
-rw-r--r-- | common/cmd_vfd.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/common/cmd_vfd.c b/common/cmd_vfd.c index 49df56c..ac0224c 100644 --- a/common/cmd_vfd.c +++ b/common/cmd_vfd.c @@ -36,11 +36,10 @@ #include <command.h> #if (CONFIG_COMMANDS & CFG_CMD_VFD) -#ifdef VFD_TEST_LOGO + #include <vfd_logo.h> #define VFD_TEST_LOGO_BMPNR 0 #define VFD_REMOTE_LOGO_BMPNR 1 -#endif extern int transfer_pic(unsigned char, unsigned char *, int, int); @@ -55,9 +54,15 @@ int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 1; } - bitmap = simple_strtoul(argv[1], NULL, 10); + if (argv[1][0] == '#') { /* select bitmap by number */ + bitmap = simple_strtoul(argv[1]+1, NULL, 10); + return (trab_vfd(bitmap)); + } - return (trab_vfd(bitmap)); + /* display bitmap at given address */ + bitmap = simple_strtoul(argv[1], NULL, 16); + transfer_pic(1, (uchar *)bitmap, VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH); + return 0; } #endif /* CFG_CMD_VFD */ @@ -65,19 +70,17 @@ int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) int trab_vfd (ulong bitmap) { switch (bitmap) { -#ifdef VFD_TEST_LOGO - case VFD_TEST_LOGO_BMPNR: - transfer_pic(1, &vfd_test_logo_bitmap[0], - VFD_TEST_LOGO_HEIGHT, VFD_TEST_LOGO_WIDTH); - return 0; - case VFD_REMOTE_LOGO_BMPNR: - transfer_pic(1, &vfd_remote_logo_bitmap[0], - VFD_REMOTE_LOGO_HEIGHT, VFD_REMOTE_LOGO_WIDTH); - return 0; -#endif - default: - printf("Unknown bitmap %ld\n", bitmap); - return 1; + case VFD_TEST_LOGO_BMPNR: + transfer_pic(1, &vfd_test_logo_bitmap[0], + VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH); + return 0; + case VFD_REMOTE_LOGO_BMPNR: + transfer_pic(1, &vfd_remote_logo_bitmap[0], + VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH); + return 0; + default: + printf("Unknown bitmap %ld\n", bitmap); + return 1; } /* NOTREACHED */ } |