From 525c17277ccccf4459be16018576b44e9e6a2a35 Mon Sep 17 00:00:00 2001 From: reinelt Date: Wed, 10 Sep 2003 03:48:23 +0000 Subject: [lcd4linux @ 2003-09-10 03:48:22 by reinelt] Icons for M50530, new processing scheme (Ticks.Text...) git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@235 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- M50530.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'M50530.c') diff --git a/M50530.c b/M50530.c index 0fa506d..f43d9e2 100644 --- a/M50530.c +++ b/M50530.c @@ -1,4 +1,4 @@ -/* $Id: M50530.c,v 1.13 2003/09/09 06:54:43 reinelt Exp $ +/* $Id: M50530.c,v 1.14 2003/09/10 03:48:22 reinelt Exp $ * * driver for display modules based on the M50530 chip * @@ -20,6 +20,9 @@ * * * $Log: M50530.c,v $ + * Revision 1.14 2003/09/10 03:48:22 reinelt + * Icons for M50530, new processing scheme (Ticks.Text...) + * * Revision 1.13 2003/09/09 06:54:43 reinelt * new function 'cfg_number()' * @@ -82,6 +85,7 @@ #include "cfg.h" #include "display.h" #include "bar.h" +#include "icon.h" #include "parport.h" #include "udelay.h" @@ -90,7 +94,8 @@ #define CHARS 8 static LCD Lcd; -static int GPO=0; +static int GPO=0; +static int Icons; static char *FrameBuffer1=NULL; static char *FrameBuffer2=NULL; @@ -166,7 +171,10 @@ int M5_clear (int full) { memset (FrameBuffer1, ' ', Lcd.rows*Lcd.cols*sizeof(char)); + + icon_clear(); bar_clear(); + GPO=0; if (full) { @@ -228,7 +236,15 @@ int M5_init (LCD *Self) M5_command (0x0050, 20); // set entry mode M5_command (0x0030, 20); // set display mode - bar_init(rows, cols, XRES, YRES, CHARS); + if (cfg_number("Icons", 0, 0, CHARS, &Icons)<0) return -1; + if (Icons>0) { + info ("reserving %d of %d user-defined characters for icons", Icons, CHARS); + icon_init(Lcd.rows, Lcd.cols, XRES, YRES, CHARS, Icons, M5_define_char); + Self->icons=Icons; + Lcd.icons=Icons; + } + + bar_init(rows, cols, XRES, YRES, CHARS-Icons); bar_add_segment(0,0,255,32); // ASCII 32 = blank M5_clear(1); @@ -265,6 +281,12 @@ int M5_bar (int type, int row, int col, int max, int len1, int len2) } +int M5_icon (int num, int seq, int row, int col) +{ + return icon_draw (num, seq, row, col); +} + + int M5_gpo (int num, int val) { if (num>=Lcd.gpos) @@ -289,6 +311,7 @@ int M5_flush (void) for (row=0; row