cleanup: remove unnecessary (=invisible) leading spaces

This commit is contained in:
marschap
2006-04-27 15:01:49 +00:00
parent 1aff9c4226
commit 9b111eeac4
44 changed files with 236 additions and 236 deletions
+1 -1
View File
@@ -356,7 +356,7 @@ CFontz_chr (Driver *drvthis, int x, int y, unsigned char c)
if ((x < 0) || (y < 0) || (x >= p->width) || (y >= p->height)) if ((x < 0) || (y < 0) || (x >= p->width) || (y >= p->height))
return; return;
if (c < 32) if (c < 32)
c += 128; c += 128;
+1 -1
View File
@@ -1024,7 +1024,7 @@ CFontz633_string (Driver *drvthis, int x, int y, char string[])
if ((y < 0) || (y >= p->height)) if ((y < 0) || (y >= p->height))
return; return;
for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) { for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) {
/* Check for buffer overflows... */ /* Check for buffer overflows... */
if (x >= 0) if (x >= 0)
+13 -13
View File
@@ -21,10 +21,10 @@
in this file was either written by David Glaude for LCDproc or in this file was either written by David Glaude for LCDproc or
identical to the GPL'ed code or so close to it that the differences identical to the GPL'ed code or so close to it that the differences
are negligible. are negligible.
For detailed information about the code analysis, please For detailed information about the code analysis, please
contact the LCDproc maintainer, Peter Marschall <peter@adpm.de> contact the LCDproc maintainer, Peter Marschall <peter@adpm.de>
This file is hereby released under the terms below: This file is hereby released under the terms below:
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -40,7 +40,7 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
*/ */
#include <unistd.h> #include <unistd.h>
@@ -95,13 +95,13 @@ void EmptyKeyRing(KeyRing *kr)
int AddKeyToKeyRing(KeyRing *kr, unsigned char key) int AddKeyToKeyRing(KeyRing *kr, unsigned char key)
{ {
if (((kr->head + 1) % KEYRINGSIZE) != (kr->tail % KEYRINGSIZE)) { if (((kr->head + 1) % KEYRINGSIZE) != (kr->tail % KEYRINGSIZE)) {
/* fprintf(stderr, "We add key: %d\n", key); */ /* fprintf(stderr, "We add key: %d\n", key); */
kr->contents[kr->head % KEYRINGSIZE] = key; kr->contents[kr->head % KEYRINGSIZE] = key;
kr->head = (kr->head + 1) % KEYRINGSIZE; kr->head = (kr->head + 1) % KEYRINGSIZE;
return 1; return 1;
} }
/* KeyRing overflow: do not accept extra key */ /* KeyRing overflow: do not accept extra key */
return 0; return 0;
} }
@@ -271,7 +271,7 @@ void SyncReceiveBuffer(ReceiveBuffer *rb, int fd, unsigned int number)
{ {
unsigned char buffer[MAX_DATA_LENGTH]; unsigned char buffer[MAX_DATA_LENGTH];
int BytesRead; int BytesRead;
#if defined(HAVE_SELECT) && defined(CFONTZ633_WRITE_DELAY) && (CFONTZ633_WRITE_DELAY > 0) #if defined(HAVE_SELECT) && defined(CFONTZ633_WRITE_DELAY) && (CFONTZ633_WRITE_DELAY > 0)
fd_set rfds; fd_set rfds;
struct timeval timeout; struct timeval timeout;
@@ -332,7 +332,7 @@ int BytesAvail(ReceiveBuffer *rb)
unsigned char GetByte(ReceiveBuffer *rb) unsigned char GetByte(ReceiveBuffer *rb)
{ {
unsigned char return_byte = '\0'; unsigned char return_byte = '\0';
/* wrap read pointer to the receive buffer */ /* wrap read pointer to the receive buffer */
rb->tail %= RECEIVEBUFFERSIZE; rb->tail %= RECEIVEBUFFERSIZE;
@@ -353,7 +353,7 @@ unsigned char GetByte(ReceiveBuffer *rb)
int PeekBytesAvail(ReceiveBuffer *rb) int PeekBytesAvail(ReceiveBuffer *rb)
{ {
int avail_bytes = rb->head - rb->peek; int avail_bytes = rb->head - rb->peek;
if (avail_bytes < 0) if (avail_bytes < 0)
avail_bytes += RECEIVEBUFFERSIZE; avail_bytes += RECEIVEBUFFERSIZE;
@@ -410,7 +410,7 @@ test_packet(int fd, unsigned char response, COMMAND_PACKET *in)
/* wait for answer packet but forever (LCDs should answer within max. 250ms) */ /* wait for answer packet but forever (LCDs should answer within max. 250ms) */
for (loop = 250000/CFONTZ633_WRITE_DELAY; !response_received && loop > 0; loop--) { for (loop = 250000/CFONTZ633_WRITE_DELAY; !response_received && loop > 0; loop--) {
int is_msg = check_for_packet(fd, in, MAX_DATA_LENGTH); int is_msg = check_for_packet(fd, in, MAX_DATA_LENGTH);
while (is_msg != GIVE_UP) { while (is_msg != GIVE_UP) {
if (is_msg == GOOD_MSG) { if (is_msg == GOOD_MSG) {
/* key activity ? */ /* key activity ? */
@@ -431,7 +431,7 @@ test_packet(int fd, unsigned char response, COMMAND_PACKET *in)
if (in->command == 0x80) if (in->command == 0x80)
AddKeyToKeyRing(&keyring, in->data[0]); AddKeyToKeyRing(&keyring, in->data[0]);
} }
is_msg = check_for_packet(fd, in, MAX_DATA_LENGTH); is_msg = check_for_packet(fd, in, MAX_DATA_LENGTH);
} }
@@ -487,10 +487,10 @@ check_for_packet(int fd, COMMAND_PACKET *in, unsigned char expected_length)
/* fprintf(stderr, "###: Unknown command.\n"); */ /* fprintf(stderr, "###: Unknown command.\n"); */
return(TRY_AGAIN); return(TRY_AGAIN);
} }
/* There is a valid command byte. Get the data_length. */ /* There is a valid command byte. Get the data_length. */
in->data_length = PeekByte(&receivebuffer); in->data_length = PeekByte(&receivebuffer);
/* The data length must be within reason. */ /* The data length must be within reason. */
if (MAX_DATA_LENGTH < in->data_length) { if (MAX_DATA_LENGTH < in->data_length) {
//Throw out one byte of garbage. Next pass through should re-sync. //Throw out one byte of garbage. Next pass through should re-sync.
@@ -559,7 +559,7 @@ print_packet(COMMAND_PACKET *packet)
//There is enough data to make a packet. Transfer over the data. //There is enough data to make a packet. Transfer over the data.
for (i = 0; i < packet->data_length; i++) for (i = 0; i < packet->data_length; i++)
fprintf(stderr, " %02x", packet->data[i]); fprintf(stderr, " %02x", packet->data[i]);
fprintf(stderr, " ] %02x %02x .\n", packet->crc.as_bytes[0], packet->crc.as_bytes[1]); fprintf(stderr, " ] %02x %02x .\n", packet->crc.as_bytes[0], packet->crc.as_bytes[1]);
} }
+7 -7
View File
@@ -510,7 +510,7 @@ CFontzPacket_flush (Driver *drvthis)
/* Strategy: /* Strategy:
* - one update command per chunk of modified data * - one update command per chunk of modified data
*/ */
for (j = 0; j < p->width; ) { for (j = 0; j < p->width; ) {
// skip over identical portions // skip over identical portions
for ( ; *sp == *sq && j < p->width; sp++, sq++, j++) for ( ; *sp == *sq && j < p->width; sp++, sq++, j++)
@@ -544,7 +544,7 @@ CFontzPacket_flush (Driver *drvthis)
* - 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 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);
@@ -553,7 +553,7 @@ CFontzPacket_flush (Driver *drvthis)
// 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--)
; ;
@@ -561,7 +561,7 @@ CFontzPacket_flush (Driver *drvthis)
/* there are differences, ... */ /* there are differences, ... */
if (length > 0) { if (length > 0) {
unsigned char out[23]; unsigned char out[23];
/* ... 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
@@ -1203,7 +1203,7 @@ CFontzPacket_cursor (Driver *drvthis, int x, int y, int state)
if (p->model != 633) { if (p->model != 633) {
unsigned char cpos[2] = { 0, 0 }; unsigned char cpos[2] = { 0, 0 };
/* set cursor state */ /* set cursor state */
switch (state) { switch (state) {
case CURSOR_OFF: // no cursor case CURSOR_OFF: // no cursor
@@ -1304,7 +1304,7 @@ CFontzPacket_output(Driver *drvthis, int state)
for (lednum = 0; lednum < CF635_NUM_LEDs; lednum++) { for (lednum = 0; lednum < CF635_NUM_LEDs; lednum++) {
unsigned int mask = (1 << lednum); unsigned int mask = (1 << lednum);
int on_off = (state & mask); int on_off = (state & mask);
if ((p->LEDstate & mask) != on_off) { if ((p->LEDstate & mask) != on_off) {
out[0] = CFontz635_LEDs[lednum]; out[0] = CFontz635_LEDs[lednum];
out[1] = (on_off == 0) ? 0 : 100; out[1] = (on_off == 0) ? 0 : 100;
@@ -1322,7 +1322,7 @@ MODULE_EXPORT const char *
CFontzPacket_get_info(Driver *drvthis) CFontzPacket_get_info(Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
snprintf(p->info, sizeof(p->info)-1, "CrystalFontz Driver: CFA-%d", snprintf(p->info, sizeof(p->info)-1, "CrystalFontz Driver: CFA-%d",
p->model); p->model);
return p->info; return p->info;
+8 -8
View File
@@ -2,7 +2,7 @@
/* /*
List of driver entry point: List of driver entry point:
init Work in progress... init Work in progress...
close Implemented. close Implemented.
width If this is a variable, then implemented. width If this is a variable, then implemented.
@@ -532,7 +532,7 @@ int CwLnx_init(Driver * drvthis)
debug(RPT_INFO, "%s: init(%p)", drvthis->name, drvthis); debug(RPT_INFO, "%s: init(%p)", drvthis->name, drvthis);
/* Read config file */ /* Read config file */
/* Which serial device should be used */ /* Which serial device should be used */
strncpy(device, drvthis->config_get_string(drvthis->name, "Device", 0, DEFAULT_DEVICE), sizeof(device)); strncpy(device, drvthis->config_get_string(drvthis->name, "Device", 0, DEFAULT_DEVICE), sizeof(device));
device[sizeof(device) - 1] = '\0'; device[sizeof(device) - 1] = '\0';
@@ -568,7 +568,7 @@ int CwLnx_init(Driver * drvthis)
report(RPT_WARNING, "%s: Speed must be 9600 or 19200. Using default %d", report(RPT_WARNING, "%s: Speed must be 9600 or 19200. Using default %d",
drvthis->name, DEFAULT_SPEED); drvthis->name, DEFAULT_SPEED);
} }
/* do we have a keypad? */ /* do we have a keypad? */
if (drvthis->config_get_bool(drvthis->name , "Keypad", 0, 0)) { if (drvthis->config_get_bool(drvthis->name , "Keypad", 0, 0)) {
report(RPT_INFO, "%s: Config tells us we have a keypad", drvthis->name); report(RPT_INFO, "%s: Config tells us we have a keypad", drvthis->name);
@@ -677,7 +677,7 @@ CwLnx_close(Driver *drvthis)
if (p != NULL) { if (p != NULL) {
if (p->fd >= 0) if (p->fd >= 0)
close(p->fd); close(p->fd);
if (p->framebuf != NULL) if (p->framebuf != NULL)
free(p->framebuf); free(p->framebuf);
@@ -1263,7 +1263,7 @@ CwLnx_icon(Driver * drvthis, int x, int y, int icon)
1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1
}; };
char arrow_left[] = char arrow_left[] =
{ {
0,0,0,1,1,0,0,0, 0,0,0,1,1,0,0,0,
@@ -1283,7 +1283,7 @@ CwLnx_icon(Driver * drvthis, int x, int y, int icon)
0,0,1,1,1,1,0,0, 0,0,1,1,1,1,0,0,
0,0,0,1,1,0,0,0 0,0,0,1,1,0,0,0
}; };
/* Yes we know, this is a VERY BAD implementation */ /* Yes we know, this is a VERY BAD implementation */
switch (icon) { switch (icon) {
@@ -1395,7 +1395,7 @@ CwLnx_clear(Driver *drvthis)
memset(p->framebuf, ' ', p->width * p->height); memset(p->framebuf, ' ', p->width * p->height);
/* We could remember the custom char are not in use anymore. $$$ */ /* We could remember the custom char are not in use anymore. $$$ */
debug(RPT_DEBUG, "CwLnx: cleared framebuffer"); debug(RPT_DEBUG, "CwLnx: cleared framebuffer");
} }
@@ -1425,7 +1425,7 @@ CwLnx_string(Driver * drvthis, int x, int y, char *string)
/* /*
This is another way to check for buffer overflow This is another way to check for buffer overflow
for (int i = 0; string[i]; i++) { for (int i = 0; string[i]; i++) {
if ((y * p->width) + x + i > (p->width * p->height)) if ((y * p->width) + x + i > (p->width * p->height))
break; break;
+8 -8
View File
@@ -6,7 +6,7 @@
* IOWarrior LCD routines * IOWarrior LCD routines
Copyright (c) 2004 Christian Vogelgsang <chris@lallafa.de> Copyright (c) 2004 Christian Vogelgsang <chris@lallafa.de>
* misc. files from LCDproc source tree * misc. files from LCDproc source tree
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -196,7 +196,7 @@ int iowled_on_off(usb_dev_handle *udh,int type, unsigned int pattern)
led_cmd[i] = (unsigned char) (0xFF & pattern); led_cmd[i] = (unsigned char) (0xFF & pattern);
pattern >>= 8; pattern >>= 8;
} }
return iow_led_wcmd(udh, (type == iowProd40) ? 4 : 2, led_cmd); return iow_led_wcmd(udh, (type == iowProd40) ? 4 : 2, led_cmd);
} }
@@ -217,7 +217,7 @@ char size[LCD_MAX_WIDTH+1] = DEFAULT_SIZE;
struct usb_bus *busses; struct usb_bus *busses;
struct usb_bus *bus; struct usb_bus *bus;
int w; int w;
int h; int h;
@@ -265,7 +265,7 @@ PrivateData *p;
/* special option lastline (some displays need it against the underline effect) */ /* special option lastline (some displays need it against the underline effect) */
p->lastline = drvthis->config_get_bool(drvthis->name, "lastline", 0, 1); p->lastline = drvthis->config_get_bool(drvthis->name, "lastline", 0, 1);
/* Contrast of the LCD can be changed by adjusting a trimpot */ /* Contrast of the LCD can be changed by adjusting a trimpot */
/* End of config file parsing */ /* End of config file parsing */
@@ -511,7 +511,7 @@ MODULE_EXPORT void
IOWarrior_flush(Driver *drvthis) IOWarrior_flush(Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
int x, y; int x, y;
int i; int i;
int count; int count;
@@ -577,7 +577,7 @@ PrivateData *p = drvthis->private_data;
memset(p->framebuf, ' ', p->width * p->height); memset(p->framebuf, ' ', p->width * p->height);
p->ccmode = standard; p->ccmode = standard;
debug(RPT_DEBUG, "%s: cleared framebuffer", drvthis->name); debug(RPT_DEBUG, "%s: cleared framebuffer", drvthis->name);
} }
@@ -1017,7 +1017,7 @@ IOWarrior_output(Driver *drvthis, int on)
return; return;
p->output_state = on; p->output_state = on;
iowled_on_off(p->udh, p->productID, (on) ? p->output_mask : 0); iowled_on_off(p->udh, p->productID, (on) ? p->output_mask : 0);
} }
@@ -1029,7 +1029,7 @@ MODULE_EXPORT const char *
IOWarrior_get_info (Driver *drvthis) IOWarrior_get_info (Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
snprintf(p->info, sizeof(p->info)-1, "IOWarrior Driver: %s %s (0x%0x) S/N: %s", snprintf(p->info, sizeof(p->info)-1, "IOWarrior Driver: %s %s (0x%0x) S/N: %s",
p->manufacturer, p->product, p->productID, p->serial); p->manufacturer, p->product, p->productID, p->serial);
return p->info; return p->info;
+1 -1
View File
@@ -65,7 +65,7 @@ typedef enum {
bignum, /* big numbers */ bignum, /* big numbers */
bigchar /* big characters */ bigchar /* big characters */
} CGmode; } CGmode;
typedef struct cgram_cache { typedef struct cgram_cache {
unsigned char cache[LCD_DEFAULT_CELLHEIGHT]; unsigned char cache[LCD_DEFAULT_CELLHEIGHT];
+6 -6
View File
@@ -387,27 +387,27 @@ MtxOrb_init (Driver *drvthis)
/* left_key */ /* left_key */
p->left_key = MtxOrb_parse_keypad_setting(drvthis, "LeftKey", MTXORB_DEFAULT_Left); p->left_key = MtxOrb_parse_keypad_setting(drvthis, "LeftKey", MTXORB_DEFAULT_Left);
report(RPT_DEBUG, "%s: Using \"%c\" as Leftkey.", drvthis->name, p->left_key); report(RPT_DEBUG, "%s: Using \"%c\" as Leftkey.", drvthis->name, p->left_key);
/* right_key */ /* right_key */
p->right_key = MtxOrb_parse_keypad_setting(drvthis, "RightKey", MTXORB_DEFAULT_Right); p->right_key = MtxOrb_parse_keypad_setting(drvthis, "RightKey", MTXORB_DEFAULT_Right);
report(RPT_DEBUG, "%s: Using \"%c\" as RightKey.", drvthis->name, p->right_key); report(RPT_DEBUG, "%s: Using \"%c\" as RightKey.", drvthis->name, p->right_key);
/* up_key */ /* up_key */
p->up_key = MtxOrb_parse_keypad_setting(drvthis, "UpKey", MTXORB_DEFAULT_Up); p->up_key = MtxOrb_parse_keypad_setting(drvthis, "UpKey", MTXORB_DEFAULT_Up);
report(RPT_DEBUG, "%s: Using \"%c\" as UpKey.", drvthis->name, p->up_key); report(RPT_DEBUG, "%s: Using \"%c\" as UpKey.", drvthis->name, p->up_key);
/* down_key */ /* down_key */
p->down_key = MtxOrb_parse_keypad_setting(drvthis, "DownKey", MTXORB_DEFAULT_Down); p->down_key = MtxOrb_parse_keypad_setting(drvthis, "DownKey", MTXORB_DEFAULT_Down);
report(RPT_DEBUG, "%s: Using \"%c\" as DownKey.", drvthis->name, p->down_key); report(RPT_DEBUG, "%s: Using \"%c\" as DownKey.", drvthis->name, p->down_key);
/* right_key */ /* right_key */
p->enter_key = MtxOrb_parse_keypad_setting(drvthis, "EnterKey", MTXORB_DEFAULT_Enter); p->enter_key = MtxOrb_parse_keypad_setting(drvthis, "EnterKey", MTXORB_DEFAULT_Enter);
report(RPT_DEBUG, "%s: Using \"%c\" as EnterKey.", drvthis->name, p->enter_key); report(RPT_DEBUG, "%s: Using \"%c\" as EnterKey.", drvthis->name, p->enter_key);
/* escape_key */ /* escape_key */
p->escape_key = MtxOrb_parse_keypad_setting(drvthis, "EscapeKey", MTXORB_DEFAULT_Escape); p->escape_key = MtxOrb_parse_keypad_setting(drvthis, "EscapeKey", MTXORB_DEFAULT_Escape);
report(RPT_DEBUG, "%s: Using \"%c\" as EscapeKey.", drvthis->name, p->escape_key); report(RPT_DEBUG, "%s: Using \"%c\" as EscapeKey.", drvthis->name, p->escape_key);
} }
/* End of config file parsing*/ /* End of config file parsing*/
+9 -9
View File
@@ -2,7 +2,7 @@
Copyright (C) 2005 Simon Funke Copyright (C) 2005 Simon Funke
This source Code is based on CFontz Driver of this package. This source Code is based on CFontz Driver of this package.
2005-08-01 Version 0.1: mostly everything should work (vbar, hbar never tested) 2005-08-01 Version 0.1: mostly everything should work (vbar, hbar never tested)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -106,7 +106,7 @@ NoritakeVFD_init (Driver *drvthis)
p->ccmode = standard; p->ccmode = standard;
debug(RPT_INFO, "%s(%p)", __FUNCTION__, drvthis); debug(RPT_INFO, "%s(%p)", __FUNCTION__, drvthis);
/* Read config file */ /* Read config file */
/* Which device should be used */ /* Which device should be used */
strncpy(p->device, drvthis->config_get_string(drvthis->name, "Device", 0, DEFAULT_DEVICE), sizeof(p->device)); strncpy(p->device, drvthis->config_get_string(drvthis->name, "Device", 0, DEFAULT_DEVICE), sizeof(p->device));
@@ -135,7 +135,7 @@ NoritakeVFD_init (Driver *drvthis)
} }
p->brightness = tmp; p->brightness = tmp;
/* Which speed */ /* Which speed */
tmp = drvthis->config_get_int(drvthis->name, "Speed", 0, DEFAULT_SPEED); tmp = drvthis->config_get_int(drvthis->name, "Speed", 0, DEFAULT_SPEED);
if ((tmp != 1200) && (tmp != 2400) && (tmp != 9600) && (tmp != 19200) && (tmp != 115200)) { if ((tmp != 1200) && (tmp != 2400) && (tmp != 9600) && (tmp != 19200) && (tmp != 115200)) {
@@ -161,7 +161,7 @@ NoritakeVFD_init (Driver *drvthis)
report(RPT_ERR, "%s: open() of %s failed (%s)", drvthis->name, p->device, strerror(errno)); report(RPT_ERR, "%s: open() of %s failed (%s)", drvthis->name, p->device, strerror(errno));
return -1; return -1;
} }
tcgetattr(p->fd, &portset); tcgetattr(p->fd, &portset);
// We use RAW mode // We use RAW mode
@@ -184,7 +184,7 @@ NoritakeVFD_init (Driver *drvthis)
// Do it... // Do it...
tcsetattr(p->fd, TCSANOW, &portset); tcsetattr(p->fd, TCSANOW, &portset);
/* make sure the frame buffer is there... */ /* make sure the frame buffer is there... */
p->framebuf = (unsigned char *) malloc(p->width * p->height); p->framebuf = (unsigned char *) malloc(p->width * p->height);
if (p->framebuf == NULL) { if (p->framebuf == NULL) {
@@ -210,7 +210,7 @@ NoritakeVFD_init (Driver *drvthis)
NoritakeVFD_hidecursor(drvthis); NoritakeVFD_hidecursor(drvthis);
NoritakeVFD_set_brightness(drvthis, 1, p->brightness); NoritakeVFD_set_brightness(drvthis, 1, p->brightness);
NoritakeVFD_autoscroll(drvthis, 0); NoritakeVFD_autoscroll(drvthis, 0);
report(RPT_DEBUG, "%s: init() done", drvthis->name); report(RPT_DEBUG, "%s: init() done", drvthis->name);
return 0; return 0;
@@ -363,7 +363,7 @@ NoritakeVFD_hidecursor (Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
char out[4]; char out[4];
snprintf(out, sizeof(out), "%c", 0x14); snprintf(out, sizeof(out), "%c", 0x14);
write(p->fd, out, 1); write(p->fd, out, 1);
} }
@@ -716,14 +716,14 @@ NoritakeVFD_heartbeat (Driver *drvthis, int type)
NoritakeVFD_icon(drvthis, 0, 0); NoritakeVFD_icon(drvthis, 0, 0);
NoritakeVFD_icon(drvthis, 1, 1); NoritakeVFD_icon(drvthis, 1, 1);
if (type) if (type)
saved_type = type; saved_type = type;
if (type == HEARTBEAT_ON) { if (type == HEARTBEAT_ON) {
// Set this to pulsate like a real heart beat... // Set this to pulsate like a real heart beat...
whichIcon = (! ((timer + 4) & 5)); whichIcon = (! ((timer + 4) & 5));
// Put character on screen... // Put character on screen...
NoritakeVFD_chr(p->width, 1, whichIcon); NoritakeVFD_chr(p->width, 1, whichIcon);
+1 -1
View File
@@ -2,7 +2,7 @@
Copyright (C) 2005 Simon Funke Copyright (C) 2005 Simon Funke
This source Code is based on CFontz Driver of this package. This source Code is based on CFontz Driver of this package.
2005-08-01 Version 0.1: mostly everything should work (vbar, hbar never tested) 2005-08-01 Version 0.1: mostly everything should work (vbar, hbar never tested)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
+7 -7
View File
@@ -105,7 +105,7 @@ void
lib_adv_bignum(Driver *drvthis, int x, int num, int do_init, int customchars) lib_adv_bignum(Driver *drvthis, int x, int num, int do_init, int customchars)
{ {
int height = drvthis->height(drvthis); int height = drvthis->height(drvthis);
switch (height) { // Display heigth: switch (height) { // Display heigth:
case 2: // 2 lines case 2: // 2 lines
case 3: // are 3 line displays really existing? case 3: // are 3 line displays really existing?
@@ -464,7 +464,7 @@ static void adv_bignum_num_2_5 (Driver *drvthis, int x, int num, int height, int
{'.'}, {'.'},
{" "}, {" "},
{" "}}}; // Defines the character placing inside the bignumber. {" "}}}; // Defines the character placing inside the bignumber.
if (do_init) { // Set customcharacters if needed. if (do_init) { // Set customcharacters if needed.
static unsigned char bignum[5][8] = { // stored customcharacters static unsigned char bignum[5][8] = { // stored customcharacters
[0] { [0] {
@@ -514,7 +514,7 @@ static void adv_bignum_num_2_5 (Driver *drvthis, int x, int num, int height, int
b__XXXXX, } b__XXXXX, }
}; };
int i; int i;
for (i = 0; i < 5 ; i++) { // put the customcharacters into the display for (i = 0; i < 5 ; i++) { // put the customcharacters into the display
drvthis->set_char (drvthis, i, bignum[i]); drvthis->set_char (drvthis, i, bignum[i]);
} }
@@ -993,12 +993,12 @@ static char num_map[][4][4] =
b___XXX_, } b___XXX_, }
}; };
int i; int i;
for (i = 0; i < 3; i++) { // put the customcharacters into the display for (i = 0; i < 3; i++) { // put the customcharacters into the display
drvthis->set_char(drvthis, i+1, bignum[i]); drvthis->set_char(drvthis, i+1, bignum[i]);
} }
} }
adv_bignum_write_num(drvthis, num_map, x, num, height); // write the number adv_bignum_write_num(drvthis, num_map, x, num, height); // write the number
} }
@@ -1142,11 +1142,11 @@ static char num_map[][4][4] = {
b_______, } b_______, }
}; };
int i; int i;
for (i = 0; i < 8 ; i++) { // put the customcharacters into the display for (i = 0; i < 8 ; i++) { // put the customcharacters into the display
drvthis->set_char(drvthis, i, bignum[i]); drvthis->set_char(drvthis, i, bignum[i]);
} }
} }
adv_bignum_write_num(drvthis, num_map, x, num, height); // write the number adv_bignum_write_num(drvthis, num_map, x, num, height); // write the number
} }
+1 -1
View File
@@ -105,7 +105,7 @@ bayrad_init(Driver *drvthis)
/* What speed to use */ /* What speed to use */
p->speed = drvthis->config_get_int(drvthis->name, "Speed", 0, 9600); p->speed = drvthis->config_get_int(drvthis->name, "Speed", 0, 9600);
if (p->speed == 1200) p->speed = B1200; if (p->speed == 1200) p->speed = B1200;
else if (p->speed == 2400) p->speed = B2400; else if (p->speed == 2400) p->speed = B2400;
else if (p->speed == 9600) p->speed = B9600; else if (p->speed == 9600) p->speed = B9600;
+6 -6
View File
@@ -591,11 +591,11 @@ int normal[96][3*4] = {
5,1,7, 5,1,7,
S,3,S, S,3,S,
}, // -> }, // ->
}; };
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// 'Italic' charset // 'Italic' charset
// //
@@ -1176,8 +1176,8 @@ int normal[96][3*4] = {
5,1,7, 5,1,7,
S,3,S, S,3,S,
}, // -> }, // ->
}; };
#endif #endif
+6 -6
View File
@@ -112,16 +112,16 @@ SunOS (5.5.1):
typedef struct driver_private_data { typedef struct driver_private_data {
WINDOW *win; WINDOW *win;
int current_color_pair; int current_color_pair;
int current_border_pair; int current_border_pair;
int curses_backlight_state; int curses_backlight_state;
int width; int width;
int height; int height;
int cellwidth; int cellwidth;
int cellheight; int cellheight;
int xoffs; int xoffs;
int yoffs; int yoffs;
@@ -225,7 +225,7 @@ curses_init (Driver *drvthis)
buf[sizeof(buf)-1] = '\0'; buf[sizeof(buf)-1] = '\0';
fore_color = set_foreground_color(buf); fore_color = set_foreground_color(buf);
debug(RPT_DEBUG, "%s: using foreground color %s", drvthis->name, buf); debug(RPT_DEBUG, "%s: using foreground color %s", drvthis->name, buf);
/* background color */ /* background color */
strncpy(buf, drvthis->config_get_string(drvthis->name, "Background", 0, CONF_DEF_BACKGR), sizeof(buf)); strncpy(buf, drvthis->config_get_string(drvthis->name, "Background", 0, CONF_DEF_BACKGR), sizeof(buf));
buf[sizeof(buf)-1] = '\0'; buf[sizeof(buf)-1] = '\0';
@@ -346,11 +346,11 @@ MODULE_EXPORT void
curses_close (Driver *drvthis) curses_close (Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
// Note that the program leaves a screen on // Note that the program leaves a screen on
// the display to be left behind after closing; // the display to be left behind after closing;
// so don't clear... // so don't clear...
if (p != NULL) { if (p != NULL) {
// Close curses // Close curses
wrefresh(p->win); wrefresh(p->win);
+4 -4
View File
@@ -72,7 +72,7 @@ MODULE_EXPORT int
debug_width (Driver *drvthis) debug_width (Driver *drvthis)
{ {
report(RPT_INFO, "%s()", __FUNCTION__); report(RPT_INFO, "%s()", __FUNCTION__);
return width; return width;
} }
@@ -83,7 +83,7 @@ MODULE_EXPORT int
debug_height (Driver *drvthis) debug_height (Driver *drvthis)
{ {
report(RPT_INFO, "%s()", __FUNCTION__); report(RPT_INFO, "%s()", __FUNCTION__);
return height; return height;
} }
@@ -147,7 +147,7 @@ debug_string (Driver *drvthis, int x, int y, char string[])
if ((y < 0) || (y >= height)) if ((y < 0) || (y >= height))
return; return;
for (i = 0; (string[i] != '\0') && (x < width); i++, x++) { for (i = 0; (string[i] != '\0') && (x < width); i++, x++) {
if (x >= 0) // no write left of left border if (x >= 0) // no write left of left border
framebuf[(y * width) + x] = string[i]; framebuf[(y * width) + x] = string[i];
@@ -164,7 +164,7 @@ debug_chr (Driver *drvthis, int x, int y, char c)
report(RPT_DEBUG, "%s(%i,%i,%c)", __FUNCTION__, x, y, c); report(RPT_DEBUG, "%s(%i,%i,%c)", __FUNCTION__, x, y, c);
x--; y--; x--; y--;
if ((x >= 0) && (y >= 0) && (x < width) && (y < height)) if ((x >= 0) && (y >= 0) && (x < width) && (y < height))
framebuf[(y * width) + x] = c; framebuf[(y * width) + x] = c;
} }
+7 -7
View File
@@ -74,8 +74,8 @@ MODULE_EXPORT int glcdlib_init (Driver *drvthis)
//################################################################## //##################################################################
// Read config file // Read config file
//################################################################## //##################################################################
//################################################################## //##################################################################
// mandatory entries: // mandatory entries:
@@ -85,10 +85,10 @@ MODULE_EXPORT int glcdlib_init (Driver *drvthis)
drvthis->config_get_string(drvthis->name, "Driver", 0, "image"), drvthis->config_get_string(drvthis->name, "Driver", 0, "image"),
sizeof(strCfgDriver)); sizeof(strCfgDriver));
strCfgDriver[sizeof(strCfgDriver)-1] = '\0'; strCfgDriver[sizeof(strCfgDriver)-1] = '\0';
// use or not FreeType2 // use or not FreeType2
bool bCfgUseFT2 = drvthis->config_get_bool(drvthis->name, "UseFT2", 0, true); bool bCfgUseFT2 = drvthis->config_get_bool(drvthis->name, "UseFT2", 0, true);
// which text resolution // which text resolution
const char strTextResDefault[] = "16x4"; const char strTextResDefault[] = "16x4";
char strTextRes[7]; char strTextRes[7];
@@ -107,7 +107,7 @@ MODULE_EXPORT int glcdlib_init (Driver *drvthis)
drvthis->name, strTextRes, strTextResDefault); drvthis->name, strTextRes, strTextResDefault);
sscanf(strTextResDefault, "%dx%d", &nCfgTextWidth, &nCfgTextRows); sscanf(strTextResDefault, "%dx%d", &nCfgTextWidth, &nCfgTextRows);
} }
// which font file // which font file
const char strCfgFontFileDef[] = "/usr/share/fonts/corefonts/courbd.ttf"; const char strCfgFontFileDef[] = "/usr/share/fonts/corefonts/courbd.ttf";
char strCfgFontFile[256]; char strCfgFontFile[256];
@@ -144,7 +144,7 @@ MODULE_EXPORT int glcdlib_init (Driver *drvthis)
drvthis->name, strMinFontFaceSize, strMinFaceSizeDef); drvthis->name, strMinFontFaceSize, strMinFaceSizeDef);
sscanf(strMinFaceSizeDef, "%dx%d", &nCfgMinFontFaceWidth, &nCfgMinFontFaceHeight); sscanf(strMinFaceSizeDef, "%dx%d", &nCfgMinFontFaceWidth, &nCfgMinFontFaceHeight);
} }
// show debugging frame? // show debugging frame?
bool bShowDbgFrame = drvthis->config_get_bool(drvthis->name, "ShowDebugFrame", 0, true); bool bShowDbgFrame = drvthis->config_get_bool(drvthis->name, "ShowDebugFrame", 0, true);
// show big border? // show big border?
@@ -186,7 +186,7 @@ MODULE_EXPORT int glcdlib_init (Driver *drvthis)
bUpsideDown, bUpsideDown,
bBacklight, bBacklight,
nContrast); nContrast);
// apply supplemental settings // apply supplemental settings
int nBrightness = drvthis->config_get_int(drvthis->name, "Brightness", 0, 50); int nBrightness = drvthis->config_get_int(drvthis->name, "Brightness", 0, 50);
glcddriverSetBrightness(pPD->glcdDriver, nBrightness); glcddriverSetBrightness(pPD->glcdDriver, nBrightness);
+4 -4
View File
@@ -109,7 +109,7 @@ glk_init(Driver *drvthis)
/* What speed to use */ /* What speed to use */
p->speed = drvthis->config_get_int(drvthis->name, "Speed", 0, 19200); p->speed = drvthis->config_get_int(drvthis->name, "Speed", 0, 19200);
if (p->speed == 9600) p->speed = B9600; if (p->speed == 9600) p->speed = B9600;
else if (p->speed == 19200) p->speed = B19200; else if (p->speed == 19200) p->speed = B19200;
else if (p->speed == 38400) p->speed = B38400; else if (p->speed == 38400) p->speed = B38400;
@@ -332,7 +332,7 @@ glk_flush(Driver *drvthis)
for (y = 0; y < p->height; ++y) { for (y = 0; y < p->height; ++y) {
int xs = -1; /* XStart not set */ int xs = -1; /* XStart not set */
for (x = 0; x < p->width; ++x) { for (x = 0; x < p->width; ++x) {
if ((*qf == *pf) && (xs >= 0)) { if ((*qf == *pf) && (xs >= 0)) {
/* Write accumulated string */ /* Write accumulated string */
@@ -572,7 +572,7 @@ glk_old_vbar(Driver *drvthis, int x, int len)
if (y >= 0) { if (y >= 0) {
int lastc; int lastc;
switch (len) { switch (len) {
case 0 : return; break; /* Don't output a char */ case 0 : return; break; /* Don't output a char */
case 1 : lastc = 138; break; /* One bar */ case 1 : lastc = 138; break; /* One bar */
@@ -596,7 +596,7 @@ glk_old_hbar(Driver *drvthis, int x, int y, int len)
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
debug(RPT_DEBUG, "glk_old_hbar(%d, %d, %d)", x, y, len); debug(RPT_DEBUG, "glk_old_hbar(%d, %d, %d)", x, y, len);
while (len > p->cellwidth) { while (len > p->cellwidth) {
glk_chr(drvthis, x, y, 255); glk_chr(drvthis, x, y, 255);
++x; ++x;
+9 -9
View File
@@ -104,12 +104,12 @@ int hd_init_lis2 (Driver *drvthis)
return 0; return 0;
} }
void SetMatrice(PrivateData *p, int fd, int matriceNum, int ligne, int point) void SetMatrice(PrivateData *p, int fd, int matriceNum, int ligne, int point)
{ {
// char from 0 to 7 // char from 0 to 7
// line from 0 to 7 from top to bottom // line from 0 to 7 from top to bottom
// pixel 0/1 is 5 bit coding from 0 to 31 from right to left (16/8/4/2/1) // pixel 0/1 is 5 bit coding from 0 to 31 from right to left (16/8/4/2/1)
writeChar(p->fd,0); writeChar(p->fd,0);
writeChar(p->fd,171); writeChar(p->fd,171);
@@ -146,7 +146,7 @@ void gotoXY(int fd, int x, int y)
void writeChar(int fd, int code) void writeChar(int fd, int code)
{ {
char buf = code; char buf = code;
write(fd, &buf, 1); write(fd, &buf, 1);
} }
@@ -183,9 +183,9 @@ void lis2_HD44780_senddata (PrivateData *p, unsigned char displayID, unsigned ch
int x = 0; int x = 0;
int y = 0; int y = 0;
int pos = 0; int pos = 0;
pos = (ch & ~POSITION); pos = (ch & ~POSITION);
if (p->ext_mode) { if (p->ext_mode) {
y = pos/0x20; y = pos/0x20;
x = pos-(y*0x20); x = pos-(y*0x20);
@@ -194,12 +194,12 @@ void lis2_HD44780_senddata (PrivateData *p, unsigned char displayID, unsigned ch
y = pos/0x40; y = pos/0x40;
x = pos-(y*0x40); x = pos-(y*0x40);
} }
writeChar( p->fd, 0); writeChar( p->fd, 0);
writeChar( p->fd, 161 + y); writeChar( p->fd, 161 + y);
writeChar( p->fd, x); writeChar( p->fd, x);
writeChar( p->fd, 167); writeChar( p->fd, 167);
} }
else if ((ch & SETCHAR)!=0) else if ((ch & SETCHAR)!=0)
{ {
@@ -209,7 +209,7 @@ void lis2_HD44780_senddata (PrivateData *p, unsigned char displayID, unsigned ch
} }
else write( p->fd, &ch, 1 ); else write( p->fd, &ch, 1 );
} }
} }
void lis2_HD44780_backlight (PrivateData *p, unsigned char state) void lis2_HD44780_backlight (PrivateData *p, unsigned char state)
+2 -2
View File
@@ -37,7 +37,7 @@ typedef enum {
bignum, /* big numbers */ bignum, /* big numbers */
bigchar /* big characters */ bigchar /* big characters */
} CGmode; } CGmode;
typedef struct cgram_cache { typedef struct cgram_cache {
unsigned char cache[LCD_DEFAULT_CELLHEIGHT]; unsigned char cache[LCD_DEFAULT_CELLHEIGHT];
int clean; int clean;
@@ -96,7 +96,7 @@ typedef struct driver_private_data {
char lastline; // lastline controls the use of the last line, if pixel addressable (true, default) or char lastline; // lastline controls the use of the last line, if pixel addressable (true, default) or
// underline effect (false). To avoid the underline effect, last line is always zeroed // underline effect (false). To avoid the underline effect, last line is always zeroed
// for whatever redefined character // for whatever redefined character
// keyMapDirect contains an array of the ascii-codes that should be generated // keyMapDirect contains an array of the ascii-codes that should be generated
// when a directly connected key is pressed (not in matrix). // when a directly connected key is pressed (not in matrix).
char *keyMapDirect[KEYPAD_MAXX]; char *keyMapDirect[KEYPAD_MAXX];
+2 -2
View File
@@ -368,7 +368,7 @@ HD44780_close(Driver *drvthis)
if (p != NULL) { if (p != NULL) {
if (p->framebuf) if (p->framebuf)
free(p->framebuf); free(p->framebuf);
if (p->lcd_contents) if (p->lcd_contents)
free(p->lcd_contents); free(p->lcd_contents);
@@ -440,7 +440,7 @@ HD44780_position (Driver *drvthis, int x, int y)
relY = 1; relY = 1;
} }
} }
DDaddr = x + (relY % 2) * 0x40; DDaddr = x + (relY % 2) * 0x40;
if ((relY % 4) >= 2) if ((relY % 4) >= 2)
DDaddr += p->width; DDaddr += p->width;
+5 -5
View File
@@ -177,7 +177,7 @@ MODULE_EXPORT int
icp_a106_width (Driver *drvthis) icp_a106_width (Driver *drvthis)
{ {
PrivateData *p = (PrivateData *) drvthis->private_data; PrivateData *p = (PrivateData *) drvthis->private_data;
return p->width; return p->width;
} }
@@ -188,7 +188,7 @@ MODULE_EXPORT int
icp_a106_height (Driver *drvthis) icp_a106_height (Driver *drvthis)
{ {
PrivateData *p = (PrivateData *) drvthis->private_data; PrivateData *p = (PrivateData *) drvthis->private_data;
return p->height; return p->height;
} }
@@ -199,7 +199,7 @@ MODULE_EXPORT void
icp_a106_clear (Driver *drvthis) icp_a106_clear (Driver *drvthis)
{ {
PrivateData *p = (PrivateData *) drvthis->private_data; PrivateData *p = (PrivateData *) drvthis->private_data;
memset(p->framebuf, ' ', p->width * p->height); memset(p->framebuf, ' ', p->width * p->height);
} }
@@ -248,7 +248,7 @@ MODULE_EXPORT void
icp_a106_chr (Driver *drvthis, int x, int y, char ch) icp_a106_chr (Driver *drvthis, int x, int y, char ch)
{ {
PrivateData *p = (PrivateData *) drvthis->private_data; PrivateData *p = (PrivateData *) drvthis->private_data;
y--; y--;
x--; x--;
//debug(RPT_DEBUG, "icp_a106_chr: x=%d, y=%d, chr=%x", x,y,ch); //debug(RPT_DEBUG, "icp_a106_chr: x=%d, y=%d, chr=%x", x,y,ch);
@@ -264,7 +264,7 @@ MODULE_EXPORT void
icp_a106_string (Driver *drvthis, int x, int y, char *s) icp_a106_string (Driver *drvthis, int x, int y, char *s)
{ {
PrivateData *p = (PrivateData *) drvthis->private_data; PrivateData *p = (PrivateData *) drvthis->private_data;
x--; // Convert 1-based coords to 0-based x--; // Convert 1-based coords to 0-based
y--; y--;
+4 -4
View File
@@ -132,7 +132,7 @@ MODULE_EXPORT int imon_init (Driver *drvthis)
memset(p->framebuf, ' ', p->width * p->height); memset(p->framebuf, ' ', p->width * p->height);
report(RPT_DEBUG, "%s: init() done", drvthis->name); report(RPT_DEBUG, "%s: init() done", drvthis->name);
return 1; return 1;
} }
@@ -297,7 +297,7 @@ MODULE_EXPORT int imon_width (Driver *drvthis)
MODULE_EXPORT int imon_height (Driver *drvthis) MODULE_EXPORT int imon_height (Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
return p->height; return p->height;
} }
@@ -307,7 +307,7 @@ MODULE_EXPORT int imon_height (Driver *drvthis)
MODULE_EXPORT int imon_cellwidth (Driver *drvthis) MODULE_EXPORT int imon_cellwidth (Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
return p->cellwidth; return p->cellwidth;
} }
@@ -317,7 +317,7 @@ MODULE_EXPORT int imon_cellwidth (Driver *drvthis)
MODULE_EXPORT int imon_cellheight (Driver *drvthis) MODULE_EXPORT int imon_cellheight (Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
return p->cellheight; return p->cellheight;
} }
+2 -2
View File
@@ -73,7 +73,7 @@ irmanin_init (Driver *drvthis)
return -1; return -1;
if (drvthis->store_private_ptr(drvthis, p)) if (drvthis->store_private_ptr(drvthis, p))
return -1; return -1;
/* Read config file */ /* Read config file */
/* What device should be used */ /* What device should be used */
@@ -141,7 +141,7 @@ irmanin_close (Driver *drvthis)
if (p != NULL) if (p != NULL)
free(p); free(p);
drvthis->store_private_ptr(drvthis, NULL); drvthis->store_private_ptr(drvthis, NULL);
ir_free_commands(); ir_free_commands();
ir_finish(); ir_finish();
} }
+5 -5
View File
@@ -101,7 +101,7 @@ joy_init (Driver *drvthis)
report(RPT_INFO, "%s: using Device %s", drvthis->name, p->device); report(RPT_INFO, "%s: using Device %s", drvthis->name, p->device);
/* End of config file parsing (1st part) */ /* End of config file parsing (1st part) */
if ((p->fd = open(p->device, O_RDONLY)) < 0) { if ((p->fd = open(p->device, O_RDONLY)) < 0) {
report(RPT_ERR, "%s: open(%s) failed (%s)", report(RPT_ERR, "%s: open(%s) failed (%s)",
drvthis->name, p->device, strerror(errno)); drvthis->name, p->device, strerror(errno));
@@ -151,7 +151,7 @@ joy_init (Driver *drvthis)
drvthis->name, i+1, p->axismap[2*i + 1]); drvthis->name, i+1, p->axismap[2*i + 1]);
} }
} }
for (i = 0; i < p->buttons; i++) { for (i = 0; i < p->buttons; i++) {
char mapkey[50]; char mapkey[50];
char *mapval; char *mapval;
@@ -164,9 +164,9 @@ joy_init (Driver *drvthis)
drvthis->name, i+1, p->buttonmap[i]); drvthis->name, i+1, p->buttonmap[i]);
} }
} }
/* End of config file parsing (2nd part) */ /* End of config file parsing (2nd part) */
report(RPT_DEBUG, "%s: init() done", drvthis->name); report(RPT_DEBUG, "%s: init() done", drvthis->name);
return 0; return 0;
@@ -177,7 +177,7 @@ MODULE_EXPORT void
joy_close (Driver *drvthis) joy_close (Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
if (p != NULL) { if (p != NULL) {
if (p->fd >= 0) if (p->fd >= 0)
close(p->fd); close(p->fd);
+8 -8
View File
@@ -113,7 +113,7 @@ LB216_init(Driver * drvthis)
/* What speed to use */ /* What speed to use */
p->speed = drvthis->config_get_int(drvthis->name, "Speed", 0, LB216_DEFAULT_SPEED); p->speed = drvthis->config_get_int(drvthis->name, "Speed", 0, LB216_DEFAULT_SPEED);
if (p->speed == 2400) p->speed = B2400; if (p->speed == 2400) p->speed = B2400;
else if (p->speed == 9600) p->speed = B9600; else if (p->speed == 9600) p->speed = B9600;
else { else {
@@ -129,12 +129,12 @@ LB216_init(Driver * drvthis)
drvthis->name, LB216_DEFAULT_BRIGHTNESS); drvthis->name, LB216_DEFAULT_BRIGHTNESS);
p->backlight_brightness = LB216_DEFAULT_BRIGHTNESS; p->backlight_brightness = LB216_DEFAULT_BRIGHTNESS;
} }
/* Reboot display? */ /* Reboot display? */
reboot = drvthis->config_get_bool(drvthis->name , "Reboot", 0, 0); reboot = drvthis->config_get_bool(drvthis->name , "Reboot", 0, 0);
/* End of config file parsing */ /* End of config file parsing */
// Set up io port correctly, and open it... // Set up io port correctly, and open it...
p->fd = open(p->device, O_RDWR | O_NOCTTY | O_NDELAY); p->fd = open(p->device, O_RDWR | O_NOCTTY | O_NDELAY);
if (p->fd == -1) { if (p->fd == -1) {
@@ -310,7 +310,7 @@ LB216_chr(Driver * drvthis, int x, int y, char c)
if ((unsigned char) c == 254) /* protect command starting char */ if ((unsigned char) c == 254) /* protect command starting char */
c= '#'; c= '#';
if ((x >= 0) && (y >= 0) && (x < p->width) && (y < p->height)) if ((x >= 0) && (y >= 0) && (x < p->width) && (y < p->height))
p->framebuf[(y * p->width) + x] = c; p->framebuf[(y * p->width) + x] = c;
} }
@@ -351,7 +351,7 @@ static void LB216_reboot(Driver * drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
char out[4]; char out[4];
snprintf(out, sizeof(out), "%c%c", 254, 1); snprintf(out, sizeof(out), "%c%c", 254, 1);
write(p->fd, out, 2); write(p->fd, out, 2);
} }
@@ -368,13 +368,13 @@ LB216_string (Driver * drvthis, int x, int y, char string[])
if ((y < 0) || (y >= p->height)) if ((y < 0) || (y >= p->height))
return; return;
for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) { for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) {
unsigned char c = string[i]; unsigned char c = string[i];
if (c == 254) /* protect command starting char */ if (c == 254) /* protect command starting char */
c= '#'; c= '#';
if (x >= 0) if (x >= 0)
p->framebuf[(y * p->width) + x] = c; p->framebuf[(y * p->width) + x] = c;
} }
@@ -547,7 +547,7 @@ LB216_vbar(Driver * drvthis, int x, int len)
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
char map[9] = { 32, 1, 2, 3, 4, 5, 6, 7, 255 }; char map[9] = { 32, 1, 2, 3, 4, 5, 6, 7, 255 };
int y; int y;
for (y = p->height; (y > 0) && (len > 0); y--) { for (y = p->height; (y > 0) && (len > 0); y--) {
if (len >= p->cellheight) if (len >= p->cellheight)
LB216_chr(drvthis, x, y, map[8]); LB216_chr(drvthis, x, y, map[8]);
+4 -4
View File
@@ -75,7 +75,7 @@ typedef struct driver_private_data {
char back_key; char back_key;
char forward_key; char forward_key;
char main_menu_key; char main_menu_key;
char *framebuf; char *framebuf;
int width; int width;
@@ -353,7 +353,7 @@ lcdm001_string (Driver *drvthis, int x, int y, char *string)
if (x >= 0) // no write left of left border if (x >= 0) // no write left of left border
p->framebuf[(y * p->width) + x] = string[i]; p->framebuf[(y * p->width) + x] = string[i];
} }
debug(RPT_DEBUG, "LCDM001: printed string at (%d,%d)", x, y); debug(RPT_DEBUG, "LCDM001: printed string at (%d,%d)", x, y);
} }
@@ -391,7 +391,7 @@ lcdm001_old_vbar(Driver *drvthis, int x, int len)
} }
if (!len) if (!len)
return; return;
//TODO: Distinguish between len>=4 and len<4 //TODO: Distinguish between len>=4 and len<4
} }
@@ -465,7 +465,7 @@ lcdm001_get_key (Driver *drvthis)
char in = '\0'; char in = '\0';
const char *key = NULL; const char *key = NULL;
read(p->fd, &in, 1); read(p->fd, &in, 1);
if (in == p->pause_key) { if (in == p->pause_key) {
key = "Enter"; key = "Enter";
} else if (in == p->back_key) { } else if (in == p->back_key) {
+1 -1
View File
@@ -493,7 +493,7 @@ lcterm_init_hbar (Driver *drvthis)
drvthis->name); drvthis->name);
return; return;
} }
p->ccmode = p->last_ccmode = CCMODE_HBAR; p->ccmode = p->last_ccmode = CCMODE_HBAR;
lcterm_set_char(drvthis, 1, hbar_1); lcterm_set_char(drvthis, 1, hbar_1);
+3 -3
View File
@@ -146,7 +146,7 @@ lircin_init (Driver *drvthis)
fcntl (p->lircin_fd, F_SETFD, FD_CLOEXEC); fcntl (p->lircin_fd, F_SETFD, FD_CLOEXEC);
report(RPT_DEBUG, "%s: init() done", drvthis->name); report(RPT_DEBUG, "%s: init() done", drvthis->name);
return 0; return 0;
} }
@@ -166,11 +166,11 @@ lircin_close (Driver *drvthis)
if (p->prog != NULL) if (p->prog != NULL)
free(p->prog); free(p->prog);
p->prog = NULL; p->prog = NULL;
if (p->lircin_irconfig != NULL) if (p->lircin_irconfig != NULL)
lirc_freeconfig (p->lircin_irconfig); lirc_freeconfig (p->lircin_irconfig);
p->lircin_irconfig = NULL; p->lircin_irconfig = NULL;
if (p->lircin_fd >= 0) { if (p->lircin_fd >= 0) {
lirc_deinit (); lirc_deinit ();
close (p->lircin_fd); close (p->lircin_fd);
+5 -5
View File
@@ -161,7 +161,7 @@ ms6931_init (Driver *drvthis)
/* initialize private data */ /* initialize private data */
p->fd = -1; p->fd = -1;
p->framebuf = NULL; p->framebuf = NULL;
debug(RPT_INFO, "ms6931_init: init(%p)", drvthis); debug(RPT_INFO, "ms6931_init: init(%p)", drvthis);
@@ -248,7 +248,7 @@ ms6931_close (Driver *drvthis)
ms6931_flush(drvthis); ms6931_flush(drvthis);
ms6931_backlight (drvthis, BACKLIGHT_OFF); ms6931_backlight (drvthis, BACKLIGHT_OFF);
} }
if (p->fd >= 0) if (p->fd >= 0)
close(p->fd); close(p->fd);
@@ -302,7 +302,7 @@ ms6931_chr (Driver *drvthis, int x, int y, char c)
y--; y--;
x--; x--;
if ((x >= 0) && (y >= 0) && (x < p->width) && (y < p->height)) if ((x >= 0) && (y >= 0) && (x < p->width) && (y < p->height))
p->framebuf[(y * p->width) + x] = charTable[(unsigned char) c]; p->framebuf[(y * p->width) + x] = charTable[(unsigned char) c];
} }
@@ -390,7 +390,7 @@ ms6931_string (Driver *drvthis, int x, int y, char string[])
if ((y < 0) || (y >= p->height)) if ((y < 0) || (y >= p->height))
return; return;
for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) { for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) {
unsigned char c = (unsigned char) string[i]; unsigned char c = (unsigned char) string[i];
@@ -479,7 +479,7 @@ ms6931_get_key (Driver *drvthis)
FD_SET(p->fd, &fdset); FD_SET(p->fd, &fdset);
return NULL; return NULL;
} }
if (!FD_ISSET(p->fd, &fdset)) if (!FD_ISSET(p->fd, &fdset))
return NULL; return NULL;
+4 -4
View File
@@ -165,14 +165,14 @@ MTC_S16209X_init (Driver * drvthis)
backlight_brightness = MTC_DEFAULT_BRIGHTNESS; backlight_brightness = MTC_DEFAULT_BRIGHTNESS;
} }
#endif // CAN_CONTROL_BACKLIGHT #endif // CAN_CONTROL_BACKLIGHT
#ifdef CAN_REBOOT_LCD #ifdef CAN_REBOOT_LCD
/* Reboot display? */ /* Reboot display? */
reboot = drvthis->config_get_bool(drvthis->name , "Reboot", 0, 0); reboot = drvthis->config_get_bool(drvthis->name , "Reboot", 0, 0);
#endif // CAN_REBOOT_LCD #endif // CAN_REBOOT_LCD
/* End of config file parsing */ /* End of config file parsing */
// Set up io port correctly, and open it... // Set up io port correctly, and open it...
p->fd = open(p->device, O_RDWR | O_NOCTTY | O_NDELAY); p->fd = open(p->device, O_RDWR | O_NOCTTY | O_NDELAY);
if (p->fd == -1) { if (p->fd == -1) {
@@ -428,7 +428,7 @@ MTC_S16209X_string (Driver * drvthis, int x, int y, char string[])
if ((y < 0) || (y >= p->height)) if ((y < 0) || (y >= p->height))
return; return;
for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) { for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) {
if (x >= 0) if (x >= 0)
p->framebuf[y][x] = string[i]; p->framebuf[y][x] = string[i];
+3 -3
View File
@@ -234,17 +234,17 @@ Use i386_get_ioperm, i386_set_ioperm from <machine/sysarch.h> and inb and outb f
#if (__FreeBSD_version > 500000) #if (__FreeBSD_version > 500000)
static FILE * port_access_handle = NULL; static FILE * port_access_handle = NULL;
#endif #endif
/* Read a byte from port */ /* Read a byte from port */
static inline int port_in (unsigned short port) { static inline int port_in (unsigned short port) {
return inb(port); return inb(port);
} }
/* Write a byte 'val' to port */ /* Write a byte 'val' to port */
static inline void port_out (unsigned short port, unsigned char val) { static inline void port_out (unsigned short port, unsigned char val) {
outb(port,val); outb(port,val);
} }
/* Get access to a specific port */ /* Get access to a specific port */
static inline int port_access (unsigned short port) { static inline int port_access (unsigned short port) {
#if (__FreeBSD_version > 500000) #if (__FreeBSD_version > 500000)
+36 -36
View File
@@ -5,7 +5,7 @@
Copyright (C) 2005 Silvan Marco Fin <silvan@kernelconcepts.de> Copyright (C) 2005 Silvan Marco Fin <silvan@kernelconcepts.de>
Copyright (C) 2006 coresystems GmbH <info@coresystems.de> Copyright (C) 2006 coresystems GmbH <info@coresystems.de>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
@@ -185,7 +185,7 @@ real_send_tele(PrivateData *p, char *buffer, int len)
* characters below 0x20. * characters below 0x20.
* ie. 0x8 --> <ESC> 0x28 * ie. 0x8 --> <ESC> 0x28
*/ */
while (len--) { while (len--) {
if (buffer[i]<0x20) { if (buffer[i]<0x20) {
buffer2[j++]=0x1b; buffer2[j++]=0x1b;
@@ -196,7 +196,7 @@ real_send_tele(PrivateData *p, char *buffer, int len)
} }
buffer2[j++]=3; // emit <ETX> buffer2[j++]=3; // emit <ETX>
len=j; // new package length len=j; // new package length
/* calculate <BCC> over all bytes */ /* calculate <BCC> over all bytes */
for (i=0; i<len; i++) for (i=0; i<len; i++)
cc ^= buffer2[i]; cc ^= buffer2[i];
@@ -208,7 +208,7 @@ real_send_tele(PrivateData *p, char *buffer, int len)
/* Take a little nap. This works as a pacemaker */ /* Take a little nap. This works as a pacemaker */
usleep(50); usleep(50);
/*debug(RPT_DEBUG, "%s: sent %s", __FUNCTION__, buffer);*/ /*debug(RPT_DEBUG, "%s: sent %s", __FUNCTION__, buffer);*/
return 0; return 0;
@@ -302,7 +302,7 @@ pyramid_init (Driver *drvthis, char *args)
PrivateData *p; PrivateData *p;
/* get memory for private data */ /* get memory for private data */
p = (PrivateData *) malloc(sizeof(PrivateData)); p = (PrivateData *) malloc(sizeof(PrivateData));
if ((p == NULL) || (drvthis->store_private_ptr(drvthis, p) < 0)) if ((p == NULL) || (drvthis->store_private_ptr(drvthis, p) < 0))
{ {
@@ -317,14 +317,14 @@ pyramid_init (Driver *drvthis, char *args)
p->cellwidth=CELLWIDTH; p->cellwidth=CELLWIDTH;
p->cellheight=CELLHEIGHT; p->cellheight=CELLHEIGHT;
p->custom = normal; p->custom = normal;
strcpy(p->last_key_pressed, NOKEY); strcpy(p->last_key_pressed, NOKEY);
p->last_key_time = timestamp(p); p->last_key_time = timestamp(p);
p->last_buf_time = timestamp(p); p->last_buf_time = timestamp(p);
p->timeout.tv_sec = 0; p->timeout.tv_sec = 0;
p->timeout.tv_usec = MICROTIMEOUT; p->timeout.tv_usec = MICROTIMEOUT;
strcpy(p->framebuffer, "D "); strcpy(p->framebuffer, "D ");
p->FB_modified = 1; p->FB_modified = 1;
@@ -338,7 +338,7 @@ pyramid_init (Driver *drvthis, char *args)
report(RPT_INFO, "%s: using Device %s", drvthis->name, p->device); report(RPT_INFO, "%s: using Device %s", drvthis->name, p->device);
/* Initialize connection to the LCD */ /* Initialize connection to the LCD */
/* open and initialize serial device */ /* open and initialize serial device */
p->FD = open(p->device, O_RDWR); p->FD = open(p->device, O_RDWR);
@@ -346,16 +346,16 @@ pyramid_init (Driver *drvthis, char *args)
report(RPT_ERR, "%s: open(%s) failed: %s", drvthis->name, p->device, strerror(errno)); report(RPT_ERR, "%s: open(%s) failed: %s", drvthis->name, p->device, strerror(errno));
return -1; return -1;
} }
if (initTTY(drvthis, p->FD) != 0) if (initTTY(drvthis, p->FD) != 0)
return -1; return -1;
/* Acknowledge all telegramms, the device may yet be sending. /* Acknowledge all telegramms, the device may yet be sending.
* (Reset doesn't clear telegramms, darn protocol ... ) * (Reset doesn't clear telegramms, darn protocol ... )
*/ */
tcflush(p->FD, TCIFLUSH); /* clear everything */ tcflush(p->FD, TCIFLUSH); /* clear everything */
while (1) { while (1) {
i = read_tele(p, buffer); i = read_tele(p, buffer);
if (i == True) if (i == True)
@@ -460,7 +460,7 @@ pyramid_flush (Driver *drvthis)
case 0xb0: mesg[i]=0xdf; break; // ° case 0xb0: mesg[i]=0xdf; break; // °
} }
} }
send_tele(p, "C0101"); send_tele(p, "C0101");
real_send_tele(p, mesg, 33); /* We do not wait for the ACK here*/ real_send_tele(p, mesg, 33); /* We do not wait for the ACK here*/
p->FB_modified=False; p->FB_modified=False;
@@ -505,15 +505,15 @@ MODULE_EXPORT void pyramid_set_char (Driver *drvthis, int n, char *dat)
{ {
char tele[10] = "G@ABCDEFGH"; char tele[10] = "G@ABCDEFGH";
int row, column, pixels; int row, column, pixels;
PrivateData *p = (PrivateData *) drvthis->private_data; PrivateData *p = (PrivateData *) drvthis->private_data;
if (n<0 && n>15) { if (n<0 && n>15) {
debug(RPT_DEBUG, "only characters 0-15 can be changed.\n"); debug(RPT_DEBUG, "only characters 0-15 can be changed.\n");
return; return;
} }
if (!dat) { if (!dat) {
debug(RPT_DEBUG, "no character data\n"); debug(RPT_DEBUG, "no character data\n");
return; return;
@@ -521,7 +521,7 @@ MODULE_EXPORT void pyramid_set_char (Driver *drvthis, int n, char *dat)
// which character? // which character?
tele[1]=n+0x40; tele[1]=n+0x40;
for (row = 0; row < p->cellheight; row++) { for (row = 0; row < p->cellheight; row++) {
pixels=0; pixels=0;
for (column = 0; column < p->cellwidth; column++) { for (column = 0; column < p->cellwidth; column++) {
@@ -530,7 +530,7 @@ MODULE_EXPORT void pyramid_set_char (Driver *drvthis, int n, char *dat)
} }
pixels |= 0x40; // pixel information is transferred with pixels |= 0x40; // pixel information is transferred with
// an offset of 40h // an offset of 40h
tele[row+2]=pixels; tele[row+2]=pixels;
} }
real_send_tele(p, tele, 10); real_send_tele(p, tele, 10);
@@ -737,7 +737,7 @@ pyramid_init_custom1 (Driver *drvthis)
1, 1, 0, 0, 0, 1, 1, 0, 0, 0,
1, 0, 0, 0, 0, 1, 0, 0, 0, 0,
}; };
char c[] = { char c[] = {
0, 1, 1, 1, 1, 0, 1, 1, 1, 1,
0, 1, 1, 1, 1, 0, 1, 1, 1, 1,
@@ -759,7 +759,7 @@ pyramid_init_custom1 (Driver *drvthis)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}; };
if (p->custom != custom1) { if (p->custom != custom1) {
pyramid_set_char (drvthis, 1, a); pyramid_set_char (drvthis, 1, a);
pyramid_set_char (drvthis, 2, b); pyramid_set_char (drvthis, 2, b);
@@ -821,7 +821,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
1, 1, 0, 1, 1, 1, 1, 0, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
}, },
{ {
0, 0, 1, 0, 0, // Arrow up 0, 0, 1, 0, 0, // Arrow up
0, 1, 1, 1, 0, 0, 1, 1, 1, 0,
@@ -832,7 +832,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
0, 0, 1, 0, 0, 0, 0, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}, },
{ {
0, 0, 1, 0, 0, // Arrow Down 0, 0, 1, 0, 0, // Arrow Down
0, 0, 1, 0, 0, 0, 0, 1, 0, 0,
@@ -843,7 +843,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
0, 0, 1, 0, 0, 0, 0, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}, },
{ {
0, 0, 0, 0, 0, // Checkbox off 0, 0, 0, 0, 0, // Checkbox off
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -854,7 +854,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}, },
{ {
0, 0, 1, 0, 0, // Checkbox on 0, 0, 1, 0, 0, // Checkbox on
0, 0, 1, 0, 0, 0, 0, 1, 0, 0,
@@ -865,7 +865,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}, },
{ {
0, 0, 0, 0, 0, // Checkbox gray 0, 0, 0, 0, 0, // Checkbox gray
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -876,7 +876,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}, },
{ {
0, 0, 0, 0, 0, // Ellipsis 0, 0, 0, 0, 0, // Ellipsis
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -906,7 +906,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
case ICON_BLOCK_FILLED: case ICON_BLOCK_FILLED:
pyramid_chr( drvthis, x, y, 255 ); pyramid_chr( drvthis, x, y, 255 );
break; break;
case ICON_HEART_OPEN: case ICON_HEART_OPEN:
pyramid_set_char( drvthis, 0, icons[0] ); pyramid_set_char( drvthis, 0, icons[0] );
pyramid_chr( drvthis, x, y, 0 ); pyramid_chr( drvthis, x, y, 0 );
@@ -916,13 +916,13 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
pyramid_set_char( drvthis, 0, icons[1] ); pyramid_set_char( drvthis, 0, icons[1] );
pyramid_chr( drvthis, x, y, 0 ); pyramid_chr( drvthis, x, y, 0 );
break; break;
case ICON_ARROW_UP: case ICON_ARROW_UP:
pyramid_set_char( drvthis, 2, icons[2] ); pyramid_set_char( drvthis, 2, icons[2] );
pyramid_chr( drvthis, x, y, 2 ); pyramid_chr( drvthis, x, y, 2 );
p->custom = icon; p->custom = icon;
break; break;
case ICON_ARROW_DOWN: case ICON_ARROW_DOWN:
pyramid_set_char( drvthis, 3, icons[3] ); pyramid_set_char( drvthis, 3, icons[3] );
pyramid_chr( drvthis, x, y, 3 ); pyramid_chr( drvthis, x, y, 3 );
@@ -932,7 +932,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
case ICON_ARROW_LEFT: case ICON_ARROW_LEFT:
pyramid_chr( drvthis, x, y, '\177' ); pyramid_chr( drvthis, x, y, '\177' );
break; break;
case ICON_ARROW_RIGHT: case ICON_ARROW_RIGHT:
pyramid_chr( drvthis, x, y, '\176' ); pyramid_chr( drvthis, x, y, '\176' );
break; break;
@@ -946,12 +946,12 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
pyramid_set_char( drvthis, 11, icons[5] ); pyramid_set_char( drvthis, 11, icons[5] );
pyramid_chr( drvthis, x, y, 11 ); pyramid_chr( drvthis, x, y, 11 );
break; break;
case ICON_CHECKBOX_GRAY: case ICON_CHECKBOX_GRAY:
pyramid_set_char( drvthis, 12, icons[6] ); pyramid_set_char( drvthis, 12, icons[6] );
pyramid_chr( drvthis, x, y, 12 ); pyramid_chr( drvthis, x, y, 12 );
break; break;
case ICON_ELLIPSIS: case ICON_ELLIPSIS:
pyramid_set_char( drvthis, 13, icons[7] ); pyramid_set_char( drvthis, 13, icons[7] );
pyramid_chr( drvthis, x, y, 13 ); pyramid_chr( drvthis, x, y, 13 );
@@ -1019,7 +1019,7 @@ pyramid_output (Driver *drvthis, int state)
for (i = 0; i < 7; i++) for (i = 0; i < 7; i++)
p->led[i] = state & (1 << i); p->led[i] = state & (1 << i);
set_leds(p); set_leds(p);
if(state & (1 << 8)) { if(state & (1 << 8)) {
@@ -1043,7 +1043,7 @@ pyramid_get_key (Driver *drvthis)
* and as long as we got ACKs, we ignore them. * and as long as we got ACKs, we ignore them.
* (eat up all pending ACKs) * (eat up all pending ACKs)
*/ */
while (1) { while (1) {
retval = read_tele(p, buffer); retval = read_tele(p, buffer);
if ((retval == False) || (buffer[0] != 'Q')) break; if ((retval == False) || (buffer[0] != 'Q')) break;
@@ -1090,7 +1090,7 @@ pyramid_get_key (Driver *drvthis)
return "Enter"; return "Enter";
if (strcmp(p->last_key_pressed, "K1000") == 0) /* last from left */ if (strcmp(p->last_key_pressed, "K1000") == 0) /* last from left */
return "Escape"; return "Escape";
#ifdef PYRAMID_DECODE_COMBINED_KEYPRESSES #ifdef PYRAMID_DECODE_COMBINED_KEYPRESSES
/* Do we really want to type that much */ /* Do we really want to type that much */
if (strcmp(p->last_key_pressed, "K0012") == 0) /* A+B */ if (strcmp(p->last_key_pressed, "K0012") == 0) /* A+B */
@@ -1106,7 +1106,7 @@ pyramid_get_key (Driver *drvthis)
return "Up+Escape"; return "Up+Escape";
if (strcmp(p->last_key_pressed, "K2001") == 0) /* D+A */ if (strcmp(p->last_key_pressed, "K2001") == 0) /* D+A */
return "Escape+Up"; return "Escape+Up";
if (strcmp(p->last_key_pressed, "K0120") == 0) /* B+C */ if (strcmp(p->last_key_pressed, "K0120") == 0) /* B+C */
return "Down+Enter"; return "Down+Enter";
if (strcmp(p->last_key_pressed, "K0210") == 0) /* C+B */ if (strcmp(p->last_key_pressed, "K0210") == 0) /* C+B */
@@ -1115,7 +1115,7 @@ pyramid_get_key (Driver *drvthis)
return "Down+Escape"; return "Down+Escape";
if (strcmp(p->last_key_pressed, "K2010") == 0) /* D+B */ if (strcmp(p->last_key_pressed, "K2010") == 0) /* D+B */
return "Escape+Down"; return "Escape+Down";
if (strcmp(p->last_key_pressed, "K0012") == 0) /* C+D */ if (strcmp(p->last_key_pressed, "K0012") == 0) /* C+D */
return "Enter+Escape"; return "Enter+Escape";
if (strcmp(p->last_key_pressed, "K0021") == 0) /* D+C */ if (strcmp(p->last_key_pressed, "K0021") == 0) /* D+C */
+3 -3
View File
@@ -66,7 +66,7 @@
typedef struct driver_private_data { typedef struct driver_private_data {
unsigned int port; unsigned int port;
unsigned char *framebuf; unsigned char *framebuf;
} PrivateData; } PrivateData;
@@ -168,7 +168,7 @@ sed1520_init (Driver *drvthis)
/* What port to use */ /* What port to use */
p->port = drvthis->config_get_int(drvthis->name, "Port", 0, DEFAULT_PORT); p->port = drvthis->config_get_int(drvthis->name, "Port", 0, DEFAULT_PORT);
/* End of config file parsing */ /* End of config file parsing */
if (timing_init() == -1) { if (timing_init() == -1) {
@@ -285,7 +285,7 @@ sed1520_flush (Driver *drvthis)
for (i = 0; i < HEIGHT; i++) { for (i = 0; i < HEIGHT; i++) {
selectpage(p->port, i); selectpage(p->port, i);
selectcolumn(p->port, 0, CS2) ; selectcolumn(p->port, 0, CS2) ;
for (j = 0; j < PIXELWIDTH/2; j++) for (j = 0; j < PIXELWIDTH/2; j++)
writedata(p->port, p->framebuf[j + (i * PIXELWIDTH)], CS2); writedata(p->port, p->framebuf[j + (i * PIXELWIDTH)], CS2);
+5 -5
View File
@@ -267,7 +267,7 @@ serialVFD_init (Driver *drvthis)
p->refresh_timer = 0; p->refresh_timer = 0;
debug(RPT_INFO, "%s(%p)", __FUNCTION__, drvthis ); debug(RPT_INFO, "%s(%p)", __FUNCTION__, drvthis );
/* Read config file */ /* Read config file */
/* Which device should be used */ /* Which device should be used */
strncpy(p->device, drvthis->config_get_string(drvthis->name, "Device", 0, DEFAULT_DEVICE), sizeof(p->device)); strncpy(p->device, drvthis->config_get_string(drvthis->name, "Device", 0, DEFAULT_DEVICE), sizeof(p->device));
@@ -562,7 +562,7 @@ serialVFD_init (Driver *drvthis)
//(useful for displays with less then 30 usercharacters and predefined bars) //(useful for displays with less then 30 usercharacters and predefined bars)
const unsigned int usr_chr_mapping_2[31]= const unsigned int usr_chr_mapping_2[31]=
{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\ {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\
0x0F, 0x10, 0x13 , 0x14, 0x1C, 0x1D, 0x1E, 0x1F}; 0x0F, 0x10, 0x13 , 0x14, 0x1C, 0x1D, 0x1E, 0x1F};
for (tmp=0;tmp < 31 ;tmp++) for (tmp=0;tmp < 31 ;tmp++)
p->usr_chr_mapping[tmp]=usr_chr_mapping_2[tmp]; p->usr_chr_mapping[tmp]=usr_chr_mapping_2[tmp];
break; break;
@@ -729,11 +729,11 @@ serialVFD_set_char (Driver *drvthis, int n, unsigned char *dat)
for (bit = 0; bit < 8; bit++) { for (bit = 0; bit < 8; bit++) {
int pos = (int) p->usr_chr_dot_assignment[bit+8*byte+1]; int pos = (int) p->usr_chr_dot_assignment[bit+8*byte+1];
if (pos > 0) { if (pos > 0) {
int posbyte = (pos-1) / 5; int posbyte = (pos-1) / 5;
int posbit = 4 - ((pos-1) % 5); int posbit = 4 - ((pos-1) % 5);
letter |= ((dat[posbyte] >> posbit) & 1) << bit;; letter |= ((dat[posbyte] >> posbit) & 1) << bit;;
} }
} }
@@ -1077,7 +1077,7 @@ MODULE_EXPORT void
serialVFD_flush (Driver *drvthis) serialVFD_flush (Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
serialVFD_draw_frame(drvthis, p->framebuf); serialVFD_draw_frame(drvthis, p->framebuf);
} }
+1 -1
View File
@@ -304,7 +304,7 @@ stv5730_init (Driver *drvthis)
/* What port to use */ /* What port to use */
p->port = drvthis->config_get_int(drvthis->name, "Port", 0, LPTPORT); p->port = drvthis->config_get_int(drvthis->name, "Port", 0, LPTPORT);
/* End of config file parsing */ /* End of config file parsing */
if (timing_init() == -1) { if (timing_init() == -1) {
+4 -4
View File
@@ -253,7 +253,7 @@ svga_init (Driver *drvthis)
if (drvthis->config_has_key(drvthis->name, "Size")) { if (drvthis->config_has_key(drvthis->name, "Size")) {
int w; int w;
int h; int h;
strncpy(size, drvthis->config_get_string(drvthis->name, "Size", strncpy(size, drvthis->config_get_string(drvthis->name, "Size",
0, DEFAULT_SIZE), sizeof(size)); 0, DEFAULT_SIZE), sizeof(size));
size[sizeof(size) - 1] = '\0'; size[sizeof(size) - 1] = '\0';
@@ -279,7 +279,7 @@ svga_init (Driver *drvthis)
} }
} }
report(RPT_INFO, "%s: using Size %dx%d", drvthis->name, p->width, p->height); report(RPT_INFO, "%s: using Size %dx%d", drvthis->name, p->width, p->height);
/* Which backlight brightness */ /* Which backlight brightness */
tmp = drvthis->config_get_int(drvthis->name, "Brightness", 0, DEFAULT_BRIGHTNESS); tmp = drvthis->config_get_int(drvthis->name, "Brightness", 0, DEFAULT_BRIGHTNESS);
debug(RPT_INFO, "%s: Brightness (in config) is '%d'", __FUNCTION__, tmp); debug(RPT_INFO, "%s: Brightness (in config) is '%d'", __FUNCTION__, tmp);
@@ -351,7 +351,7 @@ svga_init (Driver *drvthis)
report(RPT_ERR, "%s: unable to allocate font memory", drvthis->name); report(RPT_ERR, "%s: unable to allocate font memory", drvthis->name);
return -1; return -1;
} }
tmp = (p->brightness * 255) / 1000; tmp = (p->brightness * 255) / 1000;
if (tmp <= 0) if (tmp <= 0)
tmp = 1; tmp = 1;
@@ -469,7 +469,7 @@ svga_string (Driver *drvthis, int x, int y, char string[])
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
int i; int i;
debug(RPT_DEBUG, "%s(%p, %d, %d, \"%s\")", __FUNCTION__, drvthis, x, y, string); debug(RPT_DEBUG, "%s(%p, %d, %d, \"%s\")", __FUNCTION__, drvthis, x, y, string);
for (i = 0; string[i] != '\0'; i++) { for (i = 0; string[i] != '\0'; i++) {
+12 -12
View File
@@ -216,7 +216,7 @@ MODULE_EXPORT void
t6963_close (Driver *drvthis) t6963_close (Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
debug(RPT_INFO, "Shutting down!"); debug(RPT_INFO, "Shutting down!");
if (p != NULL) { if (p != NULL) {
@@ -226,7 +226,7 @@ t6963_close (Driver *drvthis)
if (p->display_buffer1 != NULL) if (p->display_buffer1 != NULL)
free(p->display_buffer1); free(p->display_buffer1);
if (p->display_buffer2 != NULL) if (p->display_buffer2 != NULL)
free(p->display_buffer2); free(p->display_buffer2);
@@ -242,7 +242,7 @@ MODULE_EXPORT int
t6963_width (Driver *drvthis) t6963_width (Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
return p->width; return p->width;
} }
@@ -253,7 +253,7 @@ MODULE_EXPORT int
t6963_height (Driver *drvthis) t6963_height (Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
return p->height; return p->height;
} }
@@ -264,7 +264,7 @@ MODULE_EXPORT void
t6963_clear (Driver *drvthis) t6963_clear (Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
debug(RPT_DEBUG, "Clearing Display of size %d x %d", p->width, p->height); debug(RPT_DEBUG, "Clearing Display of size %d x %d", p->width, p->height);
memset(p->display_buffer1, ' ', p->width * p->height); memset(p->display_buffer1, ' ', p->width * p->height);
debug(RPT_DEBUG, "Done"); debug(RPT_DEBUG, "Done");
@@ -292,7 +292,7 @@ t6963_flush (Driver *drvthis)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
int i; int i;
debug(RPT_DEBUG, "Flushing %d x %d", p->width, p->height); debug(RPT_DEBUG, "Flushing %d x %d", p->width, p->height);
for (i = 0; i < (p->width * p->height); i++) { for (i = 0; i < (p->width * p->height); i++) {
@@ -495,7 +495,7 @@ void
t6963_low_data (Driver *drvthis, u8 byte) t6963_low_data (Driver *drvthis, u8 byte)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
t6963_low_dsp_ready(drvthis); t6963_low_dsp_ready(drvthis);
t6963_low_set_control(drvthis, 1, 1, 0, 1); // CD down (data) t6963_low_set_control(drvthis, 1, 1, 0, 1); // CD down (data)
t6963_low_set_control(drvthis, 0, 0, 0, 1); // CE & WR down t6963_low_set_control(drvthis, 0, 0, 0, 1); // CE & WR down
@@ -513,14 +513,14 @@ void
t6963_low_command (Driver *drvthis, u8 byte) t6963_low_command (Driver *drvthis, u8 byte)
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
t6963_low_dsp_ready(drvthis); t6963_low_dsp_ready(drvthis);
t6963_low_set_control(drvthis, 1, 1, 1, 1); // CD up (command) t6963_low_set_control(drvthis, 1, 1, 1, 1); // CD up (command)
t6963_low_set_control(drvthis, 0, 0, 1, 1); // CE & WR down t6963_low_set_control(drvthis, 0, 0, 1, 1); // CE & WR down
port_out(T6963_DATA_PORT(p->port), byte); // present data to LCD on PC's port pins port_out(T6963_DATA_PORT(p->port), byte); // present data to LCD on PC's port pins
port_out(0x80, 0x00); port_out(0x80, 0x00);
t6963_low_set_control(drvthis, 1, 1, 0, 1); // CE & WR up, CD down t6963_low_set_control(drvthis, 1, 1, 0, 1); // CE & WR up, CD down
/* /*
port_out(T6963_DATA_PORT(p->port), byte); // present data to LCD on PC's port pins port_out(T6963_DATA_PORT(p->port), byte); // present data to LCD on PC's port pins
t6963_low_set_control(drvthis, 1, 1, 1, 1); t6963_low_set_control(drvthis, 1, 1, 1, 1);
@@ -532,7 +532,7 @@ void
t6963_low_command_byte(Driver *drvthis, u8 cmd, u8 byte) t6963_low_command_byte(Driver *drvthis, u8 cmd, u8 byte)
{ {
//PrivateData *p = drvthis->private_data; //PrivateData *p = drvthis->private_data;
t6963_low_data(drvthis, byte); t6963_low_data(drvthis, byte);
t6963_low_command(drvthis, cmd); t6963_low_command(drvthis, cmd);
} }
@@ -541,7 +541,7 @@ void
t6963_low_command_2_bytes(Driver *drvthis, u8 cmd, u8 byte1, u8 byte2) t6963_low_command_2_bytes(Driver *drvthis, u8 cmd, u8 byte1, u8 byte2)
{ {
//PrivateData *p = drvthis->private_data; //PrivateData *p = drvthis->private_data;
t6963_low_data(drvthis, byte1); t6963_low_data(drvthis, byte1);
t6963_low_data(drvthis, byte2); t6963_low_data(drvthis, byte2);
t6963_low_command(drvthis, cmd); t6963_low_command(drvthis, cmd);
@@ -551,7 +551,7 @@ void
t6963_low_command_word(Driver *drvthis, u8 cmd, u16 word) t6963_low_command_word(Driver *drvthis, u8 cmd, u16 word)
{ {
//PrivateData *p = drvthis->private_data; //PrivateData *p = drvthis->private_data;
t6963_low_data(drvthis, word%256); t6963_low_data(drvthis, word%256);
t6963_low_data(drvthis, word>>8); t6963_low_data(drvthis, word>>8);
t6963_low_command(drvthis, cmd); t6963_low_command(drvthis, cmd);
+1 -1
View File
@@ -176,7 +176,7 @@ text_flush (Driver *drvthis)
memset(out, '-', p->width); memset(out, '-', p->width);
out[p->width] = '\0'; out[p->width] = '\0';
printf("+%s+\n", out); printf("+%s+\n", out);
fflush(stdin); fflush(stdin);
} }
+4 -4
View File
@@ -1,5 +1,5 @@
/* This is the LCDproc driver for tyan lcd module (tyan Barebone GS series) /* This is the LCDproc driver for tyan lcd module (tyan Barebone GS series)
Author: yhlu@tyan.com Author: yhlu@tyan.com
Copyright (C) 2004 Tyan Corp Copyright (C) 2004 Tyan Corp
@@ -157,7 +157,7 @@ tyan_lcdm_init (Driver * drvthis, char *args)
/* Set up io port correctly, and open it... */ /* Set up io port correctly, and open it... */
debug(RPT_DEBUG, "tyan_lcdm: Opening serial device: %s", p->device); debug(RPT_DEBUG, "tyan_lcdm: Opening serial device: %s", p->device);
p->fd = open(p->device, O_RDWR | O_NOCTTY | O_NDELAY); p->fd = open(p->device, O_RDWR | O_NOCTTY | O_NDELAY);
if (p->fd == -1) { if (p->fd == -1) {
report(RPT_ERR, "%s: open(%s) failed (%s)", report(RPT_ERR, "%s: open(%s) failed (%s)",
@@ -202,7 +202,7 @@ tyan_lcdm_init (Driver * drvthis, char *args)
return -1; return -1;
} }
memset(p->backingstore, ' ', p->width * p->height); memset(p->backingstore, ' ', p->width * p->height);
/* Set display-specific stuff.. */ /* Set display-specific stuff.. */
tyan_lcdm_switch_mode(p->fd); tyan_lcdm_switch_mode(p->fd);
tyan_lcdm_hardware_clear(p->fd); tyan_lcdm_hardware_clear(p->fd);
@@ -859,7 +859,7 @@ void tyan_lcdm_write_str(int fd, unsigned char *str,unsigned char start_addr, in
//if Line 2: start_addr = 0xc0 //if Line 2: start_addr = 0xc0
// 1<= length <=16 // 1<= length <=16
unsigned char cmd_str[20] = { TYAN_LCDM_CMD_BEGIN, 0x70, 0x02 }; unsigned char cmd_str[20] = { TYAN_LCDM_CMD_BEGIN, 0x70, 0x02 };
tyan_lcdm_set_rampos(fd, start_addr); tyan_lcdm_set_rampos(fd, start_addr);
memset(cmd_str, ' ', 20); memset(cmd_str, ' ', 20);
cmd_str[0] = TYAN_LCDM_CMD_BEGIN; cmd_str[0] = TYAN_LCDM_CMD_BEGIN;
+1 -1
View File
@@ -1,5 +1,5 @@
/* This is the LCDproc driver header for tyan lcd module (tyan Barebone GS series) /* This is the LCDproc driver header for tyan lcd module (tyan Barebone GS series)
Author: yhlu@tyan.com Author: yhlu@tyan.com
Copyright (C) 2004 Tyan Corp Copyright (C) 2004 Tyan Corp
+13 -13
View File
@@ -176,13 +176,13 @@ void EmptyKeyRing(KeyRing *kr)
int AddKeyToKeyRing(KeyRing *kr, unsigned char key) int AddKeyToKeyRing(KeyRing *kr, unsigned char key)
{ {
if (((kr->head + 1) % KEYRINGSIZE) != (kr->tail % KEYRINGSIZE)) { if (((kr->head + 1) % KEYRINGSIZE) != (kr->tail % KEYRINGSIZE)) {
/* fprintf(stderr, "We add key: %d\n", key); */ /* fprintf(stderr, "We add key: %d\n", key); */
kr->contents[kr->head % KEYRINGSIZE] = key; kr->contents[kr->head % KEYRINGSIZE] = key;
kr->head = (kr->head + 1) % KEYRINGSIZE; kr->head = (kr->head + 1) % KEYRINGSIZE;
return 1; return 1;
} }
/* KeyRing overflow: do not accept extra key */ /* KeyRing overflow: do not accept extra key */
return 0; return 0;
} }
@@ -237,10 +237,10 @@ typedef struct {
// the keyring // the keyring
KeyRing keyring; KeyRing keyring;
// the keymap // the keymap
char *key_map[MAX_KEY_MAP]; char *key_map[MAX_KEY_MAP];
} PrivateData; } PrivateData;
@@ -251,7 +251,7 @@ ula200_ftdi_usb_read(PrivateData *p)
{ {
unsigned char buffer[1]; unsigned char buffer[1];
int err; int err;
while ((err = ftdi_read_data(&p->ftdic, buffer, 1)) == 0); while ((err = ftdi_read_data(&p->ftdic, buffer, 1)) == 0);
if (err < 0) { if (err < 0) {
@@ -276,7 +276,7 @@ ula200_ftdi_read_response(Driver *drvthis)
bool answer_read = false; bool answer_read = false;
int ret; int ret;
int ch; int ch;
while (!answer_read) while (!answer_read)
{ {
/* wait until STX */ /* wait until STX */
@@ -415,7 +415,7 @@ ula200_ftdi_position(Driver *drvthis, int x, int y)
y -= 2; y -= 2;
x += p->width; x += p->width;
} }
command[0] = 'p'; command[0] = 'p';
command[1] = x; command[1] = x;
command[2] = y; command[2] = y;
@@ -472,7 +472,7 @@ ula200_ftdi_string(Driver *drvthis, unsigned char *string, int len)
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
buffer[i+2] = HD44780_charmap[(unsigned char)string[i]]; buffer[i+2] = HD44780_charmap[(unsigned char)string[i]];
} }
err = ula200_ftdi_write_command(drvthis, buffer, len+2, true); err = ula200_ftdi_write_command(drvthis, buffer, len+2, true);
if (err < 0) { if (err < 0) {
report(RPT_WARNING, "%s: ula200_ftdi_string: " report(RPT_WARNING, "%s: ula200_ftdi_string: "
@@ -585,7 +585,7 @@ ula200_load_curstom_chars(Driver *drvthis)
/* Send the subsequent rows */ /* Send the subsequent rows */
for (row = 0; row < CELLHEIGHT; row++) { for (row = 0; row < CELLHEIGHT; row++) {
int value = 0; int value = 0;
for (col = 0; col < CELLWIDTH; col++) { for (col = 0; col < CELLWIDTH; col++) {
value <<= 1; value <<= 1;
value |= (custom_chars[i][(row * CELLWIDTH) + col] > 0) ? 1 : 0; value |= (custom_chars[i][(row * CELLWIDTH) + col] > 0) ? 1 : 0;
@@ -655,7 +655,7 @@ ula200_init(Driver *drvthis)
/* End of config file parsing */ /* End of config file parsing */
// Allocate framebuffer // Allocate framebuffer
p->framebuf = (unsigned char *) malloc(p->width * p->height); p->framebuf = (unsigned char *) malloc(p->width * p->height);
if (p->framebuf == NULL) { if (p->framebuf == NULL) {
@@ -712,7 +712,7 @@ ula200_init(Driver *drvthis)
} }
report(RPT_DEBUG, "%s: init() done", drvthis->name); report(RPT_DEBUG, "%s: init() done", drvthis->name);
return 0; return 0;
err_ftdi: err_ftdi:
@@ -742,7 +742,7 @@ ula200_close(Driver *drvthis)
if (p->framebuf != NULL) if (p->framebuf != NULL)
free(p->framebuf); free(p->framebuf);
if (p->lcd_contents != NULL) if (p->lcd_contents != NULL)
free(p->lcd_contents); free(p->lcd_contents);
@@ -954,7 +954,7 @@ ula200_get_key (Driver *drvthis)
if (key & (1 << i)) if (key & (1 << i))
return p->key_map[i]; return p->key_map[i];
} }
if (key != '\0') { if (key != '\0') {
report(RPT_INFO, "%s: Untreated key 0x%02X", drvthis->name, key); report(RPT_INFO, "%s: Untreated key 0x%02X", drvthis->name, key);
} }
+1 -1
View File
@@ -1,5 +1,5 @@
/* This is the LCDproc driver header for ULA-200 (http://www.elv.de) /* This is the LCDproc driver header for ULA-200 (http://www.elv.de)
Author: bernhard.walle@gmx.de Author: bernhard.walle@gmx.de
Copyright (C) 2006, Bernhard Walle Copyright (C) 2006, Bernhard Walle
+3 -3
View File
@@ -91,7 +91,7 @@ sli_init (Driver *drvthis)
/* What speed to use */ /* What speed to use */
p->speed = drvthis->config_get_int(drvthis->name, "Speed", 0, 19200); p->speed = drvthis->config_get_int(drvthis->name, "Speed", 0, 19200);
if (p->speed == 1200) p->speed = B1200; if (p->speed == 1200) p->speed = B1200;
else if (p->speed == 2400) p->speed = B2400; else if (p->speed == 2400) p->speed = B2400;
else if (p->speed == 9600) p->speed = B9600; else if (p->speed == 9600) p->speed = B9600;
@@ -114,7 +114,7 @@ sli_init (Driver *drvthis)
return -1; return -1;
} }
report(RPT_DEBUG, "%s: opened device %s", drvthis->name, p->device); report(RPT_DEBUG, "%s: opened device %s", drvthis->name, p->device);
tcgetattr(p->fd, &portset); tcgetattr(p->fd, &portset);
// We use RAW mode // We use RAW mode
@@ -144,7 +144,7 @@ sli_init (Driver *drvthis)
return -1; return -1;
} }
memset(p->framebuf, ' ', p->width * p->height); memset(p->framebuf, ' ', p->width * p->height);
/* Initialize SLI using autobaud detection, and then turn off cursor /* Initialize SLI using autobaud detection, and then turn off cursor
and clear screen */ and clear screen */
usleep(150000); /* 150ms delay to allow SLI to power on */ usleep(150000); /* 150ms delay to allow SLI to power on */
+5 -5
View File
@@ -83,7 +83,7 @@ xosdlib_drv_init (Driver *drvthis)
if (drvthis->config_has_key(drvthis->name, "Size")) { if (drvthis->config_has_key(drvthis->name, "Size")) {
int w; int w;
int h; int h;
strncpy(size, drvthis->config_get_string(drvthis->name, "Size", strncpy(size, drvthis->config_get_string(drvthis->name, "Size",
0, DEFAULT_SIZE), sizeof(size)); 0, DEFAULT_SIZE), sizeof(size));
size[sizeof(size) - 1] = '\0'; size[sizeof(size) - 1] = '\0';
@@ -109,7 +109,7 @@ xosdlib_drv_init (Driver *drvthis)
} }
} }
report(RPT_INFO, "%s: using size %dx%d", drvthis->name, p->width, p->height); report(RPT_INFO, "%s: using size %dx%d", drvthis->name, p->width, p->height);
/* Which backlight brightness */ /* Which backlight brightness */
tmp = drvthis->config_get_int(drvthis->name, "Brightness", 0, DEFAULT_BRIGHTNESS); tmp = drvthis->config_get_int(drvthis->name, "Brightness", 0, DEFAULT_BRIGHTNESS);
debug(RPT_INFO, "%s: Brightness (in config) is '%d'", __FUNCTION__, tmp); debug(RPT_INFO, "%s: Brightness (in config) is '%d'", __FUNCTION__, tmp);
@@ -185,7 +185,7 @@ xosdlib_drv_close (Driver *drvthis)
if (p->osd) if (p->osd)
xosd_destroy(p->osd); xosd_destroy(p->osd);
p->osd = NULL; p->osd = NULL;
if (p->framebuf != NULL) if (p->framebuf != NULL)
free(p->framebuf); free(p->framebuf);
p->framebuf = NULL; p->framebuf = NULL;
@@ -253,7 +253,7 @@ xosdlib_drv_flush (Driver *drvthis)
for (i = 0; i < p->height; i++) { for (i = 0; i < p->height; i++) {
memcpy(buffer, p->framebuf + (i * p->width), p->width); memcpy(buffer, p->framebuf + (i * p->width), p->width);
buffer[p->width] = '\0'; buffer[p->width] = '\0';
debug(RPT_DEBUG, "xosd: flushed string \"%s\" at (%d,%d)", buffer, 0, i); debug(RPT_DEBUG, "xosd: flushed string \"%s\" at (%d,%d)", buffer, 0, i);
xosd_display(p->osd, i, XOSD_string, buffer); xosd_display(p->osd, i, XOSD_string, buffer);
} }
@@ -269,7 +269,7 @@ xosdlib_drv_string (Driver *drvthis, int x, int y, char string[])
{ {
PrivateData *p = drvthis->private_data; PrivateData *p = drvthis->private_data;
int i; int i;
debug(RPT_DEBUG, "%s(%p, %d, %d, \"%s\")", __FUNCTION__, drvthis, x, y, string); debug(RPT_DEBUG, "%s(%p, %d, %d, \"%s\")", __FUNCTION__, drvthis, x, y, string);
x--; x--;