Display text on LCD displays (even on multiple ones). Allow to create windows (frames) on display, and to combine them (split, add, duplicate, scroll). See http://mbed.org/users/hlipka/notebook/lcdwindow/ for more information.

Dependents:   Mbell

Revision:
9:2fe93daa2106
Parent:
3:e5d5e2fe4bf6
--- a/hd44780_8bit.cpp	Mon Jan 10 22:57:59 2011 +0000
+++ b/hd44780_8bit.cpp	Tue Feb 22 22:57:44 2011 +0000
@@ -30,7 +30,8 @@
 void HD44780LCD8bit::character(int column, int row, int c)
 {
     int address=(row)*0x40+(column);
-    _guard->take();
+    if (!_guard->take())
+        return;
     sendCmd((unsigned char)address|0x80);
     wait_us(30);
     sendData(c);
@@ -42,7 +43,8 @@
 void HD44780LCD8bit::writeText(const unsigned int column, const unsigned int row, const char text[]) {
 //    printf("print to %d,%d {%s}\n",line,pos,text);
     int address=row*0x40+column;
-    _guard->take();
+    if (!_guard->take())
+        return;
     sendCmd((unsigned char)address|0x80);
     wait_us(30);
 
@@ -56,7 +58,8 @@
 }
 
 void HD44780LCD8bit::clear() {
-    _guard->take();
+    if (!_guard->take())
+        return;
     sendCmd(1);
     _guard->release();
 }