don't allow turning the backlight on if have_backlight == 0

This commit is contained in:
marschap
2008-03-08 18:23:07 +00:00
parent 6c8a0f26a2
commit e122d55965
+5
View File
@@ -849,6 +849,11 @@ HD44780_backlight(Driver *drvthis, int on)
{
PrivateData *p = (PrivateData *) drvthis->private_data;
// not sure if this is the correct solution.
// alternative: return immediately
if (!p->have_backlight)
on = 0;
if (p->hd44780_functions->backlight != NULL)
p->hd44780_functions->backlight(p, on);
}