Fork of LCD-Window which works with Enhanced TextLCD from Wim
Fork of LcdWindow by
Diff: hd44780_8bit.cpp
- Revision:
- 3:e5d5e2fe4bf6
- Parent:
- 2:5ac5bab7daaf
- Child:
- 9:2fe93daa2106
--- a/hd44780_8bit.cpp Sat Nov 27 22:54:13 2010 +0000 +++ b/hd44780_8bit.cpp Sun Nov 28 22:09:54 2010 +0000 @@ -30,9 +30,11 @@ void HD44780LCD8bit::character(int column, int row, int c) { int address=(row)*0x40+(column); + _guard->take(); sendCmd((unsigned char)address|0x80); wait_us(30); sendData(c); + _guard->release(); wait_us(30); } @@ -40,6 +42,7 @@ 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(); sendCmd((unsigned char)address|0x80); wait_us(30); @@ -49,10 +52,13 @@ wait_us(30); i++; } + _guard->release(); } void HD44780LCD8bit::clear() { + _guard->take(); sendCmd(1); + _guard->release(); } void HD44780LCD8bit::sendCmd(const unsigned char cmd) {