aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gdisp/Nokia6610GE8
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-10-21 17:11:46 +1000
committerinmarket <andrewh@inmarket.com.au>2013-10-21 17:11:46 +1000
commit1b3297aeaebdfec5bf8c507ed88445585a0952de (patch)
treeb431c05e0baecfe4dd5a277e4a3438e1cdcd7bce /drivers/gdisp/Nokia6610GE8
parent0698fd28c03e20704376cf6c97f373ba9c5e8c4b (diff)
downloaduGFX-1b3297aeaebdfec5bf8c507ed88445585a0952de.tar.gz
uGFX-1b3297aeaebdfec5bf8c507ed88445585a0952de.tar.bz2
uGFX-1b3297aeaebdfec5bf8c507ed88445585a0952de.zip
Fix a bug in Contrast handling in the Nokia drivers
Diffstat (limited to 'drivers/gdisp/Nokia6610GE8')
-rw-r--r--drivers/gdisp/Nokia6610GE8/gdisp_lld.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld.c b/drivers/gdisp/Nokia6610GE8/gdisp_lld.c
index 1bc7282a..f724ee42 100644
--- a/drivers/gdisp/Nokia6610GE8/gdisp_lld.c
+++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld.c
@@ -199,7 +199,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
// P1: 0x00 = page address normal, column address normal, address scan in column direction
// P2: 0x00 = RGB sequence (default value)
// P3: 0x02 = 4 bits per colour (Type A)
- write_cmd2(g, VOLCTR, 63*GDISP_INITIAL_CONTRAST/100, 0x03); // Voltage control (contrast setting)
+ write_cmd2(g, VOLCTR, 64*GDISP_INITIAL_CONTRAST/101, 0x03); // Voltage control (contrast setting)
// P1 = Contrast (0..63)
// P2 = 3 resistance ratio (only value that works)
delayms(100); // Allow power supply to stabilise
@@ -543,7 +543,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
case GDISP_CONTROL_CONTRAST:
if ((unsigned)g->p.ptr > 100) g->p.ptr = (void *)100;
acquire_bus(g);
- write_cmd2(g, VOLCTR, 63*(unsigned)g->p.ptr/100, 0x03);
+ write_cmd2(g, VOLCTR, 64*(unsigned)g->p.ptr/101, 0x03);
release_bus(g);
g->g.Contrast = (unsigned)g->p.ptr;
return;