don't needlessly duplicate code
This commit is contained in:
@@ -524,12 +524,11 @@ CFontz_set_brightness(Driver *drvthis, int state, int promille)
|
|||||||
/* store the software value since there is not get */
|
/* store the software value since there is not get */
|
||||||
if (state == BACKLIGHT_ON) {
|
if (state == BACKLIGHT_ON) {
|
||||||
p->brightness = promille;
|
p->brightness = promille;
|
||||||
//CFontz_backlight(drvthis, BACKLIGHT_ON);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p->offbrightness = promille;
|
p->offbrightness = promille;
|
||||||
//CFontz_backlight(drvthis, BACKLIGHT_OFF);
|
|
||||||
}
|
}
|
||||||
|
//CFontz_backlight(drvthis, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -579,12 +579,11 @@ CFontz633_set_brightness(Driver *drvthis, int state, int promille)
|
|||||||
/* store the software value since there is not get */
|
/* store the software value since there is not get */
|
||||||
if (state == BACKLIGHT_ON) {
|
if (state == BACKLIGHT_ON) {
|
||||||
p->brightness = promille;
|
p->brightness = promille;
|
||||||
//CFontz633_backlight(drvthis, BACKLIGHT_ON);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p->offbrightness = promille;
|
p->offbrightness = promille;
|
||||||
//CFontz633_backlight(drvthis, BACKLIGHT_OFF);
|
|
||||||
}
|
}
|
||||||
|
//CFontz633_backlight(drvthis, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -742,12 +742,11 @@ CFontzPacket_set_brightness(Driver *drvthis, int state, int promille)
|
|||||||
/* store the software value since there is not get */
|
/* store the software value since there is not get */
|
||||||
if (state == BACKLIGHT_ON) {
|
if (state == BACKLIGHT_ON) {
|
||||||
p->brightness = promille;
|
p->brightness = promille;
|
||||||
//CFontzPacket_backlight(drvthis, BACKLIGHT_ON);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p->offbrightness = promille;
|
p->offbrightness = promille;
|
||||||
//CFontzPacket_backlight(drvthis, BACKLIGHT_OFF);
|
|
||||||
}
|
}
|
||||||
|
//CFontzPacket_backlight(drvthis, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+20
-25
@@ -470,7 +470,7 @@ MD8800_set_brightness(Driver *drvthis, int state, int promille)
|
|||||||
else {
|
else {
|
||||||
p->off_brightness = promille;
|
p->off_brightness = promille;
|
||||||
}
|
}
|
||||||
// MD8800_backlight(drvthis,state); //
|
//MD8800_backlight(drvthis,state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -488,12 +488,11 @@ MD8800_backlight (Driver *drvthis, int on)
|
|||||||
|
|
||||||
/* map range [0, 1000] -> [0, 6] that the hardware understands */
|
/* map range [0, 1000] -> [0, 6] that the hardware understands */
|
||||||
hardware_value /= 167;
|
hardware_value /= 167;
|
||||||
if(hardware_value != p->hw_brightness){
|
if (hardware_value != p->hw_brightness) {
|
||||||
p->hw_brightness=hardware_value;
|
p->hw_brightness = hardware_value;
|
||||||
write(p->fd, "\x1B\x40", 2);
|
write(p->fd, "\x1B\x40", 2);
|
||||||
write(p->fd, &p->hw_brightness, 1);
|
write(p->fd, &p->hw_brightness, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
@@ -528,28 +527,24 @@ MODULE_EXPORT void
|
|||||||
MD8800_flush (Driver *drvthis)
|
MD8800_flush (Driver *drvthis)
|
||||||
{
|
{
|
||||||
PrivateData *p = drvthis->private_data;
|
PrivateData *p = drvthis->private_data;
|
||||||
// char out[2];
|
|
||||||
|
|
||||||
|
|
||||||
if (memcmp(p->backingstore, p->framebuf, p->width*p->height) == 0)
|
if (memcmp(p->backingstore, p->framebuf, p->width*p->height) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Backing-store implementation. If it's already
|
||||||
|
* on the screen, don't put it there again
|
||||||
|
*/
|
||||||
|
|
||||||
/* Backing-store implementation. If it's already
|
/* else, write out the entire row */
|
||||||
* on the screen, don't put it there again
|
memcpy(p->backingstore, p->framebuf, p->width*p->height);
|
||||||
*/
|
|
||||||
|
|
||||||
|
write(p->fd, "\x1B\x51", 2);// medion \33\121 oct
|
||||||
|
// usleep(300);
|
||||||
|
// write(p->fd, "\x51", 1);// medion \33\121 oct
|
||||||
|
// usleep(300);
|
||||||
|
|
||||||
/* else, write out the entire row */
|
// write(p->fd, "\x0D", 1); // nec
|
||||||
memcpy(p->backingstore, p->framebuf, p->width*p->height);
|
write(p->fd, p->framebuf, p->width*p->height);
|
||||||
|
|
||||||
write(p->fd, "\x1B\x51", 2);// medion \33\121 oct
|
|
||||||
// usleep(300);
|
|
||||||
// write(p->fd, "\x51", 1);// medion \33\121 oct
|
|
||||||
// usleep(300);
|
|
||||||
|
|
||||||
// write(p->fd, "\x0D", 1); // nec
|
|
||||||
write(p->fd, p->framebuf, p->width*p->height);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -608,7 +603,7 @@ MD8800_output (Driver *drvthis, int on)
|
|||||||
{
|
{
|
||||||
PrivateData *p = drvthis->private_data;
|
PrivateData *p = drvthis->private_data;
|
||||||
|
|
||||||
if(on == 144){
|
if (on == 144) {
|
||||||
switch (p->wifi_scan){
|
switch (p->wifi_scan){
|
||||||
case 1:
|
case 1:
|
||||||
write(p->fd, "\x1B\x30\x15\x01", 4);
|
write(p->fd, "\x1B\x30\x15\x01", 4);
|
||||||
@@ -630,14 +625,14 @@ MD8800_output (Driver *drvthis, int on)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
p->wifi_scan++;
|
p->wifi_scan++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(on == p->last_command)
|
if (on == p->last_command)
|
||||||
return;
|
return;
|
||||||
p->last_command=on;
|
p->last_command = on;
|
||||||
|
|
||||||
report(RPT_ERR, "commmand send is: %i", on);
|
report(RPT_ERR, "commmand send is: %i", on);
|
||||||
switch ( on ) {
|
switch (on) {
|
||||||
// +0 -> off
|
// +0 -> off
|
||||||
case 1: // 'hdd'
|
case 1: // 'hdd'
|
||||||
write(p->fd, "\x1B\x30\x00\x00", 4);
|
write(p->fd, "\x1B\x30\x00\x00", 4);
|
||||||
|
|||||||
@@ -727,12 +727,11 @@ MtxOrb_set_brightness(Driver *drvthis, int state, int promille)
|
|||||||
/* store the software value since there is no get */
|
/* store the software value since there is no get */
|
||||||
if (state == BACKLIGHT_ON) {
|
if (state == BACKLIGHT_ON) {
|
||||||
p->brightness = promille;
|
p->brightness = promille;
|
||||||
MtxOrb_backlight(drvthis, BACKLIGHT_ON);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p->offbrightness = promille;
|
p->offbrightness = promille;
|
||||||
MtxOrb_backlight(drvthis, BACKLIGHT_OFF);
|
|
||||||
}
|
}
|
||||||
|
MtxOrb_backlight(drvthis, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -810,7 +809,7 @@ MtxOrb_output (Driver *drvthis, int state)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear the LCD using ints hardware command
|
* Clear the LCD using its hardware command
|
||||||
* \param drvthis Pointer to driver structure.
|
* \param drvthis Pointer to driver structure.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -747,12 +747,11 @@ NoritakeVFD_set_brightness(Driver *drvthis, int state, int promille)
|
|||||||
/* store the software value since there is not get */
|
/* store the software value since there is not get */
|
||||||
if (state == BACKLIGHT_ON) {
|
if (state == BACKLIGHT_ON) {
|
||||||
p->brightness = promille;
|
p->brightness = promille;
|
||||||
//Noritake_backlight(drvthis, BACKLIGHT_ON);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p->offbrightness = promille;
|
p->offbrightness = promille;
|
||||||
//Noritake_backlight(drvthis, BACKLIGHT_OFF);
|
|
||||||
}
|
}
|
||||||
|
//Noritake_backlight(drvthis, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user