aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-03-03 03:41:02 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-03-03 03:41:02 +0000
commitd0b39b590e56b191394cfcb6b8690de0fbd87957 (patch)
tree5168f4922a7541cfcb9e8848e3cd09e32431e16e
parentbfd7907defaef0916e1748bbdcf4a2fd6b8fc936 (diff)
downloadlcd4linux-d0b39b590e56b191394cfcb6b8690de0fbd87957.tar.gz
[lcd4linux @ 2004-03-03 03:41:02 by reinelt]
Crystalfontz Contrast issue fixed git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@383 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r--drv_Crystalfontz.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drv_Crystalfontz.c b/drv_Crystalfontz.c
index ed26896..7b7889d 100644
--- a/drv_Crystalfontz.c
+++ b/drv_Crystalfontz.c
@@ -1,4 +1,4 @@
-/* $Id: drv_Crystalfontz.c,v 1.12 2004/03/01 04:29:51 reinelt Exp $
+/* $Id: drv_Crystalfontz.c,v 1.13 2004/03/03 03:41:02 reinelt Exp $
*
* new style driver for Crystalfontz display modules
*
@@ -23,6 +23,9 @@
*
*
* $Log: drv_Crystalfontz.c,v $
+ * Revision 1.13 2004/03/03 03:41:02 reinelt
+ * Crystalfontz Contrast issue fixed
+ *
* Revision 1.12 2004/03/01 04:29:51 reinelt
* cfg_number() returns -1 on error, 0 if value not found (but default val used),
* and 1 if value was used from the configuration.
@@ -409,31 +412,30 @@ static int drv_CF_contrast (int contrast)
if (contrast == -1) return Contrast;
if (contrast < 0 ) contrast = 0;
+ if (contrast > 255) contrast = 255;
Contrast=contrast;
-
+
switch (Protocol) {
case 1:
// contrast range 0 to 100
- if (contrast > 100) contrast = 100;
+ if (Contrast > 100) Contrast = 100;
buffer[0] = 15; // Set LCD Contrast
- buffer[1] = contrast;
+ buffer[1] = Contrast;
drv_CF_write1 (buffer, 2);
break;
case 2:
// contrast range 0 to 50
- if (contrast > 50) contrast = 50;
- drv_CF_send (13, 1, &contrast);
+ if (Contrast > 50) Contrast = 50;
+ drv_CF_send (13, 1, &Contrast);
break;
case 3:
// contrast range 0 to 50
- if (contrast > 255) contrast = 255;
- drv_CF_send (13, 1, &contrast);
+ drv_CF_send (13, 1, &Contrast);
break;
}
- Contrast=contrast;
return Contrast;
}