eLCD::eLCD(eSize size): res(size)
{
+ lcdfd = -1;
locked=0;
_buffer=new unsigned char[res.height()*res.width()];
memset(_buffer, 0, res.height()*res.width());
void eLCD::unlock()
{
- read( lcdfd, NULL, 0);
- if ( errno == 9 )
- {
- eDebug("reopen lcd");
- lcdfd=open("/dev/dbox/lcd0", O_RDWR); // reopen device
- }
- else
- eDebug("do not reopen lcd.. errno = %d", errno);
-
locked=0;
}
eDBoxLCD::~eDBoxLCD()
{
- if (lcdfd>0)
+ if (lcdfd>=0)
{
close(lcdfd);
- lcdfd=0;
+ lcdfd=-1;
}
}
raw[y*132+x]=(pix^inverted);
}
}
- if (lcdfd>0)
+ if (lcdfd >= 0)
write(lcdfd, raw, 132*8);
} else
{
for (x=0; x<128 / 2; x++)
raw[y*64+x] = (_buffer[y*132 + x * 2 + 2] & 0xF0) |(_buffer[y*132 + x * 2 + 1 + 2] >> 4);
}
- if (lcdfd > 0)
+ if (lcdfd >= 0)
write(lcdfd, raw, 64*64);
}
}