little coding style harmonization; add 3 more API functions
This commit is contained in:
+44
-8
@@ -1,5 +1,3 @@
|
||||
/* #define COUNT -1 */
|
||||
|
||||
/*
|
||||
List of driver entry point:
|
||||
|
||||
@@ -114,6 +112,7 @@ typedef struct p {
|
||||
|
||||
} PrivateData;
|
||||
|
||||
|
||||
/* API: Vars for the server core */
|
||||
MODULE_EXPORT char *api_version = API_VERSION;
|
||||
MODULE_EXPORT int stay_in_foreground = 0; /* For testing only */
|
||||
@@ -598,7 +597,7 @@ CwLnx_init(Driver * drvthis)
|
||||
|
||||
|
||||
/* Set up io port correctly, and open it... */
|
||||
debug(RPT_DEBUG, "%s: Opening serial device: %s", drvthis->name, device);
|
||||
debug(RPT_DEBUG, "%s: Opening device: %s", drvthis->name, device);
|
||||
p->fd = open(device, O_RDWR | O_NOCTTY | O_NDELAY);
|
||||
if (p->fd == -1) {
|
||||
report(RPT_ERR, "%s: open(%s) failed (%s)", drvthis->name, device, strerror(errno));
|
||||
@@ -664,7 +663,7 @@ CwLnx_close(Driver *drvthis)
|
||||
}
|
||||
|
||||
/******************************************************
|
||||
* API: Returns the displays width
|
||||
* API: Returns the display's width
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
CwLnx_width(Driver *drvthis)
|
||||
@@ -676,8 +675,9 @@ CwLnx_width(Driver *drvthis)
|
||||
return p->width;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************
|
||||
* API: Returns the displays height
|
||||
* API: Returns the display's height
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
CwLnx_height(Driver *drvthis)
|
||||
@@ -690,6 +690,34 @@ CwLnx_height(Driver *drvthis)
|
||||
}
|
||||
|
||||
|
||||
/******************************************************
|
||||
* API: Returns the display's cell width
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
CwLnx_cellwidth(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
debug(RPT_DEBUG, "CwLnx: returning cellwidth");
|
||||
|
||||
return p->cellwidth;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************
|
||||
* API: Returns the display's cell height
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
CwLnx_cellheight(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
debug(RPT_DEBUG, "CwLnx: returning cellheight");
|
||||
|
||||
return p->cellheight;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************
|
||||
* This is a test to see how a driver can overwrite build-in heartbeat.
|
||||
* It make a pixel blink at calling rate independently of flush call.
|
||||
@@ -1035,6 +1063,16 @@ CwLnx_num(Driver * drvthis, int x, int num)
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
MODULE_EXPORT int
|
||||
CwLnx_get_free_chars(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
return 16;
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* API: Sets a custom character...
|
||||
* This should be removed from API since it is hardware dependent.
|
||||
@@ -1236,7 +1274,7 @@ CwLnx_icon(Driver * drvthis, int x, int y, int icon)
|
||||
*
|
||||
* Blasts a single frame onscreen, to the lcd...
|
||||
*
|
||||
* Input is a character array, sized CwLnx->wid*CwLnx->hgt
|
||||
* Input is a character array, sized p->wid*p->hgt
|
||||
*/
|
||||
static void
|
||||
CwLnx_draw_frame(Driver *drvthis, char *dat)
|
||||
@@ -1246,7 +1284,6 @@ CwLnx_draw_frame(Driver *drvthis, char *dat)
|
||||
int i, j, mv, rc;
|
||||
char *q, *r;
|
||||
/* char c; */
|
||||
/* static int count=0; */
|
||||
|
||||
if (!dat)
|
||||
return;
|
||||
@@ -1261,7 +1298,6 @@ CwLnx_draw_frame(Driver *drvthis, char *dat)
|
||||
for (j = 0; j < p->width; j++) {
|
||||
if ((*q == *r) && !((0 < *q) && (*q < 16))) {
|
||||
mv = 1;
|
||||
/* count++; if (count==COUNT) exit(0); */
|
||||
}
|
||||
else {
|
||||
/* Draw characters that have changed, as well
|
||||
|
||||
@@ -41,6 +41,8 @@ MODULE_EXPORT int CwLnx_init(Driver * drvthis);
|
||||
MODULE_EXPORT void CwLnx_close(Driver *drvthis);
|
||||
MODULE_EXPORT int CwLnx_width(Driver *drvthis);
|
||||
MODULE_EXPORT int CwLnx_height(Driver *drvthis);
|
||||
MODULE_EXPORT int CwLnx_cellwidth(Driver *drvthis);
|
||||
MODULE_EXPORT int CwLnx_cellheight(Driver *drvthis);
|
||||
MODULE_EXPORT void CwLnx_clear(Driver *drvthis);
|
||||
MODULE_EXPORT void CwLnx_flush(Driver *drvthis);
|
||||
MODULE_EXPORT void CwLnx_string(Driver *drvthis, int x, int y, char string[]);
|
||||
@@ -52,6 +54,7 @@ MODULE_EXPORT void CwLnx_hbar(Driver * drvthis, int x, int y, int len, int promi
|
||||
MODULE_EXPORT void CwLnx_num(Driver *drvthis, int x, int num);
|
||||
MODULE_EXPORT int CwLnx_icon(Driver *drvthis, int x, int y, int icon);
|
||||
|
||||
MODULE_EXPORT int CwLnx_get_free_chars(Driver *drvthis);
|
||||
MODULE_EXPORT void CwLnx_set_char(Driver *drvthis, int n, char *dat);
|
||||
|
||||
MODULE_EXPORT int CwLnx_get_contrast(Driver *drvthis);
|
||||
|
||||
Reference in New Issue
Block a user