diff --git a/server/drivers/CFontz.c b/server/drivers/CFontz.c index b788895..5585ad8 100644 --- a/server/drivers/CFontz.c +++ b/server/drivers/CFontz.c @@ -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)) return; - + if (c < 32) c += 128; diff --git a/server/drivers/CFontz633.c b/server/drivers/CFontz633.c index dcbb623..26ad593 100644 --- a/server/drivers/CFontz633.c +++ b/server/drivers/CFontz633.c @@ -1024,7 +1024,7 @@ CFontz633_string (Driver *drvthis, int x, int y, char string[]) if ((y < 0) || (y >= p->height)) return; - + for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) { /* Check for buffer overflows... */ if (x >= 0) diff --git a/server/drivers/CFontz633io.c b/server/drivers/CFontz633io.c index d797555..da5071d 100644 --- a/server/drivers/CFontz633io.c +++ b/server/drivers/CFontz633io.c @@ -21,10 +21,10 @@ 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 are negligible. - + For detailed information about the code analysis, please contact the LCDproc maintainer, Peter Marschall - + This file is hereby released under the terms below: 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 along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - + */ #include @@ -95,13 +95,13 @@ void EmptyKeyRing(KeyRing *kr) int AddKeyToKeyRing(KeyRing *kr, unsigned char key) { 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->head = (kr->head + 1) % KEYRINGSIZE; return 1; } - + /* KeyRing overflow: do not accept extra key */ return 0; } @@ -271,7 +271,7 @@ void SyncReceiveBuffer(ReceiveBuffer *rb, int fd, unsigned int number) { unsigned char buffer[MAX_DATA_LENGTH]; int BytesRead; - + #if defined(HAVE_SELECT) && defined(CFONTZ633_WRITE_DELAY) && (CFONTZ633_WRITE_DELAY > 0) fd_set rfds; struct timeval timeout; @@ -332,7 +332,7 @@ int BytesAvail(ReceiveBuffer *rb) unsigned char GetByte(ReceiveBuffer *rb) { unsigned char return_byte = '\0'; - + /* wrap read pointer to the receive buffer */ rb->tail %= RECEIVEBUFFERSIZE; @@ -353,7 +353,7 @@ unsigned char GetByte(ReceiveBuffer *rb) int PeekBytesAvail(ReceiveBuffer *rb) { int avail_bytes = rb->head - rb->peek; - + if (avail_bytes < 0) 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) */ for (loop = 250000/CFONTZ633_WRITE_DELAY; !response_received && loop > 0; loop--) { int is_msg = check_for_packet(fd, in, MAX_DATA_LENGTH); - + while (is_msg != GIVE_UP) { if (is_msg == GOOD_MSG) { /* key activity ? */ @@ -431,7 +431,7 @@ test_packet(int fd, unsigned char response, COMMAND_PACKET *in) if (in->command == 0x80) AddKeyToKeyRing(&keyring, in->data[0]); } - + 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"); */ return(TRY_AGAIN); } - + /* There is a valid command byte. Get the data_length. */ in->data_length = PeekByte(&receivebuffer); - + /* The data length must be within reason. */ if (MAX_DATA_LENGTH < in->data_length) { //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. for (i = 0; i < packet->data_length; i++) fprintf(stderr, " %02x", packet->data[i]); - + fprintf(stderr, " ] %02x %02x .\n", packet->crc.as_bytes[0], packet->crc.as_bytes[1]); } diff --git a/server/drivers/CFontzPacket.c b/server/drivers/CFontzPacket.c index af648cb..4644e60 100644 --- a/server/drivers/CFontzPacket.c +++ b/server/drivers/CFontzPacket.c @@ -510,7 +510,7 @@ CFontzPacket_flush (Driver *drvthis) /* Strategy: * - one update command per chunk of modified data */ - + for (j = 0; j < p->width; ) { // skip over identical portions 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 * - leave out leading and trailing parts that are identical */ - + // set pointers to end of the line in frame buffer & backing store unsigned char *ep = sp + (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 for (j = 0; (sp <= ep) && (*sp == *sq); sp++, sq++, j++) ; - + // skip over trailing identical portions of the line for (length = p->width - j; (length > 0) && (*ep == *eq); ep--, eq--, length--) ; @@ -561,7 +561,7 @@ CFontzPacket_flush (Driver *drvthis) /* there are differences, ... */ if (length > 0) { unsigned char out[23]; - + /* ... send then to the LCD */ out[0] = j; // column out[1] = i; // line @@ -1203,7 +1203,7 @@ CFontzPacket_cursor (Driver *drvthis, int x, int y, int state) if (p->model != 633) { unsigned char cpos[2] = { 0, 0 }; - + /* set cursor state */ switch (state) { case CURSOR_OFF: // no cursor @@ -1304,7 +1304,7 @@ CFontzPacket_output(Driver *drvthis, int state) for (lednum = 0; lednum < CF635_NUM_LEDs; lednum++) { unsigned int mask = (1 << lednum); int on_off = (state & mask); - + if ((p->LEDstate & mask) != on_off) { out[0] = CFontz635_LEDs[lednum]; out[1] = (on_off == 0) ? 0 : 100; @@ -1322,7 +1322,7 @@ MODULE_EXPORT const char * CFontzPacket_get_info(Driver *drvthis) { PrivateData *p = drvthis->private_data; - + snprintf(p->info, sizeof(p->info)-1, "CrystalFontz Driver: CFA-%d", p->model); return p->info; diff --git a/server/drivers/CwLnx.c b/server/drivers/CwLnx.c index 1ae89af..0f8ad37 100644 --- a/server/drivers/CwLnx.c +++ b/server/drivers/CwLnx.c @@ -2,7 +2,7 @@ /* List of driver entry point: - + init Work in progress... close 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); /* Read config file */ - + /* Which serial device should be used */ strncpy(device, drvthis->config_get_string(drvthis->name, "Device", 0, DEFAULT_DEVICE), sizeof(device)); 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", drvthis->name, DEFAULT_SPEED); } - + /* do we have a keypad? */ if (drvthis->config_get_bool(drvthis->name , "Keypad", 0, 0)) { 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->fd >= 0) - close(p->fd); + close(p->fd); if (p->framebuf != NULL) 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 }; - + char arrow_left[] = { 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,0,1,1,0,0,0 }; - + /* Yes we know, this is a VERY BAD implementation */ switch (icon) { @@ -1395,7 +1395,7 @@ CwLnx_clear(Driver *drvthis) memset(p->framebuf, ' ', p->width * p->height); /* We could remember the custom char are not in use anymore. $$$ */ - + 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 - + for (int i = 0; string[i]; i++) { if ((y * p->width) + x + i > (p->width * p->height)) break; diff --git a/server/drivers/IOWarrior.c b/server/drivers/IOWarrior.c index 6d5a42a..e5b2356 100644 --- a/server/drivers/IOWarrior.c +++ b/server/drivers/IOWarrior.c @@ -6,7 +6,7 @@ * IOWarrior LCD routines Copyright (c) 2004 Christian Vogelgsang - + * misc. files from LCDproc source tree 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); pattern >>= 8; } - + 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 *bus; - + int w; int h; @@ -265,7 +265,7 @@ PrivateData *p; /* special option lastline (some displays need it against the underline effect) */ p->lastline = drvthis->config_get_bool(drvthis->name, "lastline", 0, 1); - + /* Contrast of the LCD can be changed by adjusting a trimpot */ /* End of config file parsing */ @@ -511,7 +511,7 @@ MODULE_EXPORT void IOWarrior_flush(Driver *drvthis) { PrivateData *p = drvthis->private_data; - + int x, y; int i; int count; @@ -577,7 +577,7 @@ PrivateData *p = drvthis->private_data; memset(p->framebuf, ' ', p->width * p->height); p->ccmode = standard; - + debug(RPT_DEBUG, "%s: cleared framebuffer", drvthis->name); } @@ -1017,7 +1017,7 @@ IOWarrior_output(Driver *drvthis, int on) return; p->output_state = on; - + 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) { PrivateData *p = drvthis->private_data; - + snprintf(p->info, sizeof(p->info)-1, "IOWarrior Driver: %s %s (0x%0x) S/N: %s", p->manufacturer, p->product, p->productID, p->serial); return p->info; diff --git a/server/drivers/IOWarrior.h b/server/drivers/IOWarrior.h index d8b2f58..accbbe7 100644 --- a/server/drivers/IOWarrior.h +++ b/server/drivers/IOWarrior.h @@ -65,7 +65,7 @@ typedef enum { bignum, /* big numbers */ bigchar /* big characters */ } CGmode; - + typedef struct cgram_cache { unsigned char cache[LCD_DEFAULT_CELLHEIGHT]; diff --git a/server/drivers/MtxOrb.c b/server/drivers/MtxOrb.c index 0081003..f14878b 100644 --- a/server/drivers/MtxOrb.c +++ b/server/drivers/MtxOrb.c @@ -387,27 +387,27 @@ MtxOrb_init (Driver *drvthis) /* left_key */ 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); - + /* right_key */ 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); - + /* up_key */ 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); - + /* down_key */ 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); - + /* right_key */ 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); - + /* escape_key */ 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); - + } /* End of config file parsing*/ diff --git a/server/drivers/NoritakeVFD.c b/server/drivers/NoritakeVFD.c index 686a745..cb8e0f8 100644 --- a/server/drivers/NoritakeVFD.c +++ b/server/drivers/NoritakeVFD.c @@ -2,7 +2,7 @@ Copyright (C) 2005 Simon Funke 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) This program is free software; you can redistribute it and/or modify @@ -106,7 +106,7 @@ NoritakeVFD_init (Driver *drvthis) p->ccmode = standard; debug(RPT_INFO, "%s(%p)", __FUNCTION__, drvthis); - + /* Read config file */ /* Which device should be used */ 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; - + /* Which speed */ tmp = drvthis->config_get_int(drvthis->name, "Speed", 0, DEFAULT_SPEED); 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)); return -1; } - + tcgetattr(p->fd, &portset); // We use RAW mode @@ -184,7 +184,7 @@ NoritakeVFD_init (Driver *drvthis) // Do it... tcsetattr(p->fd, TCSANOW, &portset); - + /* make sure the frame buffer is there... */ p->framebuf = (unsigned char *) malloc(p->width * p->height); if (p->framebuf == NULL) { @@ -210,7 +210,7 @@ NoritakeVFD_init (Driver *drvthis) NoritakeVFD_hidecursor(drvthis); NoritakeVFD_set_brightness(drvthis, 1, p->brightness); NoritakeVFD_autoscroll(drvthis, 0); - + report(RPT_DEBUG, "%s: init() done", drvthis->name); return 0; @@ -363,7 +363,7 @@ NoritakeVFD_hidecursor (Driver *drvthis) { PrivateData *p = drvthis->private_data; char out[4]; - + snprintf(out, sizeof(out), "%c", 0x14); write(p->fd, out, 1); } @@ -716,14 +716,14 @@ NoritakeVFD_heartbeat (Driver *drvthis, int type) NoritakeVFD_icon(drvthis, 0, 0); NoritakeVFD_icon(drvthis, 1, 1); - + if (type) saved_type = type; if (type == HEARTBEAT_ON) { // Set this to pulsate like a real heart beat... whichIcon = (! ((timer + 4) & 5)); - + // Put character on screen... NoritakeVFD_chr(p->width, 1, whichIcon); diff --git a/server/drivers/NoritakeVFD.h b/server/drivers/NoritakeVFD.h index 9d37ca6..53769b9 100644 --- a/server/drivers/NoritakeVFD.h +++ b/server/drivers/NoritakeVFD.h @@ -2,7 +2,7 @@ Copyright (C) 2005 Simon Funke 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) This program is free software; you can redistribute it and/or modify diff --git a/server/drivers/adv_bignum.c b/server/drivers/adv_bignum.c index bf49321..d6a429c 100644 --- a/server/drivers/adv_bignum.c +++ b/server/drivers/adv_bignum.c @@ -105,7 +105,7 @@ void lib_adv_bignum(Driver *drvthis, int x, int num, int do_init, int customchars) { int height = drvthis->height(drvthis); - + switch (height) { // Display heigth: case 2: // 2 lines 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. - + if (do_init) { // Set customcharacters if needed. static unsigned char bignum[5][8] = { // stored customcharacters [0] { @@ -514,7 +514,7 @@ static void adv_bignum_num_2_5 (Driver *drvthis, int x, int num, int height, int b__XXXXX, } }; int i; - + for (i = 0; i < 5 ; i++) { // put the customcharacters into the display drvthis->set_char (drvthis, i, bignum[i]); } @@ -993,12 +993,12 @@ static char num_map[][4][4] = b___XXX_, } }; int i; - + for (i = 0; i < 3; i++) { // put the customcharacters into the display drvthis->set_char(drvthis, i+1, bignum[i]); } } - + adv_bignum_write_num(drvthis, num_map, x, num, height); // write the number } @@ -1142,11 +1142,11 @@ static char num_map[][4][4] = { b_______, } }; int i; - + for (i = 0; i < 8 ; i++) { // put the customcharacters into the display drvthis->set_char(drvthis, i, bignum[i]); } } - + adv_bignum_write_num(drvthis, num_map, x, num, height); // write the number } diff --git a/server/drivers/bayrad.c b/server/drivers/bayrad.c index 08effcc..6d9c49e 100644 --- a/server/drivers/bayrad.c +++ b/server/drivers/bayrad.c @@ -105,7 +105,7 @@ bayrad_init(Driver *drvthis) /* What speed to use */ p->speed = drvthis->config_get_int(drvthis->name, "Speed", 0, 9600); - + if (p->speed == 1200) p->speed = B1200; else if (p->speed == 2400) p->speed = B2400; else if (p->speed == 9600) p->speed = B9600; diff --git a/server/drivers/bigfont.h b/server/drivers/bigfont.h index 44b6b53..eec24c1 100644 --- a/server/drivers/bigfont.h +++ b/server/drivers/bigfont.h @@ -591,11 +591,11 @@ int normal[96][3*4] = { 5,1,7, S,3,S, }, // -> - + }; - - - + + + ///////////////////////////////////////////////////////////////// // 'Italic' charset // @@ -1176,8 +1176,8 @@ int normal[96][3*4] = { 5,1,7, S,3,S, }, // -> - + }; - + #endif diff --git a/server/drivers/curses_drv.c b/server/drivers/curses_drv.c index e7a19c0..08a6b32 100644 --- a/server/drivers/curses_drv.c +++ b/server/drivers/curses_drv.c @@ -112,16 +112,16 @@ SunOS (5.5.1): typedef struct driver_private_data { WINDOW *win; - + int current_color_pair; int current_border_pair; int curses_backlight_state; - + int width; int height; int cellwidth; int cellheight; - + int xoffs; int yoffs; @@ -225,7 +225,7 @@ curses_init (Driver *drvthis) buf[sizeof(buf)-1] = '\0'; fore_color = set_foreground_color(buf); debug(RPT_DEBUG, "%s: using foreground color %s", drvthis->name, buf); - + /* background color */ strncpy(buf, drvthis->config_get_string(drvthis->name, "Background", 0, CONF_DEF_BACKGR), sizeof(buf)); buf[sizeof(buf)-1] = '\0'; @@ -346,11 +346,11 @@ MODULE_EXPORT void curses_close (Driver *drvthis) { PrivateData *p = drvthis->private_data; - + // Note that the program leaves a screen on // the display to be left behind after closing; // so don't clear... - + if (p != NULL) { // Close curses wrefresh(p->win); diff --git a/server/drivers/debug.c b/server/drivers/debug.c index fab9222..7ed9d26 100644 --- a/server/drivers/debug.c +++ b/server/drivers/debug.c @@ -72,7 +72,7 @@ MODULE_EXPORT int debug_width (Driver *drvthis) { report(RPT_INFO, "%s()", __FUNCTION__); - + return width; } @@ -83,7 +83,7 @@ MODULE_EXPORT int debug_height (Driver *drvthis) { report(RPT_INFO, "%s()", __FUNCTION__); - + return height; } @@ -147,7 +147,7 @@ debug_string (Driver *drvthis, int x, int y, char string[]) if ((y < 0) || (y >= height)) return; - + for (i = 0; (string[i] != '\0') && (x < width); i++, x++) { if (x >= 0) // no write left of left border 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); x--; y--; - + if ((x >= 0) && (y >= 0) && (x < width) && (y < height)) framebuf[(y * width) + x] = c; } diff --git a/server/drivers/glcdlib.c b/server/drivers/glcdlib.c index 50d279b..789184a 100644 --- a/server/drivers/glcdlib.c +++ b/server/drivers/glcdlib.c @@ -74,8 +74,8 @@ MODULE_EXPORT int glcdlib_init (Driver *drvthis) //################################################################## // Read config file //################################################################## - - + + //################################################################## // mandatory entries: @@ -85,10 +85,10 @@ MODULE_EXPORT int glcdlib_init (Driver *drvthis) drvthis->config_get_string(drvthis->name, "Driver", 0, "image"), sizeof(strCfgDriver)); strCfgDriver[sizeof(strCfgDriver)-1] = '\0'; - + // use or not FreeType2 bool bCfgUseFT2 = drvthis->config_get_bool(drvthis->name, "UseFT2", 0, true); - + // which text resolution const char strTextResDefault[] = "16x4"; char strTextRes[7]; @@ -107,7 +107,7 @@ MODULE_EXPORT int glcdlib_init (Driver *drvthis) drvthis->name, strTextRes, strTextResDefault); sscanf(strTextResDefault, "%dx%d", &nCfgTextWidth, &nCfgTextRows); } - + // which font file const char strCfgFontFileDef[] = "/usr/share/fonts/corefonts/courbd.ttf"; char strCfgFontFile[256]; @@ -144,7 +144,7 @@ MODULE_EXPORT int glcdlib_init (Driver *drvthis) drvthis->name, strMinFontFaceSize, strMinFaceSizeDef); sscanf(strMinFaceSizeDef, "%dx%d", &nCfgMinFontFaceWidth, &nCfgMinFontFaceHeight); } - + // show debugging frame? bool bShowDbgFrame = drvthis->config_get_bool(drvthis->name, "ShowDebugFrame", 0, true); // show big border? @@ -186,7 +186,7 @@ MODULE_EXPORT int glcdlib_init (Driver *drvthis) bUpsideDown, bBacklight, nContrast); - + // apply supplemental settings int nBrightness = drvthis->config_get_int(drvthis->name, "Brightness", 0, 50); glcddriverSetBrightness(pPD->glcdDriver, nBrightness); diff --git a/server/drivers/glk.c b/server/drivers/glk.c index ebf5ea7..e0330ec 100644 --- a/server/drivers/glk.c +++ b/server/drivers/glk.c @@ -109,7 +109,7 @@ glk_init(Driver *drvthis) /* What speed to use */ p->speed = drvthis->config_get_int(drvthis->name, "Speed", 0, 19200); - + if (p->speed == 9600) p->speed = B9600; else if (p->speed == 19200) p->speed = B19200; else if (p->speed == 38400) p->speed = B38400; @@ -332,7 +332,7 @@ glk_flush(Driver *drvthis) for (y = 0; y < p->height; ++y) { int xs = -1; /* XStart not set */ - + for (x = 0; x < p->width; ++x) { if ((*qf == *pf) && (xs >= 0)) { /* Write accumulated string */ @@ -572,7 +572,7 @@ glk_old_vbar(Driver *drvthis, int x, int len) if (y >= 0) { int lastc; - + switch (len) { case 0 : return; break; /* Don't output a char */ 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; debug(RPT_DEBUG, "glk_old_hbar(%d, %d, %d)", x, y, len); - + while (len > p->cellwidth) { glk_chr(drvthis, x, y, 255); ++x; diff --git a/server/drivers/hd44780-lis2.c b/server/drivers/hd44780-lis2.c index 7b9c2f1..4ac22da 100644 --- a/server/drivers/hd44780-lis2.c +++ b/server/drivers/hd44780-lis2.c @@ -104,12 +104,12 @@ int hd_init_lis2 (Driver *drvthis) return 0; } - + void SetMatrice(PrivateData *p, int fd, int matriceNum, int ligne, int point) { - // char from 0 to 7 - // line from 0 to 7 from top to bottom + // char from 0 to 7 + // 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) writeChar(p->fd,0); writeChar(p->fd,171); @@ -146,7 +146,7 @@ void gotoXY(int fd, int x, int y) void writeChar(int fd, int code) { char buf = code; - + write(fd, &buf, 1); } @@ -183,9 +183,9 @@ void lis2_HD44780_senddata (PrivateData *p, unsigned char displayID, unsigned ch int x = 0; int y = 0; int pos = 0; - + pos = (ch & ~POSITION); - + if (p->ext_mode) { y = pos/0x20; x = pos-(y*0x20); @@ -194,12 +194,12 @@ void lis2_HD44780_senddata (PrivateData *p, unsigned char displayID, unsigned ch y = pos/0x40; x = pos-(y*0x40); } - + writeChar( p->fd, 0); writeChar( p->fd, 161 + y); writeChar( p->fd, x); writeChar( p->fd, 167); - + } 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 ); } - + } void lis2_HD44780_backlight (PrivateData *p, unsigned char state) diff --git a/server/drivers/hd44780-low.h b/server/drivers/hd44780-low.h index 646a7ce..ac4ffa3 100644 --- a/server/drivers/hd44780-low.h +++ b/server/drivers/hd44780-low.h @@ -37,7 +37,7 @@ typedef enum { bignum, /* big numbers */ bigchar /* big characters */ } CGmode; - + typedef struct cgram_cache { unsigned char cache[LCD_DEFAULT_CELLHEIGHT]; 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 // underline effect (false). To avoid the underline effect, last line is always zeroed // for whatever redefined character - + // keyMapDirect contains an array of the ascii-codes that should be generated // when a directly connected key is pressed (not in matrix). char *keyMapDirect[KEYPAD_MAXX]; diff --git a/server/drivers/hd44780.c b/server/drivers/hd44780.c index 672eff8..efd1ff0 100644 --- a/server/drivers/hd44780.c +++ b/server/drivers/hd44780.c @@ -368,7 +368,7 @@ HD44780_close(Driver *drvthis) if (p != NULL) { if (p->framebuf) free(p->framebuf); - + if (p->lcd_contents) free(p->lcd_contents); @@ -440,7 +440,7 @@ HD44780_position (Driver *drvthis, int x, int y) relY = 1; } } - + DDaddr = x + (relY % 2) * 0x40; if ((relY % 4) >= 2) DDaddr += p->width; diff --git a/server/drivers/icp_a106.c b/server/drivers/icp_a106.c index 2da5fb7..5b583f6 100644 --- a/server/drivers/icp_a106.c +++ b/server/drivers/icp_a106.c @@ -177,7 +177,7 @@ MODULE_EXPORT int icp_a106_width (Driver *drvthis) { PrivateData *p = (PrivateData *) drvthis->private_data; - + return p->width; } @@ -188,7 +188,7 @@ MODULE_EXPORT int icp_a106_height (Driver *drvthis) { PrivateData *p = (PrivateData *) drvthis->private_data; - + return p->height; } @@ -199,7 +199,7 @@ MODULE_EXPORT void icp_a106_clear (Driver *drvthis) { PrivateData *p = (PrivateData *) drvthis->private_data; - + 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) { PrivateData *p = (PrivateData *) drvthis->private_data; - + y--; x--; //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) { PrivateData *p = (PrivateData *) drvthis->private_data; - + x--; // Convert 1-based coords to 0-based y--; diff --git a/server/drivers/imon.c b/server/drivers/imon.c index 4d7527c..f4ac47f 100644 --- a/server/drivers/imon.c +++ b/server/drivers/imon.c @@ -132,7 +132,7 @@ MODULE_EXPORT int imon_init (Driver *drvthis) memset(p->framebuf, ' ', p->width * p->height); report(RPT_DEBUG, "%s: init() done", drvthis->name); - + return 1; } @@ -297,7 +297,7 @@ MODULE_EXPORT int imon_width (Driver *drvthis) MODULE_EXPORT int imon_height (Driver *drvthis) { PrivateData *p = drvthis->private_data; - + return p->height; } @@ -307,7 +307,7 @@ MODULE_EXPORT int imon_height (Driver *drvthis) MODULE_EXPORT int imon_cellwidth (Driver *drvthis) { PrivateData *p = drvthis->private_data; - + return p->cellwidth; } @@ -317,7 +317,7 @@ MODULE_EXPORT int imon_cellwidth (Driver *drvthis) MODULE_EXPORT int imon_cellheight (Driver *drvthis) { PrivateData *p = drvthis->private_data; - + return p->cellheight; } diff --git a/server/drivers/irmanin.c b/server/drivers/irmanin.c index e42b6a1..1093f8b 100644 --- a/server/drivers/irmanin.c +++ b/server/drivers/irmanin.c @@ -73,7 +73,7 @@ irmanin_init (Driver *drvthis) return -1; if (drvthis->store_private_ptr(drvthis, p)) return -1; - + /* Read config file */ /* What device should be used */ @@ -141,7 +141,7 @@ irmanin_close (Driver *drvthis) if (p != NULL) free(p); drvthis->store_private_ptr(drvthis, NULL); - + ir_free_commands(); ir_finish(); } diff --git a/server/drivers/joy.c b/server/drivers/joy.c index 19a613b..35d083c 100644 --- a/server/drivers/joy.c +++ b/server/drivers/joy.c @@ -101,7 +101,7 @@ joy_init (Driver *drvthis) report(RPT_INFO, "%s: using Device %s", drvthis->name, p->device); /* End of config file parsing (1st part) */ - + if ((p->fd = open(p->device, O_RDONLY)) < 0) { report(RPT_ERR, "%s: open(%s) failed (%s)", drvthis->name, p->device, strerror(errno)); @@ -151,7 +151,7 @@ joy_init (Driver *drvthis) drvthis->name, i+1, p->axismap[2*i + 1]); } } - + for (i = 0; i < p->buttons; i++) { char mapkey[50]; char *mapval; @@ -164,9 +164,9 @@ joy_init (Driver *drvthis) drvthis->name, i+1, p->buttonmap[i]); } } - + /* End of config file parsing (2nd part) */ - + report(RPT_DEBUG, "%s: init() done", drvthis->name); return 0; @@ -177,7 +177,7 @@ MODULE_EXPORT void joy_close (Driver *drvthis) { PrivateData *p = drvthis->private_data; - + if (p != NULL) { if (p->fd >= 0) close(p->fd); diff --git a/server/drivers/lb216.c b/server/drivers/lb216.c index 68c2854..2f64712 100644 --- a/server/drivers/lb216.c +++ b/server/drivers/lb216.c @@ -113,7 +113,7 @@ LB216_init(Driver * drvthis) /* What speed to use */ p->speed = drvthis->config_get_int(drvthis->name, "Speed", 0, LB216_DEFAULT_SPEED); - + if (p->speed == 2400) p->speed = B2400; else if (p->speed == 9600) p->speed = B9600; else { @@ -129,12 +129,12 @@ LB216_init(Driver * drvthis) drvthis->name, LB216_DEFAULT_BRIGHTNESS); p->backlight_brightness = LB216_DEFAULT_BRIGHTNESS; } - + /* Reboot display? */ reboot = drvthis->config_get_bool(drvthis->name , "Reboot", 0, 0); /* End of config file parsing */ - + // Set up io port correctly, and open it... p->fd = open(p->device, O_RDWR | O_NOCTTY | O_NDELAY); 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 */ c= '#'; - + if ((x >= 0) && (y >= 0) && (x < p->width) && (y < p->height)) p->framebuf[(y * p->width) + x] = c; } @@ -351,7 +351,7 @@ static void LB216_reboot(Driver * drvthis) { PrivateData *p = drvthis->private_data; char out[4]; - + snprintf(out, sizeof(out), "%c%c", 254, 1); 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)) return; - + for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) { unsigned char c = string[i]; if (c == 254) /* protect command starting char */ c= '#'; - + if (x >= 0) p->framebuf[(y * p->width) + x] = c; } @@ -547,7 +547,7 @@ LB216_vbar(Driver * drvthis, int x, int len) PrivateData *p = drvthis->private_data; char map[9] = { 32, 1, 2, 3, 4, 5, 6, 7, 255 }; int y; - + for (y = p->height; (y > 0) && (len > 0); y--) { if (len >= p->cellheight) LB216_chr(drvthis, x, y, map[8]); diff --git a/server/drivers/lcdm001.c b/server/drivers/lcdm001.c index 3734a0b..a8fcab3 100644 --- a/server/drivers/lcdm001.c +++ b/server/drivers/lcdm001.c @@ -75,7 +75,7 @@ typedef struct driver_private_data { char back_key; char forward_key; char main_menu_key; - + char *framebuf; 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 p->framebuf[(y * p->width) + x] = string[i]; } - + 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) - return; + return; //TODO: Distinguish between len>=4 and len<4 } @@ -465,7 +465,7 @@ lcdm001_get_key (Driver *drvthis) char in = '\0'; const char *key = NULL; - read(p->fd, &in, 1); + read(p->fd, &in, 1); if (in == p->pause_key) { key = "Enter"; } else if (in == p->back_key) { diff --git a/server/drivers/lcterm.c b/server/drivers/lcterm.c index 34711e9..0a42873 100644 --- a/server/drivers/lcterm.c +++ b/server/drivers/lcterm.c @@ -493,7 +493,7 @@ lcterm_init_hbar (Driver *drvthis) drvthis->name); return; } - + p->ccmode = p->last_ccmode = CCMODE_HBAR; lcterm_set_char(drvthis, 1, hbar_1); diff --git a/server/drivers/lircin.c b/server/drivers/lircin.c index 4f934f1..48b74ff 100644 --- a/server/drivers/lircin.c +++ b/server/drivers/lircin.c @@ -146,7 +146,7 @@ lircin_init (Driver *drvthis) fcntl (p->lircin_fd, F_SETFD, FD_CLOEXEC); report(RPT_DEBUG, "%s: init() done", drvthis->name); - + return 0; } @@ -166,11 +166,11 @@ lircin_close (Driver *drvthis) if (p->prog != NULL) free(p->prog); p->prog = NULL; - + if (p->lircin_irconfig != NULL) lirc_freeconfig (p->lircin_irconfig); p->lircin_irconfig = NULL; - + if (p->lircin_fd >= 0) { lirc_deinit (); close (p->lircin_fd); diff --git a/server/drivers/ms6931.c b/server/drivers/ms6931.c index 6b2ad4c..bd1863b 100644 --- a/server/drivers/ms6931.c +++ b/server/drivers/ms6931.c @@ -161,7 +161,7 @@ ms6931_init (Driver *drvthis) /* initialize private data */ p->fd = -1; p->framebuf = NULL; - + debug(RPT_INFO, "ms6931_init: init(%p)", drvthis); @@ -248,7 +248,7 @@ ms6931_close (Driver *drvthis) ms6931_flush(drvthis); ms6931_backlight (drvthis, BACKLIGHT_OFF); } - + if (p->fd >= 0) close(p->fd); @@ -302,7 +302,7 @@ ms6931_chr (Driver *drvthis, int x, int y, char c) y--; x--; - + if ((x >= 0) && (y >= 0) && (x < p->width) && (y < p->height)) 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)) return; - + for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) { unsigned char c = (unsigned char) string[i]; @@ -479,7 +479,7 @@ ms6931_get_key (Driver *drvthis) FD_SET(p->fd, &fdset); return NULL; } - + if (!FD_ISSET(p->fd, &fdset)) return NULL; diff --git a/server/drivers/mtc_s16209x.c b/server/drivers/mtc_s16209x.c index e1d658f..2158f54 100644 --- a/server/drivers/mtc_s16209x.c +++ b/server/drivers/mtc_s16209x.c @@ -165,14 +165,14 @@ MTC_S16209X_init (Driver * drvthis) backlight_brightness = MTC_DEFAULT_BRIGHTNESS; } #endif // CAN_CONTROL_BACKLIGHT - + #ifdef CAN_REBOOT_LCD /* Reboot display? */ reboot = drvthis->config_get_bool(drvthis->name , "Reboot", 0, 0); #endif // CAN_REBOOT_LCD - + /* End of config file parsing */ - + // Set up io port correctly, and open it... p->fd = open(p->device, O_RDWR | O_NOCTTY | O_NDELAY); 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)) return; - + for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) { if (x >= 0) p->framebuf[y][x] = string[i]; diff --git a/server/drivers/port.h b/server/drivers/port.h index 732ff9b..c223809 100644 --- a/server/drivers/port.h +++ b/server/drivers/port.h @@ -234,17 +234,17 @@ Use i386_get_ioperm, i386_set_ioperm from and inb and outb f #if (__FreeBSD_version > 500000) static FILE * port_access_handle = NULL; #endif - + /* Read a byte from port */ static inline int port_in (unsigned short port) { return inb(port); } - + /* Write a byte 'val' to port */ static inline void port_out (unsigned short port, unsigned char val) { outb(port,val); } - + /* Get access to a specific port */ static inline int port_access (unsigned short port) { #if (__FreeBSD_version > 500000) diff --git a/server/drivers/pylcd.c b/server/drivers/pylcd.c index 83afd12..72a728c 100644 --- a/server/drivers/pylcd.c +++ b/server/drivers/pylcd.c @@ -5,7 +5,7 @@ Copyright (C) 2005 Silvan Marco Fin Copyright (C) 2006 coresystems GmbH - + 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 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. * ie. 0x8 --> 0x28 */ - + while (len--) { if (buffer[i]<0x20) { buffer2[j++]=0x1b; @@ -196,7 +196,7 @@ real_send_tele(PrivateData *p, char *buffer, int len) } buffer2[j++]=3; // emit len=j; // new package length - + /* calculate over all bytes */ for (i=0; istore_private_ptr(drvthis, p) < 0)) { @@ -317,14 +317,14 @@ pyramid_init (Driver *drvthis, char *args) p->cellwidth=CELLWIDTH; p->cellheight=CELLHEIGHT; p->custom = normal; - + strcpy(p->last_key_pressed, NOKEY); p->last_key_time = timestamp(p); p->last_buf_time = timestamp(p); p->timeout.tv_sec = 0; p->timeout.tv_usec = MICROTIMEOUT; - + strcpy(p->framebuffer, "D "); 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); /* Initialize connection to the LCD */ - + /* open and initialize serial device */ 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)); return -1; } - + if (initTTY(drvthis, p->FD) != 0) return -1; - + /* Acknowledge all telegramms, the device may yet be sending. * (Reset doesn't clear telegramms, darn protocol ... ) */ tcflush(p->FD, TCIFLUSH); /* clear everything */ - + while (1) { i = read_tele(p, buffer); if (i == True) @@ -460,7 +460,7 @@ pyramid_flush (Driver *drvthis) case 0xb0: mesg[i]=0xdf; break; // ° } } - + send_tele(p, "C0101"); real_send_tele(p, mesg, 33); /* We do not wait for the ACK here*/ 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"; int row, column, pixels; - + PrivateData *p = (PrivateData *) drvthis->private_data; - + if (n<0 && n>15) { debug(RPT_DEBUG, "only characters 0-15 can be changed.\n"); return; } - + if (!dat) { debug(RPT_DEBUG, "no character data\n"); return; @@ -521,7 +521,7 @@ MODULE_EXPORT void pyramid_set_char (Driver *drvthis, int n, char *dat) // which character? tele[1]=n+0x40; - + for (row = 0; row < p->cellheight; row++) { pixels=0; 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 // an offset of 40h - + tele[row+2]=pixels; } real_send_tele(p, tele, 10); @@ -737,7 +737,7 @@ pyramid_init_custom1 (Driver *drvthis) 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, }; - + char c[] = { 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, }; - + if (p->custom != custom1) { pyramid_set_char (drvthis, 1, a); 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, 1, 1, 1, }, - + { 0, 0, 1, 0, 0, // Arrow up 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, 0, 0, 0, }, - + { 0, 0, 1, 0, 0, // Arrow Down 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, 0, 0, 0, }, - + { 0, 0, 0, 0, 0, // Checkbox off 0, 0, 0, 0, 0, @@ -854,7 +854,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon) 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, }, - + { 0, 0, 1, 0, 0, // Checkbox on 0, 0, 1, 0, 0, @@ -865,7 +865,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon) 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, }, - + { 0, 0, 0, 0, 0, // Checkbox gray 0, 0, 0, 0, 0, @@ -876,7 +876,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon) 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, }, - + { 0, 0, 0, 0, 0, // Ellipsis 0, 0, 0, 0, 0, @@ -906,7 +906,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon) case ICON_BLOCK_FILLED: pyramid_chr( drvthis, x, y, 255 ); break; - + case ICON_HEART_OPEN: pyramid_set_char( drvthis, 0, icons[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_chr( drvthis, x, y, 0 ); break; - + case ICON_ARROW_UP: pyramid_set_char( drvthis, 2, icons[2] ); pyramid_chr( drvthis, x, y, 2 ); p->custom = icon; break; - + case ICON_ARROW_DOWN: pyramid_set_char( drvthis, 3, icons[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: pyramid_chr( drvthis, x, y, '\177' ); break; - + case ICON_ARROW_RIGHT: pyramid_chr( drvthis, x, y, '\176' ); break; @@ -946,12 +946,12 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon) pyramid_set_char( drvthis, 11, icons[5] ); pyramid_chr( drvthis, x, y, 11 ); break; - + case ICON_CHECKBOX_GRAY: pyramid_set_char( drvthis, 12, icons[6] ); pyramid_chr( drvthis, x, y, 12 ); break; - + case ICON_ELLIPSIS: pyramid_set_char( drvthis, 13, icons[7] ); pyramid_chr( drvthis, x, y, 13 ); @@ -1019,7 +1019,7 @@ pyramid_output (Driver *drvthis, int state) for (i = 0; i < 7; i++) p->led[i] = state & (1 << i); - + set_leds(p); if(state & (1 << 8)) { @@ -1043,7 +1043,7 @@ pyramid_get_key (Driver *drvthis) * and as long as we got ACKs, we ignore them. * (eat up all pending ACKs) */ - + while (1) { retval = read_tele(p, buffer); if ((retval == False) || (buffer[0] != 'Q')) break; @@ -1090,7 +1090,7 @@ pyramid_get_key (Driver *drvthis) return "Enter"; if (strcmp(p->last_key_pressed, "K1000") == 0) /* last from left */ return "Escape"; - + #ifdef PYRAMID_DECODE_COMBINED_KEYPRESSES /* Do we really want to type that much */ if (strcmp(p->last_key_pressed, "K0012") == 0) /* A+B */ @@ -1106,7 +1106,7 @@ pyramid_get_key (Driver *drvthis) return "Up+Escape"; if (strcmp(p->last_key_pressed, "K2001") == 0) /* D+A */ return "Escape+Up"; - + if (strcmp(p->last_key_pressed, "K0120") == 0) /* B+C */ return "Down+Enter"; if (strcmp(p->last_key_pressed, "K0210") == 0) /* C+B */ @@ -1115,7 +1115,7 @@ pyramid_get_key (Driver *drvthis) return "Down+Escape"; if (strcmp(p->last_key_pressed, "K2010") == 0) /* D+B */ return "Escape+Down"; - + if (strcmp(p->last_key_pressed, "K0012") == 0) /* C+D */ return "Enter+Escape"; if (strcmp(p->last_key_pressed, "K0021") == 0) /* D+C */ diff --git a/server/drivers/sed1520.c b/server/drivers/sed1520.c index da542da..449839e 100644 --- a/server/drivers/sed1520.c +++ b/server/drivers/sed1520.c @@ -66,7 +66,7 @@ typedef struct driver_private_data { unsigned int port; - + unsigned char *framebuf; } PrivateData; @@ -168,7 +168,7 @@ sed1520_init (Driver *drvthis) /* What port to use */ p->port = drvthis->config_get_int(drvthis->name, "Port", 0, DEFAULT_PORT); - + /* End of config file parsing */ if (timing_init() == -1) { @@ -285,7 +285,7 @@ sed1520_flush (Driver *drvthis) for (i = 0; i < HEIGHT; i++) { selectpage(p->port, i); - + selectcolumn(p->port, 0, CS2) ; for (j = 0; j < PIXELWIDTH/2; j++) writedata(p->port, p->framebuf[j + (i * PIXELWIDTH)], CS2); diff --git a/server/drivers/serialVFD.c b/server/drivers/serialVFD.c index e461a91..855b685 100644 --- a/server/drivers/serialVFD.c +++ b/server/drivers/serialVFD.c @@ -267,7 +267,7 @@ serialVFD_init (Driver *drvthis) p->refresh_timer = 0; debug(RPT_INFO, "%s(%p)", __FUNCTION__, drvthis ); - + /* Read config file */ /* Which device should be used */ 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) const unsigned int usr_chr_mapping_2[31]= {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++) p->usr_chr_mapping[tmp]=usr_chr_mapping_2[tmp]; break; @@ -729,11 +729,11 @@ serialVFD_set_char (Driver *drvthis, int n, unsigned char *dat) for (bit = 0; bit < 8; bit++) { int pos = (int) p->usr_chr_dot_assignment[bit+8*byte+1]; - + if (pos > 0) { int posbyte = (pos-1) / 5; int posbit = 4 - ((pos-1) % 5); - + letter |= ((dat[posbyte] >> posbit) & 1) << bit;; } } @@ -1077,7 +1077,7 @@ MODULE_EXPORT void serialVFD_flush (Driver *drvthis) { PrivateData *p = drvthis->private_data; - + serialVFD_draw_frame(drvthis, p->framebuf); } diff --git a/server/drivers/stv5730.c b/server/drivers/stv5730.c index 64828ac..c8f6fa5 100644 --- a/server/drivers/stv5730.c +++ b/server/drivers/stv5730.c @@ -304,7 +304,7 @@ stv5730_init (Driver *drvthis) /* What port to use */ p->port = drvthis->config_get_int(drvthis->name, "Port", 0, LPTPORT); - + /* End of config file parsing */ if (timing_init() == -1) { diff --git a/server/drivers/svgalib_drv.c b/server/drivers/svgalib_drv.c index fbe94e4..bfe1551 100644 --- a/server/drivers/svgalib_drv.c +++ b/server/drivers/svgalib_drv.c @@ -253,7 +253,7 @@ svga_init (Driver *drvthis) if (drvthis->config_has_key(drvthis->name, "Size")) { int w; int h; - + strncpy(size, drvthis->config_get_string(drvthis->name, "Size", 0, DEFAULT_SIZE), sizeof(size)); 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); - + /* Which backlight brightness */ tmp = drvthis->config_get_int(drvthis->name, "Brightness", 0, DEFAULT_BRIGHTNESS); 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); return -1; } - + tmp = (p->brightness * 255) / 1000; if (tmp <= 0) tmp = 1; @@ -469,7 +469,7 @@ svga_string (Driver *drvthis, int x, int y, char string[]) { PrivateData *p = drvthis->private_data; int i; - + debug(RPT_DEBUG, "%s(%p, %d, %d, \"%s\")", __FUNCTION__, drvthis, x, y, string); for (i = 0; string[i] != '\0'; i++) { diff --git a/server/drivers/t6963.c b/server/drivers/t6963.c index a68755f..93e4f20 100644 --- a/server/drivers/t6963.c +++ b/server/drivers/t6963.c @@ -216,7 +216,7 @@ MODULE_EXPORT void t6963_close (Driver *drvthis) { PrivateData *p = drvthis->private_data; - + debug(RPT_INFO, "Shutting down!"); if (p != NULL) { @@ -226,7 +226,7 @@ t6963_close (Driver *drvthis) if (p->display_buffer1 != NULL) free(p->display_buffer1); - + if (p->display_buffer2 != NULL) free(p->display_buffer2); @@ -242,7 +242,7 @@ MODULE_EXPORT int t6963_width (Driver *drvthis) { PrivateData *p = drvthis->private_data; - + return p->width; } @@ -253,7 +253,7 @@ MODULE_EXPORT int t6963_height (Driver *drvthis) { PrivateData *p = drvthis->private_data; - + return p->height; } @@ -264,7 +264,7 @@ MODULE_EXPORT void t6963_clear (Driver *drvthis) { PrivateData *p = drvthis->private_data; - + debug(RPT_DEBUG, "Clearing Display of size %d x %d", p->width, p->height); memset(p->display_buffer1, ' ', p->width * p->height); debug(RPT_DEBUG, "Done"); @@ -292,7 +292,7 @@ t6963_flush (Driver *drvthis) { PrivateData *p = drvthis->private_data; int i; - + debug(RPT_DEBUG, "Flushing %d x %d", p->width, p->height); for (i = 0; i < (p->width * p->height); i++) { @@ -495,7 +495,7 @@ void t6963_low_data (Driver *drvthis, u8 byte) { PrivateData *p = drvthis->private_data; - + t6963_low_dsp_ready(drvthis); t6963_low_set_control(drvthis, 1, 1, 0, 1); // CD down (data) t6963_low_set_control(drvthis, 0, 0, 0, 1); // CE & WR down @@ -513,14 +513,14 @@ void t6963_low_command (Driver *drvthis, u8 byte) { PrivateData *p = drvthis->private_data; - + t6963_low_dsp_ready(drvthis); t6963_low_set_control(drvthis, 1, 1, 1, 1); // CD up (command) 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(0x80, 0x00); 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 t6963_low_set_control(drvthis, 1, 1, 1, 1); @@ -532,7 +532,7 @@ void t6963_low_command_byte(Driver *drvthis, u8 cmd, u8 byte) { //PrivateData *p = drvthis->private_data; - + t6963_low_data(drvthis, byte); t6963_low_command(drvthis, cmd); } @@ -541,7 +541,7 @@ void t6963_low_command_2_bytes(Driver *drvthis, u8 cmd, u8 byte1, u8 byte2) { //PrivateData *p = drvthis->private_data; - + t6963_low_data(drvthis, byte1); t6963_low_data(drvthis, byte2); t6963_low_command(drvthis, cmd); @@ -551,7 +551,7 @@ void t6963_low_command_word(Driver *drvthis, u8 cmd, u16 word) { //PrivateData *p = drvthis->private_data; - + t6963_low_data(drvthis, word%256); t6963_low_data(drvthis, word>>8); t6963_low_command(drvthis, cmd); diff --git a/server/drivers/text.c b/server/drivers/text.c index 52a164a..92ffbe6 100644 --- a/server/drivers/text.c +++ b/server/drivers/text.c @@ -176,7 +176,7 @@ text_flush (Driver *drvthis) memset(out, '-', p->width); out[p->width] = '\0'; printf("+%s+\n", out); - + fflush(stdin); } diff --git a/server/drivers/tyan_lcdm.c b/server/drivers/tyan_lcdm.c index 9eda353..5c02688 100644 --- a/server/drivers/tyan_lcdm.c +++ b/server/drivers/tyan_lcdm.c @@ -1,5 +1,5 @@ /* This is the LCDproc driver for tyan lcd module (tyan Barebone GS series) - + Author: yhlu@tyan.com Copyright (C) 2004 Tyan Corp @@ -157,7 +157,7 @@ tyan_lcdm_init (Driver * drvthis, char *args) /* Set up io port correctly, and open it... */ debug(RPT_DEBUG, "tyan_lcdm: Opening serial device: %s", p->device); - + p->fd = open(p->device, O_RDWR | O_NOCTTY | O_NDELAY); if (p->fd == -1) { report(RPT_ERR, "%s: open(%s) failed (%s)", @@ -202,7 +202,7 @@ tyan_lcdm_init (Driver * drvthis, char *args) return -1; } memset(p->backingstore, ' ', p->width * p->height); - + /* Set display-specific stuff.. */ tyan_lcdm_switch_mode(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 // 1<= length <=16 unsigned char cmd_str[20] = { TYAN_LCDM_CMD_BEGIN, 0x70, 0x02 }; - + tyan_lcdm_set_rampos(fd, start_addr); memset(cmd_str, ' ', 20); cmd_str[0] = TYAN_LCDM_CMD_BEGIN; diff --git a/server/drivers/tyan_lcdm.h b/server/drivers/tyan_lcdm.h index e99d27e..e4f9a97 100644 --- a/server/drivers/tyan_lcdm.h +++ b/server/drivers/tyan_lcdm.h @@ -1,5 +1,5 @@ /* This is the LCDproc driver header for tyan lcd module (tyan Barebone GS series) - + Author: yhlu@tyan.com Copyright (C) 2004 Tyan Corp diff --git a/server/drivers/ula200.c b/server/drivers/ula200.c index 039fdc9..13cc0cf 100644 --- a/server/drivers/ula200.c +++ b/server/drivers/ula200.c @@ -176,13 +176,13 @@ void EmptyKeyRing(KeyRing *kr) int AddKeyToKeyRing(KeyRing *kr, unsigned char key) { 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->head = (kr->head + 1) % KEYRINGSIZE; return 1; } - + /* KeyRing overflow: do not accept extra key */ return 0; } @@ -237,10 +237,10 @@ typedef struct { // the keyring KeyRing keyring; - + // the keymap char *key_map[MAX_KEY_MAP]; - + } PrivateData; @@ -251,7 +251,7 @@ ula200_ftdi_usb_read(PrivateData *p) { unsigned char buffer[1]; int err; - + while ((err = ftdi_read_data(&p->ftdic, buffer, 1)) == 0); if (err < 0) { @@ -276,7 +276,7 @@ ula200_ftdi_read_response(Driver *drvthis) bool answer_read = false; int ret; int ch; - + while (!answer_read) { /* wait until STX */ @@ -415,7 +415,7 @@ ula200_ftdi_position(Driver *drvthis, int x, int y) y -= 2; x += p->width; } - + command[0] = 'p'; command[1] = x; command[2] = y; @@ -472,7 +472,7 @@ ula200_ftdi_string(Driver *drvthis, unsigned char *string, int len) for (i = 0; i < len; i++) { buffer[i+2] = HD44780_charmap[(unsigned char)string[i]]; } - + err = ula200_ftdi_write_command(drvthis, buffer, len+2, true); if (err < 0) { report(RPT_WARNING, "%s: ula200_ftdi_string: " @@ -585,7 +585,7 @@ ula200_load_curstom_chars(Driver *drvthis) /* Send the subsequent rows */ for (row = 0; row < CELLHEIGHT; row++) { int value = 0; - + for (col = 0; col < CELLWIDTH; col++) { value <<= 1; value |= (custom_chars[i][(row * CELLWIDTH) + col] > 0) ? 1 : 0; @@ -655,7 +655,7 @@ ula200_init(Driver *drvthis) /* End of config file parsing */ - + // Allocate framebuffer p->framebuf = (unsigned char *) malloc(p->width * p->height); if (p->framebuf == NULL) { @@ -712,7 +712,7 @@ ula200_init(Driver *drvthis) } report(RPT_DEBUG, "%s: init() done", drvthis->name); - + return 0; err_ftdi: @@ -742,7 +742,7 @@ ula200_close(Driver *drvthis) if (p->framebuf != NULL) free(p->framebuf); - + if (p->lcd_contents != NULL) free(p->lcd_contents); @@ -954,7 +954,7 @@ ula200_get_key (Driver *drvthis) if (key & (1 << i)) return p->key_map[i]; } - + if (key != '\0') { report(RPT_INFO, "%s: Untreated key 0x%02X", drvthis->name, key); } diff --git a/server/drivers/ula200.h b/server/drivers/ula200.h index 5fa7bd4..0574f5b 100644 --- a/server/drivers/ula200.h +++ b/server/drivers/ula200.h @@ -1,5 +1,5 @@ /* This is the LCDproc driver header for ULA-200 (http://www.elv.de) - + Author: bernhard.walle@gmx.de Copyright (C) 2006, Bernhard Walle diff --git a/server/drivers/wirz-sli.c b/server/drivers/wirz-sli.c index 48aa434..71f0d43 100644 --- a/server/drivers/wirz-sli.c +++ b/server/drivers/wirz-sli.c @@ -91,7 +91,7 @@ sli_init (Driver *drvthis) /* What speed to use */ p->speed = drvthis->config_get_int(drvthis->name, "Speed", 0, 19200); - + if (p->speed == 1200) p->speed = B1200; else if (p->speed == 2400) p->speed = B2400; else if (p->speed == 9600) p->speed = B9600; @@ -114,7 +114,7 @@ sli_init (Driver *drvthis) return -1; } report(RPT_DEBUG, "%s: opened device %s", drvthis->name, p->device); - + tcgetattr(p->fd, &portset); // We use RAW mode @@ -144,7 +144,7 @@ sli_init (Driver *drvthis) return -1; } memset(p->framebuf, ' ', p->width * p->height); - + /* Initialize SLI using autobaud detection, and then turn off cursor and clear screen */ usleep(150000); /* 150ms delay to allow SLI to power on */ diff --git a/server/drivers/xosdlib_drv.c b/server/drivers/xosdlib_drv.c index 97cd207..2b36584 100644 --- a/server/drivers/xosdlib_drv.c +++ b/server/drivers/xosdlib_drv.c @@ -83,7 +83,7 @@ xosdlib_drv_init (Driver *drvthis) if (drvthis->config_has_key(drvthis->name, "Size")) { int w; int h; - + strncpy(size, drvthis->config_get_string(drvthis->name, "Size", 0, DEFAULT_SIZE), sizeof(size)); 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); - + /* Which backlight brightness */ tmp = drvthis->config_get_int(drvthis->name, "Brightness", 0, DEFAULT_BRIGHTNESS); debug(RPT_INFO, "%s: Brightness (in config) is '%d'", __FUNCTION__, tmp); @@ -185,7 +185,7 @@ xosdlib_drv_close (Driver *drvthis) if (p->osd) xosd_destroy(p->osd); p->osd = NULL; - + if (p->framebuf != NULL) free(p->framebuf); p->framebuf = NULL; @@ -253,7 +253,7 @@ xosdlib_drv_flush (Driver *drvthis) for (i = 0; i < p->height; i++) { memcpy(buffer, p->framebuf + (i * p->width), p->width); buffer[p->width] = '\0'; - + debug(RPT_DEBUG, "xosd: flushed string \"%s\" at (%d,%d)", buffer, 0, i); 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; int i; - + debug(RPT_DEBUG, "%s(%p, %d, %d, \"%s\")", __FUNCTION__, drvthis, x, y, string); x--;