more flexible handling of Backlight/brightness

This commit is contained in:
marschap
2007-01-29 20:49:42 +00:00
parent 4e9ae831e9
commit cc5115fe7f
2 changed files with 21 additions and 12 deletions
+12 -4
View File
@@ -266,10 +266,18 @@ void
serial_HD44780_backlight (PrivateData *p, unsigned char state)
{
if (p->have_backlight) {
unsigned char send[1];
send[0] = state ? SERIAL_IF.backlight_on : SERIAL_IF.backlight_off;
write(p->fd, &send, 1);
}
if (SERIAL_IF.backlight_escape) {
unsigned char send[2];
send[0] = SERIAL_IF.backlight_escape;
send[1] = state ? 0 : 0xFF;
write(p->fd, &send, 2);
}
else {
unsigned char send[1];
send[0] = state ? SERIAL_IF.backlight_on : SERIAL_IF.backlight_off;
write(p->fd, &send, 1);
}
}
}
unsigned char