Re-indent CFontzPacket_flush to match file's indent style. Strip trailing spaces.
This commit is contained in:
@@ -473,12 +473,13 @@ CFontzPacket_flush (Driver *drvthis)
|
|||||||
{
|
{
|
||||||
PrivateData *p = drvthis->private_data;
|
PrivateData *p = drvthis->private_data;
|
||||||
int modified = 0;
|
int modified = 0;
|
||||||
int i,j;
|
int i, j;
|
||||||
|
|
||||||
if (p->model == 633) {
|
if (p->model == 633) {
|
||||||
/*
|
/*
|
||||||
* For CF633 we don't use delta update yet.
|
* For CF633 we don't use delta update yet. Older HW/FW types
|
||||||
* Older HW/FW types only support updates of full or partial line starting from pos 0.
|
* only support updates of full or partial line starting from
|
||||||
|
* pos 0.
|
||||||
*/
|
*/
|
||||||
unsigned char *xp = p->framebuf;
|
unsigned char *xp = p->framebuf;
|
||||||
unsigned char *xq = p->backingstore;
|
unsigned char *xq = p->backingstore;
|
||||||
@@ -504,22 +505,25 @@ CFontzPacket_flush (Driver *drvthis)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { /* (p->model != 633) */
|
else {
|
||||||
/*
|
/*
|
||||||
* CF631 / CF635 protocol is more flexible and we can do real delta update.
|
* CF631 / CF635 protocol is more flexible and we can do real
|
||||||
|
* delta update.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (i = 0; i < p->height; i++) {
|
for (i = 0; i < p->height; i++) {
|
||||||
/* Strategy:
|
/*-
|
||||||
|
* Strategy:
|
||||||
* - not more than one update command per line
|
* - not more than one update command per line
|
||||||
* - leave out leading and trailing parts that are identical
|
* - leave out leading and trailing parts that
|
||||||
|
* are identical
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// set pointers to start of the line in frame buffer & backing store
|
/* set pointers to start of the line in frame buffer & backing store */
|
||||||
unsigned char *sp = p->framebuf + (i * p->width);
|
unsigned char *sp = p->framebuf + (i * p->width);
|
||||||
unsigned char *sq = p->backingstore + (i * p->width);
|
unsigned char *sq = p->backingstore + (i * p->width);
|
||||||
|
|
||||||
// set pointers to end of the line in frame buffer & backing store
|
/* set pointers to end of the line in frame buffer & backing store */
|
||||||
unsigned char *ep = sp + (p->width - 1);
|
unsigned char *ep = sp + (p->width - 1);
|
||||||
unsigned char *eq = sq + (p->width - 1);
|
unsigned char *eq = sq + (p->width - 1);
|
||||||
int length = 0;
|
int length = 0;
|
||||||
@@ -527,11 +531,11 @@ CFontzPacket_flush (Driver *drvthis)
|
|||||||
debug(RPT_DEBUG, "Framebuf: '%.*s'", p->width, sp);
|
debug(RPT_DEBUG, "Framebuf: '%.*s'", p->width, sp);
|
||||||
debug(RPT_DEBUG, "Backingstore: '%.*s'", p->width, sq);
|
debug(RPT_DEBUG, "Backingstore: '%.*s'", p->width, sq);
|
||||||
|
|
||||||
// skip over leading identical portions of the line
|
/* skip over leading identical portions of the line */
|
||||||
for (j = 0; (sp <= ep) && (*sp == *sq); sp++, sq++, j++)
|
for (j = 0; (sp <= ep) && (*sp == *sq); sp++, sq++, j++)
|
||||||
;
|
;
|
||||||
|
|
||||||
// skip over trailing identical portions of the line
|
/* skip over trailing identical portions of the line */
|
||||||
for (length = p->width - j; (length > 0) && (*ep == *eq); ep--, eq--, length--)
|
for (length = p->width - j; (length > 0) && (*ep == *eq); ep--, eq--, length--)
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -540,8 +544,8 @@ CFontzPacket_flush (Driver *drvthis)
|
|||||||
unsigned char out[length + 3];
|
unsigned char out[length + 3];
|
||||||
|
|
||||||
/* ... send then to the LCD */
|
/* ... send then to the LCD */
|
||||||
out[0] = j; // column
|
out[0] = j; /* column */
|
||||||
out[1] = i; // line
|
out[1] = i; /* line */
|
||||||
|
|
||||||
debug(RPT_DEBUG, "%s: l=%d c=%d count=%d string='%.*s'",
|
debug(RPT_DEBUG, "%s: l=%d c=%d count=%d string='%.*s'",
|
||||||
__FUNCTION__, out[0], out[1], length, length, sp);
|
__FUNCTION__, out[0], out[1], length, length, sp);
|
||||||
@@ -550,7 +554,7 @@ CFontzPacket_flush (Driver *drvthis)
|
|||||||
send_bytes_message(p->fd, CF633_Send_Data_to_LCD, length + 2, out);
|
send_bytes_message(p->fd, CF633_Send_Data_to_LCD, length + 2, out);
|
||||||
modified++;
|
modified++;
|
||||||
}
|
}
|
||||||
} // i < p->height
|
} /* i < p->height */
|
||||||
|
|
||||||
if (modified)
|
if (modified)
|
||||||
memcpy(p->backingstore, p->framebuf, p->width * p->height);
|
memcpy(p->backingstore, p->framebuf, p->width * p->height);
|
||||||
@@ -558,7 +562,7 @@ CFontzPacket_flush (Driver *drvthis)
|
|||||||
|
|
||||||
/* send something to the LCD to allow keys to be received */
|
/* send something to the LCD to allow keys to be received */
|
||||||
if (!modified)
|
if (!modified)
|
||||||
send_bytes_message(p->fd,CF633_Ping_Command, 0, NULL);
|
send_bytes_message(p->fd, CF633_Ping_Command, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user