Big cleanup: Remove trailing whitespace from files (except those imported
from external sources).
This commit is contained in:
@@ -69,10 +69,10 @@ static char *argv2string(int argc, char **argv)
|
||||
*\verbatim
|
||||
* Usage: menu_add_item <menuid> <newitemid> <type> [<text>]
|
||||
*\endverbatim
|
||||
*
|
||||
*
|
||||
* You should use "" as id for the client's main menu. This menu will be
|
||||
* created automatically when you add an item to it the first time.
|
||||
*
|
||||
*
|
||||
* You (currently?) cannot create a menu in the main level yourself.
|
||||
* The names you use for items should be unique for your client.
|
||||
* The text is the visible text for the item.
|
||||
@@ -232,7 +232,7 @@ menu_add_item_func(Client *c, int argc, char **argv)
|
||||
*\verbatim
|
||||
* Usage: menu_del_item <menuid> <itemid>
|
||||
*\endverbatim
|
||||
*
|
||||
*
|
||||
* The given item in the given menu will be deleted. If you have deleted all
|
||||
* the items from your client menu, that menu will automatically be removed.
|
||||
*/
|
||||
@@ -299,7 +299,7 @@ menu_del_item_func(Client *c, int argc, char **argv)
|
||||
*
|
||||
*\verbatim
|
||||
* Usage: menu_set_item <menuid> <itemid> {<option>}+
|
||||
*
|
||||
*
|
||||
* The following parameters can be set per item:
|
||||
* (you should include the - in the option)
|
||||
*
|
||||
@@ -850,7 +850,7 @@ int set_successor(MenuItem *item, char *itemid, Client *c)
|
||||
}
|
||||
|
||||
/**
|
||||
* Requests the menu system to set the entry point into the menu system.
|
||||
* Requests the menu system to set the entry point into the menu system.
|
||||
*
|
||||
*\verbatim
|
||||
* Usage: menu_set_main <id>
|
||||
|
||||
@@ -129,7 +129,7 @@ screen_del_func(Client *c, int argc, char **argv)
|
||||
*
|
||||
*\verbatim
|
||||
* Usage: screen_set <id> [-name <name>] [-wid <width>] [-hgt <height>]
|
||||
* [-priority <prio>] [-duration <int>] [-timeout <int>]
|
||||
* [-priority <prio>] [-duration <int>] [-timeout <int>]
|
||||
* [-heartbeat <type>] [-backlight <type>]
|
||||
* [-cursor <type>] [-cursor_x <xpos>] [-cursor_y <ypos>]
|
||||
*\endverbatim
|
||||
|
||||
@@ -271,7 +271,7 @@ widget_set_func(Client *c, int argc, char **argv)
|
||||
length = atoi(argv[i + 2]);
|
||||
w->x = x;
|
||||
w->y = y;
|
||||
w->length = length; /* This is the length in pixels */
|
||||
w->length = length; /* This is the length in pixels */
|
||||
}
|
||||
debug(RPT_DEBUG, "Widget %s set to %i", wid, w->length);
|
||||
sock_send_string(c->sock, "success\n");
|
||||
|
||||
+1
-1
@@ -543,7 +543,7 @@ driver_alt_num(Driver *drv, int x, int num)
|
||||
* Fallback for the driver's \c heartbeat method if the driver does not provide one.
|
||||
* \param drv Pointer to driver structure.
|
||||
* \param state Current heartbeat state.
|
||||
*/
|
||||
*/
|
||||
void
|
||||
driver_alt_heartbeat(Driver *drv, int state)
|
||||
{
|
||||
|
||||
+18
-18
@@ -365,7 +365,7 @@ CFontz_flush(Driver *drvthis)
|
||||
|
||||
/* move cursor to start of (i+1)'th line */
|
||||
CFontz_cursor_goto(drvthis, 1, i+1);
|
||||
|
||||
|
||||
for (j = 0; j < p->width; j++) {
|
||||
unsigned char c = p->framebuf[(i * p->width) + j];
|
||||
|
||||
@@ -380,9 +380,9 @@ CFontz_flush(Driver *drvthis)
|
||||
*ptr++ = CFONTZ_Send_Data_Directly_To_LCD;
|
||||
*ptr++ = 0x01;
|
||||
}
|
||||
}
|
||||
}
|
||||
*ptr++ = c;
|
||||
}
|
||||
}
|
||||
write(p->fd, out, (ptr - out));
|
||||
}
|
||||
}
|
||||
@@ -399,7 +399,7 @@ CFontz_flush(Driver *drvthis)
|
||||
|
||||
write(p->fd, p->framebuf + (p->width * i), p->width);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -801,7 +801,7 @@ CFontz_icon(Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
static unsigned char heart_open[] =
|
||||
static unsigned char heart_open[] =
|
||||
{ b__XXXXX,
|
||||
b__X_X_X,
|
||||
b_______,
|
||||
@@ -810,7 +810,7 @@ CFontz_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XX_XX,
|
||||
b__XXXXX };
|
||||
static unsigned char heart_filled[] =
|
||||
static unsigned char heart_filled[] =
|
||||
{ b__XXXXX,
|
||||
b__X_X_X,
|
||||
b___X_X_,
|
||||
@@ -820,7 +820,7 @@ CFontz_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__XX_XX,
|
||||
b__XXXXX };
|
||||
/*
|
||||
static unsigned char arrow_up[] =
|
||||
static unsigned char arrow_up[] =
|
||||
{ b____X__,
|
||||
b___XXX_,
|
||||
b__X_X_X,
|
||||
@@ -829,7 +829,7 @@ CFontz_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b____X__,
|
||||
b____X__,
|
||||
b_______ };
|
||||
static unsigned char arrow_down[] =
|
||||
static unsigned char arrow_down[] =
|
||||
{ b____X__,
|
||||
b____X__,
|
||||
b____X__,
|
||||
@@ -838,7 +838,7 @@ CFontz_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b___XXX_,
|
||||
b____X__,
|
||||
b_______ };
|
||||
static unsigned char arrow_left[] =
|
||||
static unsigned char arrow_left[] =
|
||||
{ b_______,
|
||||
b____X__,
|
||||
b___X___,
|
||||
@@ -847,7 +847,7 @@ CFontz_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b____X__,
|
||||
b_______,
|
||||
b_______ };
|
||||
static unsigned char arrow_right[] =
|
||||
static unsigned char arrow_right[] =
|
||||
{ b_______,
|
||||
b____X__,
|
||||
b_____X_,
|
||||
@@ -857,7 +857,7 @@ CFontz_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b_______,
|
||||
b_______ };
|
||||
*/
|
||||
static unsigned char checkbox_off[] =
|
||||
static unsigned char checkbox_off[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b__XXXXX,
|
||||
@@ -866,7 +866,7 @@ CFontz_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
static unsigned char checkbox_on[] =
|
||||
static unsigned char checkbox_on[] =
|
||||
{ b____X__,
|
||||
b____X__,
|
||||
b__XXX_X,
|
||||
@@ -875,7 +875,7 @@ CFontz_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
static unsigned char checkbox_gray[] =
|
||||
static unsigned char checkbox_gray[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b__XXXXX,
|
||||
@@ -885,7 +885,7 @@ CFontz_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
/*
|
||||
static unsigned char selector_left[] =
|
||||
static unsigned char selector_left[] =
|
||||
{ b___X___,
|
||||
b___XX__,
|
||||
b___XXX_,
|
||||
@@ -894,7 +894,7 @@ CFontz_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b___XX__,
|
||||
b___X___,
|
||||
b_______ };
|
||||
static unsigned char selector_right[] =
|
||||
static unsigned char selector_right[] =
|
||||
{ b_____X_,
|
||||
b____XX_,
|
||||
b___XXX_,
|
||||
@@ -903,7 +903,7 @@ CFontz_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b____XX_,
|
||||
b_____X_,
|
||||
b_______ };
|
||||
static unsigned char ellipsis[] =
|
||||
static unsigned char ellipsis[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b_______,
|
||||
@@ -912,7 +912,7 @@ CFontz_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b_______,
|
||||
b__X_X_X,
|
||||
b_______ };
|
||||
static unsigned char block_filled[] =
|
||||
static unsigned char block_filled[] =
|
||||
{ b__XXXXX,
|
||||
b__XXXXX,
|
||||
b__XXXXX,
|
||||
@@ -974,7 +974,7 @@ CFontz_icon(Driver *drvthis, int x, int y, int icon)
|
||||
* \param y Vertical cursor position (row).
|
||||
* \param state New cursor state.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
CFontz_cursor(Driver *drvthis, int x, int y, int state)
|
||||
{
|
||||
PrivateData *p = (PrivateData *) drvthis->private_data;
|
||||
|
||||
+13
-13
@@ -848,7 +848,7 @@ CFontz633_icon (Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
static unsigned char heart_open[] =
|
||||
static unsigned char heart_open[] =
|
||||
{ b__XXXXX,
|
||||
b__X_X_X,
|
||||
b_______,
|
||||
@@ -857,7 +857,7 @@ CFontz633_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XX_XX,
|
||||
b__XXXXX };
|
||||
static unsigned char heart_filled[] =
|
||||
static unsigned char heart_filled[] =
|
||||
{ b__XXXXX,
|
||||
b__X_X_X,
|
||||
b___X_X_,
|
||||
@@ -866,7 +866,7 @@ CFontz633_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b__X_X_X,
|
||||
b__XX_XX,
|
||||
b__XXXXX };
|
||||
static unsigned char arrow_up[] =
|
||||
static unsigned char arrow_up[] =
|
||||
{ b____X__,
|
||||
b___XXX_,
|
||||
b__X_X_X,
|
||||
@@ -875,7 +875,7 @@ CFontz633_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b____X__,
|
||||
b____X__,
|
||||
b_______ };
|
||||
static unsigned char arrow_down[] =
|
||||
static unsigned char arrow_down[] =
|
||||
{ b____X__,
|
||||
b____X__,
|
||||
b____X__,
|
||||
@@ -885,7 +885,7 @@ CFontz633_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b____X__,
|
||||
b_______ };
|
||||
/*
|
||||
static unsigned char arrow_left[] =
|
||||
static unsigned char arrow_left[] =
|
||||
{ b_______,
|
||||
b____X__,
|
||||
b___X___,
|
||||
@@ -894,7 +894,7 @@ CFontz633_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b____X__,
|
||||
b_______,
|
||||
b_______ };
|
||||
static unsigned char arrow_right[] =
|
||||
static unsigned char arrow_right[] =
|
||||
{ b_______,
|
||||
b____X__,
|
||||
b_____X_,
|
||||
@@ -904,7 +904,7 @@ CFontz633_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b_______,
|
||||
b_______ };
|
||||
*/
|
||||
static unsigned char checkbox_off[] =
|
||||
static unsigned char checkbox_off[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b__XXXXX,
|
||||
@@ -913,7 +913,7 @@ CFontz633_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
static unsigned char checkbox_on[] =
|
||||
static unsigned char checkbox_on[] =
|
||||
{ b____X__,
|
||||
b____X__,
|
||||
b__XXX_X,
|
||||
@@ -922,7 +922,7 @@ CFontz633_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
static unsigned char checkbox_gray[] =
|
||||
static unsigned char checkbox_gray[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b__XXXXX,
|
||||
@@ -932,7 +932,7 @@ CFontz633_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
/*
|
||||
static unsigned char selector_left[] =
|
||||
static unsigned char selector_left[] =
|
||||
{ b___X___,
|
||||
b___XX__,
|
||||
b___XXX_,
|
||||
@@ -941,7 +941,7 @@ CFontz633_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b___XX__,
|
||||
b___X___,
|
||||
b_______ };
|
||||
static unsigned char selector_right[] =
|
||||
static unsigned char selector_right[] =
|
||||
{ b_____X_,
|
||||
b____XX_,
|
||||
b___XXX_,
|
||||
@@ -950,7 +950,7 @@ CFontz633_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b____XX_,
|
||||
b_____X_,
|
||||
b_______ };
|
||||
static unsigned char ellipsis[] =
|
||||
static unsigned char ellipsis[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b_______,
|
||||
@@ -959,7 +959,7 @@ CFontz633_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b_______,
|
||||
b__X_X_X,
|
||||
b_______ };
|
||||
static unsigned char block_filled[] =
|
||||
static unsigned char block_filled[] =
|
||||
{ b__XXXXX,
|
||||
b__XXXXX,
|
||||
b__XXXXX,
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
633 Test code for linux.
|
||||
Copyright 2002, David GLAUDE
|
||||
Partial copyright
|
||||
2001 Crystalfontz America, Inc.
|
||||
2001 Crystalfontz America, Inc.
|
||||
brent@crystalfontz.com
|
||||
Written by Brent A. Crosby
|
||||
Written by Brent A. Crosby
|
||||
www.crystalfontz.com
|
||||
===========================================================================
|
||||
|
||||
@@ -242,7 +242,7 @@ send_packet(int fd, COMMAND_PACKET *out, COMMAND_PACKET *in)
|
||||
// print_packet(out);
|
||||
|
||||
/* Every time we send a message, we also check for an incoming one. */
|
||||
test_packet(fd, 0x40 | out->command, in);
|
||||
test_packet(fd, 0x40 | out->command, in);
|
||||
}
|
||||
|
||||
|
||||
@@ -259,10 +259,10 @@ send_packet(int fd, COMMAND_PACKET *out, COMMAND_PACKET *in)
|
||||
* - WIDTH: 16 (16 bit CRC)
|
||||
* - POLY: 0x1021 (generating polynomial)
|
||||
* - INIT: 0xFFFF (seed value for the register when starting the algorithm)
|
||||
* - REFIN: TRUE (reflect [i.e. bit-swap] each input byte before being processed)
|
||||
* - REFIN: TRUE (reflect [i.e. bit-swap] each input byte before being processed)
|
||||
* - REFOUT: TRUE (reflect [i.e. bit-swap] the result before the XOROUT phase)
|
||||
* - XOROUT: 0xFFFF (value to xor the result before returning it as crc)
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
get_crc(unsigned char *buf, int len, int seed)
|
||||
{
|
||||
@@ -355,7 +355,7 @@ void SyncReceiveBuffer(ReceiveBuffer *rb, int fd, unsigned int number)
|
||||
|
||||
if (!retval)
|
||||
return;
|
||||
#endif /* defined(HAVE_SELECT) && defined(CFONTZ633_WRITE_DELAY) && (CFONTZ633_WRITE_DELAY > 0) */
|
||||
#endif /* defined(HAVE_SELECT) && defined(CFONTZ633_WRITE_DELAY) && (CFONTZ633_WRITE_DELAY > 0) */
|
||||
|
||||
if (number > MAX_DATA_LENGTH)
|
||||
number = MAX_DATA_LENGTH;
|
||||
@@ -500,7 +500,7 @@ unsigned char PeekByte(ReceiveBuffer *rb)
|
||||
*/
|
||||
/* I should use the value GIVE_UP and not reenter if there is no extra
|
||||
* byte read from the serial port
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
test_packet(int fd, unsigned char response, COMMAND_PACKET *in)
|
||||
{
|
||||
@@ -651,7 +651,7 @@ check_for_packet(int fd, COMMAND_PACKET *in, unsigned char expected_length)
|
||||
static void
|
||||
print_packet(COMMAND_PACKET *packet)
|
||||
{
|
||||
int i, cmd, top, len;
|
||||
int i, cmd, top, len;
|
||||
|
||||
top = (0xC0 & (packet->command)) >> 6;
|
||||
cmd = (0x3F & (packet->command));
|
||||
|
||||
+34
-34
@@ -24,8 +24,8 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
/*
|
||||
Feedback from Tomislav Secen, who tested it with a 1602:
|
||||
|
||||
Great, this is much better:
|
||||
@@ -33,16 +33,16 @@
|
||||
- bars are OK (at least the few I've seen)
|
||||
- heartbeat icon flashes nicely in the top right corner.
|
||||
|
||||
Only issue I encountered was (similar came up before) - when setting some menu
|
||||
options, or just entering a certain menu (like Options->CwLnx->OnBrightness,
|
||||
lcdvc client menu), the LCD becomes garbled (i.e. displays two blinking hearts,
|
||||
boxes, '%' symbols), sometimes starts displaying just '%' symbols over the whole
|
||||
LCD while I'm pressing Left/Right keys (is this the screen-saver?), scrolling
|
||||
from right to left. Even the "Thank you for using ..." message is garbled (each
|
||||
time in a different way) if I kill the daemon after that. Pressing 'X' when the
|
||||
garbled characters occur exits the menu and the other (client) screens are
|
||||
displayed correctly after that. So only the menus are affected by this issue -
|
||||
it seems that this screen-saver mode kicks in in the wrong time, and tries to
|
||||
Only issue I encountered was (similar came up before) - when setting some menu
|
||||
options, or just entering a certain menu (like Options->CwLnx->OnBrightness,
|
||||
lcdvc client menu), the LCD becomes garbled (i.e. displays two blinking hearts,
|
||||
boxes, '%' symbols), sometimes starts displaying just '%' symbols over the whole
|
||||
LCD while I'm pressing Left/Right keys (is this the screen-saver?), scrolling
|
||||
from right to left. Even the "Thank you for using ..." message is garbled (each
|
||||
time in a different way) if I kill the daemon after that. Pressing 'X' when the
|
||||
garbled characters occur exits the menu and the other (client) screens are
|
||||
displayed correctly after that. So only the menus are affected by this issue -
|
||||
it seems that this screen-saver mode kicks in in the wrong time, and tries to
|
||||
write to LCD faster than it can process chars/commands.
|
||||
*/
|
||||
|
||||
@@ -179,7 +179,7 @@ static int Write_LCD(int fd, char *c, int size)
|
||||
break;
|
||||
}
|
||||
} while (size > 0 && --retries > 0);
|
||||
|
||||
|
||||
return wrote;
|
||||
}
|
||||
|
||||
@@ -551,7 +551,7 @@ CwLnx_init(Driver *drvthis)
|
||||
speed = B19200;
|
||||
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)) {
|
||||
@@ -621,7 +621,7 @@ CwLnx_init(Driver *drvthis)
|
||||
}
|
||||
report(RPT_INFO, "%s: opened display on %s", drvthis->name, device);
|
||||
|
||||
/*
|
||||
/*
|
||||
Since we don't know what speed the display is using when
|
||||
we first connect to it, configure the port for the speed
|
||||
we don't want to use, send a command to switch the display
|
||||
@@ -631,7 +631,7 @@ CwLnx_init(Driver *drvthis)
|
||||
Init_Port(p->fd);
|
||||
if (speed == B9600) {
|
||||
Setup_Port(p->fd, B19200);
|
||||
Set_9600(p->fd);
|
||||
Set_9600(p->fd);
|
||||
} else {
|
||||
Setup_Port(p->fd, B9600);
|
||||
Set_19200(p->fd);
|
||||
@@ -772,7 +772,7 @@ CwLnx_flush(Driver *drvthis)
|
||||
if (firstUpdate && q - lastUpdate > MOVE_COST) {
|
||||
Set_Insert(p->fd, iUpdate, jUpdate);
|
||||
Write_LCD(p->fd, (char *) firstUpdate,
|
||||
lastUpdate - firstUpdate + 1);
|
||||
lastUpdate - firstUpdate + 1);
|
||||
firstUpdate = lastUpdate = NULL;
|
||||
}
|
||||
} else {
|
||||
@@ -784,7 +784,7 @@ CwLnx_flush(Driver *drvthis)
|
||||
}
|
||||
}
|
||||
q++;
|
||||
r++;
|
||||
r++;
|
||||
}
|
||||
}
|
||||
if (firstUpdate) {
|
||||
@@ -879,7 +879,7 @@ CwLnx_backlight(Driver *drvthis, int on)
|
||||
* \param state Brightness state (on/off) for which we want the value.
|
||||
* \return Stored brightness in promille.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
CwLnx_get_brightness(Driver *drvthis, int state)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -1159,12 +1159,12 @@ CwLnx_set_char_unrestricted(Driver *drvthis, int n, unsigned char *dat)
|
||||
* \retval 0 Icon has been successfully defined/written.
|
||||
* \retval <0 Server core shall define/write the icon.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
CwLnx_icon(Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
static unsigned char heart_open[] =
|
||||
static unsigned char heart_open[] =
|
||||
{ b__XXXXX,
|
||||
b__X_X_X,
|
||||
b_______,
|
||||
@@ -1173,7 +1173,7 @@ CwLnx_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XX_XX,
|
||||
b__XXXXX };
|
||||
static unsigned char heart_filled[] =
|
||||
static unsigned char heart_filled[] =
|
||||
{ b__XXXXX,
|
||||
b__X_X_X,
|
||||
b___X_X_,
|
||||
@@ -1182,7 +1182,7 @@ CwLnx_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__X_X_X,
|
||||
b__XX_XX,
|
||||
b__XXXXX };
|
||||
static unsigned char arrow_up[] =
|
||||
static unsigned char arrow_up[] =
|
||||
{ b____X__,
|
||||
b___XXX_,
|
||||
b__X_X_X,
|
||||
@@ -1191,7 +1191,7 @@ CwLnx_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b____X__,
|
||||
b____X__,
|
||||
b_______ };
|
||||
static unsigned char arrow_down[] =
|
||||
static unsigned char arrow_down[] =
|
||||
{ b____X__,
|
||||
b____X__,
|
||||
b____X__,
|
||||
@@ -1201,7 +1201,7 @@ CwLnx_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b____X__,
|
||||
b_______ };
|
||||
/*
|
||||
static unsigned char arrow_left[] =
|
||||
static unsigned char arrow_left[] =
|
||||
{ b_______,
|
||||
b____X__,
|
||||
b___X___,
|
||||
@@ -1210,7 +1210,7 @@ CwLnx_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b____X__,
|
||||
b_______,
|
||||
b_______ };
|
||||
static unsigned char arrow_right[] =
|
||||
static unsigned char arrow_right[] =
|
||||
{ b_______,
|
||||
b____X__,
|
||||
b_____X_,
|
||||
@@ -1220,7 +1220,7 @@ CwLnx_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b_______,
|
||||
b_______ };
|
||||
*/
|
||||
static unsigned char checkbox_off[] =
|
||||
static unsigned char checkbox_off[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b__XXXXX,
|
||||
@@ -1229,7 +1229,7 @@ CwLnx_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
static unsigned char checkbox_on[] =
|
||||
static unsigned char checkbox_on[] =
|
||||
{ b____X__,
|
||||
b____X__,
|
||||
b__XXX_X,
|
||||
@@ -1238,7 +1238,7 @@ CwLnx_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
static unsigned char checkbox_gray[] =
|
||||
static unsigned char checkbox_gray[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b__XXXXX,
|
||||
@@ -1248,7 +1248,7 @@ CwLnx_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
/*
|
||||
static unsigned char selector_left[] =
|
||||
static unsigned char selector_left[] =
|
||||
{ b___X___,
|
||||
b___XX__,
|
||||
b___XXX_,
|
||||
@@ -1257,7 +1257,7 @@ CwLnx_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b___XX__,
|
||||
b___X___,
|
||||
b_______ };
|
||||
static unsigned char selector_right[] =
|
||||
static unsigned char selector_right[] =
|
||||
{ b_____X_,
|
||||
b____XX_,
|
||||
b___XXX_,
|
||||
@@ -1266,7 +1266,7 @@ CwLnx_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b____XX_,
|
||||
b_____X_,
|
||||
b_______ };
|
||||
static unsigned char ellipsis[] =
|
||||
static unsigned char ellipsis[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b_______,
|
||||
@@ -1275,8 +1275,8 @@ CwLnx_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b_______,
|
||||
b__X_X_X,
|
||||
b_______ };
|
||||
*/
|
||||
static unsigned char block_filled[] =
|
||||
*/
|
||||
static unsigned char block_filled[] =
|
||||
{ b__XXXXX,
|
||||
b__XXXXX,
|
||||
b__XXXXX,
|
||||
|
||||
+15
-15
@@ -5,7 +5,7 @@
|
||||
|
||||
/* This is the LCDproc driver for EyeboxOne devices
|
||||
|
||||
This code is based on MtxOrb driver (William Ferrell and Scott Scriven)
|
||||
This code is based on MtxOrb driver (William Ferrell and Scott Scriven)
|
||||
|
||||
Copyright (C) 2006 Cedric TESSIER (aka NeZetiC) http://www.nezetic.info
|
||||
|
||||
@@ -413,7 +413,7 @@ EyeboxOne_close (Driver *drvthis)
|
||||
p->framebuf = NULL;
|
||||
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
drvthis->store_private_ptr(drvthis, NULL);
|
||||
debug(RPT_DEBUG, "EyeBO: closed");
|
||||
}
|
||||
@@ -450,15 +450,15 @@ EyeboxOne_string (Driver *drvthis, int x, int y, const char string[])
|
||||
int bar,level;
|
||||
|
||||
PrivateData * p = drvthis->private_data;
|
||||
/*
|
||||
* /xBab = Use Bar
|
||||
* a = Bar ID
|
||||
* b = Level
|
||||
/*
|
||||
* /xBab = Use Bar
|
||||
* a = Bar ID
|
||||
* b = Level
|
||||
*/
|
||||
if(strncmp(string,"/xB",3) == 0){
|
||||
bar = (int) (string[3] - 48);
|
||||
bar = (int) (string[3] - 48);
|
||||
level = (int) (string[4] - 48);
|
||||
if(level == 1)
|
||||
if(level == 1)
|
||||
if(strlen(string) > 5)
|
||||
if(((int) (string[5] - 48)) == 0)
|
||||
level = 10;
|
||||
@@ -470,7 +470,7 @@ EyeboxOne_string (Driver *drvthis, int x, int y, const char string[])
|
||||
ValidX(x);
|
||||
ValidY(y);
|
||||
|
||||
x--; y--;
|
||||
x--; y--;
|
||||
offset = (y * p->width) + x;
|
||||
siz = (p->widthBYheight) - offset;
|
||||
siz = (siz > strlen(string)) ? strlen(string) : siz;
|
||||
@@ -541,7 +541,7 @@ EyeboxOne_chr (Driver *drvthis, int x, int y, char c)
|
||||
ValidX(x);
|
||||
ValidY(y);
|
||||
|
||||
y--; x--;
|
||||
y--; x--;
|
||||
offset = (y * p->width) + x;
|
||||
p->framebuf[offset] = c;
|
||||
|
||||
@@ -549,7 +549,7 @@ EyeboxOne_chr (Driver *drvthis, int x, int y, char c)
|
||||
}
|
||||
|
||||
/******************************
|
||||
* Sets the backlight on or off
|
||||
* Sets the backlight on or off
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
EyeboxOne_backlight (Driver *drvthis, int on)
|
||||
@@ -585,7 +585,7 @@ EyeboxOne_backlight (Driver *drvthis, int on)
|
||||
}
|
||||
}
|
||||
|
||||
/**********************
|
||||
/**********************
|
||||
* Toggle cursor on/off
|
||||
*/
|
||||
static void
|
||||
@@ -624,10 +624,10 @@ EyeboxOne_get_key (Driver *drvthis)
|
||||
|
||||
(void) read(p->fd, &in, 1);
|
||||
report(RPT_DEBUG, "%s: get_key: key 0x%02X", drvthis->name, in);
|
||||
/* There is a lot of undesirable chars which appear
|
||||
/* There is a lot of undesirable chars which appear
|
||||
* when a key is pressed
|
||||
* */
|
||||
if (in == '\0' || (int) in == 19 || (int) in == 91 || (int) in == 79 || (int) in == 27)
|
||||
if (in == '\0' || (int) in == 19 || (int) in == 91 || (int) in == 79 || (int) in == 27)
|
||||
return NULL;
|
||||
|
||||
if (!p->keypad_test_mode) {
|
||||
@@ -640,7 +640,7 @@ EyeboxOne_get_key (Driver *drvthis)
|
||||
else if (in == p->down_key)
|
||||
return "Down";
|
||||
else if (in == p->enter_key)
|
||||
return "Enter";
|
||||
return "Enter";
|
||||
else if (in == p->escape_key)
|
||||
return "Escape";
|
||||
else {
|
||||
|
||||
+31
-31
@@ -7,7 +7,7 @@
|
||||
|
||||
based on GPL'ed code:
|
||||
|
||||
* IOWarrior LCD routines
|
||||
* IOWarrior LCD routines
|
||||
Copyright (c) 2004 Christian Vogelgsang <chris@lallafa.de>
|
||||
|
||||
* misc. files from LCDproc source tree
|
||||
@@ -82,7 +82,7 @@ static int iowlcd_enable(PrivateData *p)
|
||||
{
|
||||
unsigned char lcd_cmd[64] = { 0x04, 0x01, 0, 0, 0, 0, 0, 0 };
|
||||
int res = iow_lcd_wcmd(p->udh, IOWLCD_SIZE, lcd_cmd);
|
||||
|
||||
|
||||
usleep(30000); /* wait for 30ms */
|
||||
return res;
|
||||
}
|
||||
@@ -92,7 +92,7 @@ static int iowlcd_disable(PrivateData *p)
|
||||
{
|
||||
unsigned char lcd_cmd[64] = { 0x04, 0x00, 0, 0, 0, 0, 0, 0 };
|
||||
int res = iow_lcd_wcmd(p->udh, IOWLCD_SIZE, lcd_cmd);
|
||||
|
||||
|
||||
usleep(30000);
|
||||
return res;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ static int iowlcd_display_clear(PrivateData *p)
|
||||
{
|
||||
unsigned char lcd_cmd[64] = { 0x05, 1, 0x01, 0, 0, 0, 0, 0 };
|
||||
int res = iow_lcd_wcmd(p->udh, IOWLCD_SIZE, lcd_cmd);
|
||||
|
||||
|
||||
usleep(3000); /* 3ms */
|
||||
return res;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ static int iowlcd_display_clear(PrivateData *p)
|
||||
static int iowlcd_display_on_off(PrivateData *p, int display, int cursor, int blink)
|
||||
{
|
||||
unsigned char lcd_cmd[64] = { 0x05, 1, 0x08, 0, 0, 0, 0, 0 };
|
||||
|
||||
|
||||
if (display) lcd_cmd[2] |= 0x04;
|
||||
if (cursor) lcd_cmd[2] |= 0x02;
|
||||
if (blink) lcd_cmd[2] |= 0x01;
|
||||
@@ -120,7 +120,7 @@ static int iowlcd_display_on_off(PrivateData *p, int display, int cursor, int bl
|
||||
static int iowlcd_set_function(PrivateData *p, int eight_bit, int two_line, int ten_dots)
|
||||
{
|
||||
unsigned char lcd_cmd[64] = { 0x05, 1, 0x20, 0, 0, 0, 0, 0 };
|
||||
|
||||
|
||||
if (eight_bit) lcd_cmd[2] |= 0x10;
|
||||
if (two_line) lcd_cmd[2] |= 0x08;
|
||||
if (ten_dots) lcd_cmd[2] |= 0x04;
|
||||
@@ -130,7 +130,7 @@ static int iowlcd_set_function(PrivateData *p, int eight_bit, int two_line, int
|
||||
static int iowlcd_set_cgram_addr(PrivateData *p, int addr)
|
||||
{
|
||||
unsigned char lcd_cmd[64] = { 0x05, 1, 0x40, 0, 0, 0, 0, 0 };
|
||||
|
||||
|
||||
lcd_cmd[2] |= (addr & 0x3f);
|
||||
return iow_lcd_wcmd(p->udh, IOWLCD_SIZE, lcd_cmd);
|
||||
}
|
||||
@@ -219,7 +219,7 @@ static int iowled_on_off(PrivateData *p, unsigned int pattern)
|
||||
for (i = 0; i < (p->productID == iowProd40) ? 4 : 2; i++) {
|
||||
led_cmd[i] = (unsigned char) (0xFF & pattern);
|
||||
pattern >>= 8;
|
||||
}
|
||||
}
|
||||
|
||||
return iow_led_wcmd(p->udh, (p->productID == iowProd40) ? 4 : 2, led_cmd);
|
||||
}
|
||||
@@ -390,7 +390,7 @@ IOWarrior_init(Driver *drvthis)
|
||||
#if defined(LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP)
|
||||
report(RPT_WARNING, "%s: interface may be claimed by kernel driver, attempting to detach it",
|
||||
drvthis->name);
|
||||
|
||||
|
||||
errno = 0;
|
||||
if ((usb_detach_kernel_driver_np(p->udh, 1) < 0) ||
|
||||
(usb_claim_interface(p->udh, 1) < 0)) {
|
||||
@@ -485,7 +485,7 @@ IOWarrior_close(Driver *drvthis)
|
||||
p->backingstore = NULL;
|
||||
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
drvthis->store_private_ptr(drvthis, NULL);
|
||||
|
||||
debug(RPT_DEBUG, "%s: closed", drvthis->name);
|
||||
@@ -497,7 +497,7 @@ IOWarrior_close(Driver *drvthis)
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \return Number of characters the display is wide.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
IOWarrior_width(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -513,7 +513,7 @@ IOWarrior_width(Driver *drvthis)
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \return Number of characters the display is high.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
IOWarrior_height(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -529,7 +529,7 @@ IOWarrior_height(Driver *drvthis)
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \return Number of pixel columns a character cell is wide.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
IOWarrior_cellwidth(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -545,7 +545,7 @@ IOWarrior_cellwidth(Driver *drvthis)
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \return Number of pixel lines a character cell is high.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
IOWarrior_cellheight(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -835,7 +835,7 @@ PrivateData *p = drvthis->private_data;
|
||||
default:
|
||||
iowlcd_display_on_off(p, 1, 1, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -879,7 +879,7 @@ IOWarrior_set_char(Driver *drvthis, int n, unsigned char *dat)
|
||||
int letter = 0;
|
||||
|
||||
if (p->lastline || (row < p->cellheight - 1))
|
||||
letter = dat[row] & mask;
|
||||
letter = dat[row] & mask;
|
||||
|
||||
if (p->cc[n].cache[row] != letter)
|
||||
p->cc[n].clean = 0; /* only mark dirty if really different */
|
||||
@@ -897,10 +897,10 @@ IOWarrior_set_char(Driver *drvthis, int n, unsigned char *dat)
|
||||
* \retval 0 Icon has been successfully defined/written.
|
||||
* \retval <0 Server core shall define/write the icon.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
IOWarrior_icon(Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
static unsigned char heart_open[] =
|
||||
static unsigned char heart_open[] =
|
||||
{ b__XXXXX,
|
||||
b__X_X_X,
|
||||
b_______,
|
||||
@@ -909,7 +909,7 @@ static unsigned char heart_open[] =
|
||||
b__X___X,
|
||||
b__XX_XX,
|
||||
b__XXXXX };
|
||||
static unsigned char heart_filled[] =
|
||||
static unsigned char heart_filled[] =
|
||||
{ b__XXXXX,
|
||||
b__X_X_X,
|
||||
b___X_X_,
|
||||
@@ -918,7 +918,7 @@ static unsigned char heart_filled[] =
|
||||
b__X_X_X,
|
||||
b__XX_XX,
|
||||
b__XXXXX };
|
||||
static unsigned char arrow_up[] =
|
||||
static unsigned char arrow_up[] =
|
||||
{ b____X__,
|
||||
b___XXX_,
|
||||
b__X_X_X,
|
||||
@@ -927,7 +927,7 @@ static unsigned char arrow_up[] =
|
||||
b____X__,
|
||||
b____X__,
|
||||
b_______ };
|
||||
static unsigned char arrow_down[] =
|
||||
static unsigned char arrow_down[] =
|
||||
{ b____X__,
|
||||
b____X__,
|
||||
b____X__,
|
||||
@@ -937,7 +937,7 @@ static unsigned char arrow_down[] =
|
||||
b____X__,
|
||||
b_______ };
|
||||
/*
|
||||
static unsigned char arrow_left[] =
|
||||
static unsigned char arrow_left[] =
|
||||
{ b_______,
|
||||
b____X__,
|
||||
b___X___,
|
||||
@@ -946,7 +946,7 @@ static unsigned char arrow_left[] =
|
||||
b____X__,
|
||||
b_______,
|
||||
b_______ };
|
||||
static unsigned char arrow_right[] =
|
||||
static unsigned char arrow_right[] =
|
||||
{ b_______,
|
||||
b____X__,
|
||||
b_____X_,
|
||||
@@ -956,7 +956,7 @@ static unsigned char arrow_right[] =
|
||||
b_______,
|
||||
b_______ };
|
||||
*/
|
||||
static unsigned char checkbox_off[] =
|
||||
static unsigned char checkbox_off[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b__XXXXX,
|
||||
@@ -965,7 +965,7 @@ static unsigned char checkbox_off[] =
|
||||
b__X___X,
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
static unsigned char checkbox_on[] =
|
||||
static unsigned char checkbox_on[] =
|
||||
{ b____X__,
|
||||
b____X__,
|
||||
b__XXX_X,
|
||||
@@ -974,7 +974,7 @@ static unsigned char checkbox_on[] =
|
||||
b__X___X,
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
static unsigned char checkbox_gray[] =
|
||||
static unsigned char checkbox_gray[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b__XXXXX,
|
||||
@@ -984,7 +984,7 @@ static unsigned char checkbox_gray[] =
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
/*
|
||||
static unsigned char selector_left[] =
|
||||
static unsigned char selector_left[] =
|
||||
{ b___X___,
|
||||
b___XX__,
|
||||
b___XXX_,
|
||||
@@ -993,7 +993,7 @@ static unsigned char selector_left[] =
|
||||
b___XX__,
|
||||
b___X___,
|
||||
b_______ };
|
||||
static unsigned char selector_right[] =
|
||||
static unsigned char selector_right[] =
|
||||
{ b_____X_,
|
||||
b____XX_,
|
||||
b___XXX_,
|
||||
@@ -1002,7 +1002,7 @@ static unsigned char selector_right[] =
|
||||
b____XX_,
|
||||
b_____X_,
|
||||
b_______ };
|
||||
static unsigned char ellipsis[] =
|
||||
static unsigned char ellipsis[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b_______,
|
||||
@@ -1011,8 +1011,8 @@ static unsigned char ellipsis[] =
|
||||
b_______,
|
||||
b__X_X_X,
|
||||
b_______ };
|
||||
*/
|
||||
static unsigned char block_filled[] =
|
||||
*/
|
||||
static unsigned char block_filled[] =
|
||||
{ b__XXXXX,
|
||||
b__XXXXX,
|
||||
b__XXXXX,
|
||||
|
||||
@@ -109,7 +109,7 @@ typedef struct IOWarrior_private_data {
|
||||
/* lastline controls the use of the last line, if pixel addressable (true, default) or */
|
||||
/* underline effect (false). To avoid the underline effect in the latter case, the last */
|
||||
/* line is always zeroed for whatever redefined character */
|
||||
char lastline;
|
||||
char lastline;
|
||||
|
||||
/* extended mode for some half-compatible modules */
|
||||
int ext_mode;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* LCDd \c MD8800 driver for the CFD used in Medion MD8800 PCs.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
Copyright (C) 2006 Stefan Herdler in collaboration with Martin Møller.
|
||||
|
||||
This source Code is based on the NoritakeVFD, the serialVFD and the
|
||||
@@ -42,9 +42,9 @@
|
||||
\33\5 - Show clock
|
||||
|
||||
\33\40 - 2-line mode, clearing at end of last line.
|
||||
\33\41 - Only write to line1, no clearing,
|
||||
\33\41 - Only write to line1, no clearing,
|
||||
automatic scroll to the left when display is full.
|
||||
\33\42 - Only write to line2, no clearing,
|
||||
\33\42 - Only write to line2, no clearing,
|
||||
automatic scroll to the left when display is full.
|
||||
|
||||
(d is in the range 0-4. Anything above 4 is full brightness, b = 0/1):
|
||||
@@ -248,7 +248,7 @@ MD8800_init (Driver *drvthis)
|
||||
p->hw_brightness = 6;
|
||||
|
||||
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));
|
||||
@@ -313,7 +313,7 @@ MD8800_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
|
||||
@@ -336,7 +336,7 @@ MD8800_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) {
|
||||
|
||||
@@ -28,7 +28,7 @@ IOWarrior_CFLAGS = @LIBUSB_CFLAGS@ $(AM_CFLAGS)
|
||||
hd44780_CFLAGS = @LIBUSB_CFLAGS@ @LIBFTDI_CFLAGS@ $(AM_CFLAGS)
|
||||
g15_CFLAGS = @LIBUSB_CFLAGS@ $(AM_CFLAGS)
|
||||
lis_CFLAGS = @LIBUSB_CFLAGS@ @LIBFTDI_CFLAGS@ $(AM_CFLAGS)
|
||||
picolcd_CFLAGS = @LIBUSB_CFLAGS@ $(AM_CFLAGS)
|
||||
picolcd_CFLAGS = @LIBUSB_CFLAGS@ $(AM_CFLAGS)
|
||||
shuttleVFD_CFLAGS = @LIBUSB_CFLAGS@ $(AM_CFLAGS)
|
||||
ula200_CFLAGS = @LIBFTDI_CFLAGS@ $(AM_CFLAGS)
|
||||
i2500vfd_CFLAGS = @LIBFTDI_CFLAGS@ $(AM_CFLAGS)
|
||||
@@ -70,7 +70,7 @@ xosd_LDADD = @LIBXOSD@ libbignum.a
|
||||
i2500vfd_LDADD = @LIBFTDI_LIBS@
|
||||
|
||||
libLCD_a_SOURCES = lcd_lib.h lcd_lib.c
|
||||
libbignum_a_SOURCES = adv_bignum.h adv_bignum.c
|
||||
libbignum_a_SOURCES = adv_bignum.h adv_bignum.c
|
||||
|
||||
bayrad_SOURCES = lcd.h lcd_lib.h bayrad.h bayrad.c report.h
|
||||
CFontz_SOURCES = lcd.h lcd_lib.h CFontz.c CFontz.h CFontz-charmap.h report.h adv_bignum.h
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* LCDd \c NoritakeVFD driver for the Noritake VFD Device CU20045SCPB-T28A.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
Copyright (C) 2005 Simon Funke
|
||||
Copyright (C) 2007 Richard Muratti ricacho@gmail.com
|
||||
Copyright (C) 2007 Peter Marschall
|
||||
@@ -11,14 +11,14 @@
|
||||
|
||||
2005-08-01 Version 0.1: mostly everything should work (vbar, hbar never tested)
|
||||
|
||||
2007-09-16 Version 0.2:
|
||||
2007-09-16 Version 0.2:
|
||||
- Fixed vbar & hbar - Allowed for displays with 2 custom characters
|
||||
- Fixed cursor off - 16H - Data sheet for CU20045SCPB has error -> Cursor Off 14,16,17H
|
||||
- Tested with CU40026SCPB-T20A - 40x2 - Hardware Defaults to 19200 8E1
|
||||
- Added new config parameter [Parity] to set serial data parity 0(none),1(odd),2(even)
|
||||
- Added config parameter OffBrightness
|
||||
- added support for big numbers
|
||||
|
||||
|
||||
CU40026SCPB-T20A SOFTWARE COMMANDS
|
||||
Back Space 08H International Font 18H
|
||||
Horizontal Tab 09H Katakana Font 19H
|
||||
@@ -30,7 +30,7 @@
|
||||
Vertical Scroll Mode 12H Flickerless Write +53H
|
||||
Underline Cursor On 14H Cursor Blink Speed +54H
|
||||
5x7 Block Cursor On 15H Character Data 20H+
|
||||
Cursor Off 16H User Character Data 00H+
|
||||
Cursor Off 16H User Character Data 00H+
|
||||
|
||||
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
|
||||
@@ -231,7 +231,7 @@ NoritakeVFD_init (Driver *drvthis)
|
||||
portset.c_lflag &= ~( ECHO | ECHONL | ICANON | ISIG | IEXTEN );
|
||||
portset.c_cflag &= ~( CSIZE | PARENB | CRTSCTS );
|
||||
portset.c_cflag |= CS8 | CREAD | CLOCAL | p->parity;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Set port speed
|
||||
cfsetospeed(&portset, p->speed);
|
||||
@@ -372,7 +372,7 @@ NoritakeVFD_flush (Driver *drvthis)
|
||||
|
||||
NoritakeVFD_cursor_goto(drvthis, 1, i+1);
|
||||
write(p->fd, p->framebuf+offset, p->width);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -474,7 +474,7 @@ NoritakeVFD_vbar (Driver *drvthis, int x, int y, int len, int promille, int opti
|
||||
|
||||
/* define half full block at position 1 */
|
||||
NoritakeVFD_set_char(drvthis, 1, half);
|
||||
}
|
||||
}
|
||||
|
||||
for (pos = 0; pos < len; pos++) {
|
||||
/* if pixels > 2/3 cellheight [in integer arithmetics] ... */
|
||||
@@ -532,7 +532,7 @@ NoritakeVFD_hbar (Driver *drvthis, int x, int y, int len, int promille, int opti
|
||||
|
||||
/* define half full block at position 1 */
|
||||
NoritakeVFD_set_char(drvthis, 1, half);
|
||||
}
|
||||
}
|
||||
|
||||
for (pos = 0; pos < len; pos++) {
|
||||
/* if pixels > 2/3 cellwidth [in integer arithmetics] ... */
|
||||
@@ -645,7 +645,7 @@ NoritakeVFD_icon (Driver *drvthis, int x, int y, int icon)
|
||||
* \param state New cursor state.
|
||||
*/
|
||||
/*
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
CFontzPacket_cursor (Driver *drvthis, int x, int y, int state)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
@@ -56,5 +56,5 @@ MODULE_EXPORT int NoritakeVFD_get_brightness(Driver *drvthis, int state);
|
||||
MODULE_EXPORT void NoritakeVFD_set_brightness(Driver *drvthis, int state, int promille);
|
||||
MODULE_EXPORT void NoritakeVFD_backlight (Driver *drvthis, int on);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
UNDERSTANDING LCDPROC DRIVERS
|
||||
|
||||
LCDproc drivers are compiled as modules that will be loaded by the
|
||||
LCDproc drivers are compiled as modules that will be loaded by the
|
||||
LCDd daemon's core on request.
|
||||
|
||||
To understand how to write a driver see docs/API-0.5.txt or the
|
||||
|
||||
@@ -11,17 +11,17 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009, Laurent Latil
|
||||
*
|
||||
*
|
||||
* 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 any later
|
||||
* version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*
|
||||
* 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., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||
|
||||
@@ -57,7 +57,7 @@ typedef struct bayrad_private_data {
|
||||
int cellheight;
|
||||
char *framebuf;
|
||||
char ccmode;
|
||||
} PrivateData;
|
||||
} PrivateData;
|
||||
|
||||
|
||||
// Vars for the server core
|
||||
@@ -189,7 +189,7 @@ bayrad_close(Driver *drvthis)
|
||||
if (p->fd >= 0) {
|
||||
write(p->fd, "\x8e\x00", 2); // Backlight OFF
|
||||
close(p->fd);
|
||||
}
|
||||
}
|
||||
|
||||
if (p->framebuf != NULL)
|
||||
free(p->framebuf);
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
/****************************************************************
|
||||
* Character elements
|
||||
*
|
||||
*
|
||||
* 0 = ·· 1 = ·· 2 = ·X 3 = X· S = ··
|
||||
* X· ·X ·· ·· ··
|
||||
*
|
||||
*
|
||||
* 4 = ·· 5 = XX 6 = X· 7 = XX F = XX
|
||||
* XX ·· XX X· XX
|
||||
*/
|
||||
@@ -671,7 +671,7 @@ int normal[96][3*4] = {
|
||||
4,F,4,
|
||||
S,7,S,
|
||||
S,S,S,
|
||||
}, //
|
||||
}, //
|
||||
{
|
||||
S,S,S,
|
||||
S,S,S,
|
||||
@@ -1180,7 +1180,7 @@ int normal[96][3*4] = {
|
||||
};
|
||||
|
||||
/* Here start the 8 basic block used above and named 0-7 */
|
||||
/*
|
||||
/*
|
||||
static unsigned bigfont[8][8] = {
|
||||
{ b_______, // char a[]
|
||||
b_______,
|
||||
@@ -1247,6 +1247,6 @@ int normal[96][3*4] = {
|
||||
b__XX___,
|
||||
b__X____ }
|
||||
};
|
||||
*/
|
||||
*/
|
||||
#endif
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ curses_clear (Driver *drvthis)
|
||||
|
||||
/**
|
||||
* Turn the LCD backlight on or off.
|
||||
* This is simulated by changing the background
|
||||
* This is simulated by changing the background
|
||||
* colour of the characters displayed.
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \param on New backlight status.
|
||||
@@ -461,7 +461,7 @@ MODULE_EXPORT void
|
||||
curses_vbar (Driver *drvthis, int x, int y, int len, int promille, int options)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
// map
|
||||
// map
|
||||
char ACS_map[] = { ACS_S9, ACS_S9, ACS_S7, ACS_S7, ACS_S3, ACS_S3, ACS_S1, ACS_S1 };
|
||||
char ascii_map[] = { ' ', ' ', '-', '-', '=', '=', '#', '#' };
|
||||
char *map = (p->useACS) ? ACS_map : ascii_map;
|
||||
|
||||
@@ -81,7 +81,7 @@ EA65_init (Driver *drvthis)
|
||||
PrivateData *p;
|
||||
|
||||
debug(RPT_INFO, "EA65: init(%p)", drvthis);
|
||||
|
||||
|
||||
p = (PrivateData *) malloc(sizeof(PrivateData));
|
||||
if (p == NULL)
|
||||
return -1;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#define G15_BIGNUM_LEN 1032
|
||||
|
||||
/*
|
||||
* This data should really be inverted so that 1=black
|
||||
/*
|
||||
* This data should really be inverted so that 1=black
|
||||
* but, for now, make sure to set canvas->mode_reverse
|
||||
* before drawing one of these overlays.
|
||||
*/
|
||||
|
||||
|
||||
short g15_bignum_data[11][G15_BIGNUM_LEN] = {
|
||||
{ /* 0 */
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
|
||||
+33
-33
@@ -2,7 +2,7 @@
|
||||
* LCDd \c g15 driver for the LCD on the Logitech G15 keyboard.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
Copyright (C) 2006 Anthony J. Mirabella.
|
||||
|
||||
2006-07-23 Version 1.0: Most functions should be implemented and working
|
||||
@@ -80,28 +80,28 @@ MODULE_EXPORT int g15_init (Driver *drvthis)
|
||||
report(RPT_ERR, "%s: Sorry, cant connect to the G15daemon", drvthis->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/* make sure the canvas is there... */
|
||||
p->canvas = (g15canvas *) malloc(sizeof(g15canvas));
|
||||
if (p->canvas == NULL) {
|
||||
report(RPT_ERR, "%s: unable to create canvas", drvthis->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/* make sure the backingstore is there... */
|
||||
p->backingstore = (g15canvas *) malloc(sizeof(g15canvas));
|
||||
if (p->backingstore == NULL) {
|
||||
report(RPT_ERR, "%s: unable to create framebuffer backing store", drvthis->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
g15r_initCanvas(p->canvas);
|
||||
g15r_initCanvas(p->backingstore);
|
||||
p->canvas->buffer[0] = G15_LCD_WRITE_CMD;
|
||||
p->backingstore->buffer[0] = G15_LCD_WRITE_CMD;
|
||||
|
||||
|
||||
// ret = setLCDBrightness(G15_BRIGHTNESS_BRIGHT);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -110,13 +110,13 @@ MODULE_EXPORT int g15_init (Driver *drvthis)
|
||||
MODULE_EXPORT void g15_close (Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
|
||||
g15_close_screen(p->g15screen_fd);
|
||||
|
||||
|
||||
if (p != NULL) {
|
||||
if (p->canvas)
|
||||
free(p->canvas);
|
||||
|
||||
|
||||
if (p->backingstore)
|
||||
free(p->backingstore);
|
||||
|
||||
@@ -190,12 +190,12 @@ MODULE_EXPORT void g15_flush (Driver *drvthis)
|
||||
MODULE_EXPORT void g15_chr (Driver *drvthis, int x, int y, char c)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
|
||||
y--;
|
||||
x--;
|
||||
if ((x > p->width) || (y > p->height))
|
||||
return;
|
||||
|
||||
|
||||
g15r_renderCharacterLarge(p->canvas, x, y, c, 0, 0);
|
||||
}
|
||||
|
||||
@@ -222,10 +222,10 @@ MODULE_EXPORT void g15_string (Driver *drvthis, int x, int y, const char string[
|
||||
MODULE_EXPORT int g15_icon (Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
|
||||
x--;
|
||||
y--;
|
||||
|
||||
|
||||
switch (icon) {
|
||||
case ICON_BLOCK_FILLED:
|
||||
{
|
||||
@@ -331,25 +331,25 @@ MODULE_EXPORT int g15_icon (Driver *drvthis, int x, int y, int icon)
|
||||
default:
|
||||
return -1; /* Let the core do other icons */
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Draws a horizontal bar growing to the right
|
||||
//
|
||||
//
|
||||
MODULE_EXPORT void g15_hbar(Driver *drvthis, int x, int y, int len, int promille, int options)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
|
||||
x--;
|
||||
y--;
|
||||
|
||||
|
||||
int total_pixels = ((long) 2 * len * p->cellwidth + 1) * promille / 2000;
|
||||
int px1 = x * p->cellwidth;
|
||||
int py1 = y * p->cellheight;
|
||||
int px2 = px1 + total_pixels;
|
||||
int py2 = py1 + (p->cellheight - 2);
|
||||
|
||||
|
||||
g15r_pixelBox(p->canvas, px1, py1, px2, py2, G15_COLOR_BLACK, 1, G15_PIXEL_FILL);
|
||||
}
|
||||
|
||||
@@ -358,17 +358,17 @@ MODULE_EXPORT void g15_hbar(Driver *drvthis, int x, int y, int len, int promille
|
||||
MODULE_EXPORT void g15_vbar(Driver *drvthis, int x, int y, int len, int promille, int options)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
|
||||
x--;
|
||||
|
||||
|
||||
int total_pixels = ((long) 2 * len * p->cellwidth + 1) * promille / 2000;
|
||||
int px1 = x * p->cellwidth;
|
||||
int py1 = y * p->cellheight - total_pixels;
|
||||
int px2 = px1 + (p->cellwidth - 2);
|
||||
int py2 = py1 + total_pixels;
|
||||
|
||||
|
||||
g15r_pixelBox(p->canvas, px1, py1, px2, py2, G15_COLOR_BLACK, 1, G15_PIXEL_FILL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Return one char from the Keyboard
|
||||
@@ -387,7 +387,7 @@ MODULE_EXPORT const char * g15_get_key (Driver *drvthis)
|
||||
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(p->g15screen_fd, &fds);
|
||||
|
||||
|
||||
toread = select(FD_SETSIZE, &fds, NULL, NULL, &tv);
|
||||
}
|
||||
else
|
||||
@@ -399,7 +399,7 @@ MODULE_EXPORT const char * g15_get_key (Driver *drvthis)
|
||||
}
|
||||
toread = 1;
|
||||
}
|
||||
|
||||
|
||||
if (toread >= 1)
|
||||
read(p->g15screen_fd, &key_state, sizeof(key_state));
|
||||
else
|
||||
@@ -426,14 +426,14 @@ MODULE_EXPORT const char * g15_get_key (Driver *drvthis)
|
||||
MODULE_EXPORT void g15_backlight(Driver *drvthis, int on)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
|
||||
if (p->backlight_state == on)
|
||||
return;
|
||||
|
||||
p->backlight_state = on;
|
||||
|
||||
char msgbuf[256];
|
||||
|
||||
|
||||
switch (on) {
|
||||
case BACKLIGHT_ON:
|
||||
{
|
||||
@@ -447,7 +447,7 @@ MODULE_EXPORT void g15_backlight(Driver *drvthis, int on)
|
||||
send(p->g15screen_fd,msgbuf,1,MSG_OOB);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -457,23 +457,23 @@ MODULE_EXPORT void g15_backlight(Driver *drvthis, int on)
|
||||
MODULE_EXPORT void g15_num(Driver *drvthis, int x, int num)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
|
||||
x--;
|
||||
int ox = x * p->cellwidth;
|
||||
|
||||
|
||||
if ((num < 0) || (num > 10))
|
||||
return;
|
||||
|
||||
|
||||
int width = 0;
|
||||
int height = 43;
|
||||
|
||||
|
||||
if ((num >= 0) && (num <=9))
|
||||
width = 24;
|
||||
else
|
||||
width = 9;
|
||||
|
||||
|
||||
int i=0;
|
||||
|
||||
|
||||
for (i=0;i<(width*height);++i)
|
||||
{
|
||||
int color = (g15_bignum_data[num][i] ? G15_COLOR_WHITE : G15_COLOR_BLACK);
|
||||
|
||||
@@ -104,7 +104,7 @@ MODULE_EXPORT int glcdlib_init (Driver *drvthis)
|
||||
|| (nCfgTextRows <= 0) || (nCfgTextRows > LCD_MAX_HEIGHT))
|
||||
{
|
||||
report(RPT_WARNING,
|
||||
"%s: cannot read or invalid TextResolution: %s; using default %s",
|
||||
"%s: cannot read or invalid TextResolution: %s; using default %s",
|
||||
drvthis->name, strTextRes, strTextResDefault);
|
||||
sscanf(strTextResDefault, "%dx%d", &nCfgTextWidth, &nCfgTextRows);
|
||||
}
|
||||
@@ -144,7 +144,7 @@ MODULE_EXPORT int glcdlib_init (Driver *drvthis)
|
||||
"%s: cannot read or invalid MinFontFaceSize: %s; using default %s",
|
||||
drvthis->name, strMinFontFaceSize, strMinFaceSizeDef);
|
||||
sscanf(strMinFaceSizeDef, "%dx%d", &nCfgMinFontFaceWidth, &nCfgMinFontFaceHeight);
|
||||
}
|
||||
}
|
||||
|
||||
// show debugging frame?
|
||||
bool bShowDbgFrame = drvthis->config_get_bool(drvthis->name, "ShowDebugFrame", 0, true);
|
||||
@@ -212,7 +212,7 @@ glcdlib_close (Driver *drvthis)
|
||||
pPD->glcdDriver = NULL;
|
||||
|
||||
free(pPD);
|
||||
}
|
||||
}
|
||||
drvthis->store_private_ptr(drvthis, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -266,11 +266,11 @@ glk_close(Driver *drvthis)
|
||||
|
||||
if (p->framebuf != NULL)
|
||||
free(p->framebuf);
|
||||
p->framebuf = NULL;
|
||||
p->framebuf = NULL;
|
||||
|
||||
if (p->backingstore != NULL)
|
||||
free(p->backingstore);
|
||||
p->backingstore = NULL;
|
||||
p->backingstore = NULL;
|
||||
|
||||
free(p);
|
||||
}
|
||||
@@ -613,7 +613,7 @@ glk_num(Driver *drvthis, int x, int num)
|
||||
|
||||
if ((x > 0) && (x <= p->width))
|
||||
p->framebuf[x-1] = (num >= 10) ? ':' : (num + '0');
|
||||
*/
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ hd_init_bwct_usb(Driver *drvthis)
|
||||
#if defined(LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP)
|
||||
report(RPT_WARNING, "hd_init_bwct_usb: interface may be claimed by "
|
||||
"kernel driver, attempting to detach it");
|
||||
|
||||
|
||||
errno = 0;
|
||||
if ((usb_detach_kernel_driver_np(p->usbHandle, p->usbIndex) < 0) ||
|
||||
(usb_claim_interface(p->usbHandle, p->usbIndex) < 0)) {
|
||||
|
||||
@@ -120,7 +120,7 @@ const unsigned char HD44780_charmap[] = {
|
||||
/*
|
||||
* Table for HD44780 controller with ROM mask supporting
|
||||
* the european charset (ROM code A02).
|
||||
*
|
||||
*
|
||||
* Replacements:
|
||||
* 160 => 32, 168 => 34, 180 => 39, 184 => 44
|
||||
*/
|
||||
@@ -165,7 +165,7 @@ const unsigned char HD44780_euro_charmap[] = {
|
||||
232, 233, 234, 235, 236, 237, 238, 239,
|
||||
240, 241, 242, 243, 244, 245, 246, 247,
|
||||
248, 249, 250, 251, 252, 253, 254, 255
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
@@ -283,7 +283,7 @@ const unsigned char SED1278F_0B_charmap[] = {
|
||||
/*
|
||||
* Table for HD44780 controller with ROM mask supporting
|
||||
* the european charset (ROM code A02).
|
||||
*
|
||||
*
|
||||
* Russian KOI8-R codepage as input, comments in KOI8-R.
|
||||
*/
|
||||
const unsigned char HD44780_KOI8R_charmap[] = {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "hd44780-low.h"
|
||||
#include "shared/sockets.h"
|
||||
#include "report.h"
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* connected to a FT2232C/D chip in 8 bit mode.
|
||||
*
|
||||
* Copyright (c) 2007, Intra2net AG <opensource@intra2net.com>
|
||||
*
|
||||
*
|
||||
* Modified February 2008 by Ismail Ibrahim <whirleyes@gmail.com> to
|
||||
* add support for single channel FTDI chip with 4 bit wiring mode.
|
||||
*
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
* Configuration:
|
||||
* device=/dev/i2c-0 # the device file of the i2c bus
|
||||
* port=0x20 # the i2c address of the i2c port expander
|
||||
*
|
||||
*
|
||||
* Attention: Bit 8 of the address given in port is special:
|
||||
* It tells the driver to treat the device as PCA9554 or similar,
|
||||
* a device that needs a 2-byte command, and it will be stripped
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/*-
|
||||
* Copyright (C) 2007 Peter Marschall <peter@adpm.de>
|
||||
* 2007,2009 Markus Dolze
|
||||
*
|
||||
*
|
||||
* This file is released under the GNU General Public License. Refer to the
|
||||
* COPYING file distributed with this package.
|
||||
*/
|
||||
@@ -91,7 +91,7 @@ hd_init_lcd2usb(Driver *drvthis)
|
||||
if ((dev->descriptor.idVendor == LCD2USB_VENDORID) &&
|
||||
(dev->descriptor.idProduct == LCD2USB_PRODUCTID)) {
|
||||
|
||||
/*
|
||||
/*
|
||||
* LCD2USB device found; try to find its
|
||||
* description
|
||||
*/
|
||||
|
||||
@@ -226,7 +226,7 @@ static unsigned char rowNum = 0;
|
||||
// extract character to set from given info
|
||||
charNum = (ch & ~SETCHAR) / 8;
|
||||
|
||||
// offset it by one to avoid collisions with command prefix
|
||||
// offset it by one to avoid collisions with command prefix
|
||||
// TODO: check if this is correct
|
||||
charNum++;
|
||||
|
||||
@@ -234,7 +234,7 @@ static unsigned char rowNum = 0;
|
||||
// TODO: check if this is correct
|
||||
if (charNum == 8)
|
||||
charNum = 7;
|
||||
}
|
||||
}
|
||||
// MPlay devices don't need the char num;
|
||||
// they always set all custom characters
|
||||
|
||||
@@ -280,7 +280,7 @@ static void gotoXY(int fd, unsigned char x, unsigned char y)
|
||||
/**
|
||||
* Set a custom character, valid on MPlay devices only.
|
||||
* \param fd File handle to write to.
|
||||
* \param chars Pixel definition of all custom chars.
|
||||
* \param chars Pixel definition of all custom chars.
|
||||
*/
|
||||
static void setMPlayCustomChars(int fd, CGram *chars)
|
||||
{
|
||||
|
||||
@@ -104,9 +104,9 @@ typedef struct hd44780_private_data {
|
||||
|
||||
// serial connection types
|
||||
int fd; /* file handle to serial device */
|
||||
int serial_type;
|
||||
int serial_type;
|
||||
|
||||
#if defined(HAVE_LIBUSB)
|
||||
#if defined(HAVE_LIBUSB)
|
||||
// USB connection types
|
||||
usb_dev_handle *usbHandle; /* USB device handle */
|
||||
int usbIndex; /* USB interface index */
|
||||
@@ -168,7 +168,7 @@ typedef struct hd44780_private_data {
|
||||
// its bus to LPT port
|
||||
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
|
||||
// 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).
|
||||
@@ -193,7 +193,7 @@ typedef struct hd44780_private_data {
|
||||
int keepalivedisplay; // When >0 refresh upper left char every <keepalivedisplay> seconds to keep display alive
|
||||
|
||||
int output_state; // what was most recently output to the output port
|
||||
|
||||
|
||||
int contrast; // Contrast setting (range 0 - 1000)
|
||||
int brightness; // Brightness when backlight is "on" (range 0 - 1000)
|
||||
int offbrightness; // Brightness when backlight is "off" (range 0 - 1000)
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002 Adams IT Services <info@usblcd.de>
|
||||
*
|
||||
*
|
||||
* This driver is based on pic-an-lcd driver. See file hd44780-serial.c for
|
||||
* additional Copyrights.
|
||||
*
|
||||
*
|
||||
* This file is released under the GNU General Public License. Refer to the
|
||||
* COPYING file distributed with this package.
|
||||
*
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
*
|
||||
* This is a uss720 driver module for Hitachi HD44780 based LCD displays
|
||||
* connected to a uss720 USB-to-IEEE 1284 Bridge chip in 8 bit mode.
|
||||
* The uss720 chip is found in many (but not all)
|
||||
* The uss720 chip is found in many (but not all)
|
||||
* Belkin F5U002 USB->parallel printer adapters.
|
||||
*
|
||||
* Applicable Data Sheets:
|
||||
* - http://digilander.libero.it/demarchidaniele/qcamvc/uss-720.pdf
|
||||
*
|
||||
*
|
||||
* Wiring is same as winamp connection.
|
||||
* Uncomment //#define USS720_MAC_USB_LCD_KIT_WIRING 1 below to use a
|
||||
* Mac USB LCD Kit instead.
|
||||
* Uncomment //#define USS720_MAC_USB_LCD_KIT_WIRING 1 below to use a
|
||||
* Mac USB LCD Kit instead.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -133,41 +133,41 @@ hd_init_uss720(Driver *drvthis)
|
||||
/* load config */
|
||||
vendor_id = drvthis->config_get_int(drvthis->name, "VendorID", 0, 0x1293);
|
||||
product_id = drvthis->config_get_int(drvthis->name, "ProductID", 0, 0x0002);
|
||||
|
||||
|
||||
/* Hardware Init */
|
||||
|
||||
|
||||
/* try to find USB device */
|
||||
usb_init();
|
||||
usb_find_busses();
|
||||
usb_find_devices();
|
||||
|
||||
|
||||
p->usbHandle = NULL;
|
||||
p->usbIndex = 0;
|
||||
for (bus = usb_get_busses(); bus != NULL; bus = bus->next) {
|
||||
struct usb_device *dev;
|
||||
|
||||
|
||||
for (dev = bus->devices; dev != NULL; dev = dev->next) {
|
||||
|
||||
|
||||
/* Check if this device is a uss720 device */
|
||||
if (dev->descriptor.idVendor != vendor_id || dev->descriptor.idProduct != product_id) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* uss720 device found; try to open it */
|
||||
p->usbHandle = usb_open(dev);
|
||||
if (p->usbHandle == NULL) {
|
||||
report(RPT_WARNING, "hd_init_uss720: unable to open device");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
debug(RPT_DEBUG, "hd_init_uss720: opening device succeeded");
|
||||
|
||||
|
||||
errno = 0;
|
||||
if (usb_claim_interface(p->usbHandle, p->usbIndex) < 0) {
|
||||
#if defined(LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP)
|
||||
report(RPT_WARNING, "hd_init_uss720: interface may be claimed by "
|
||||
"kernel driver, attempting to detach it");
|
||||
|
||||
|
||||
errno = 0;
|
||||
if ((usb_detach_kernel_driver_np(p->usbHandle, p->usbIndex) < 0) ||
|
||||
(usb_claim_interface(p->usbHandle, p->usbIndex) < 0)) {
|
||||
@@ -184,7 +184,7 @@ hd_init_uss720(Driver *drvthis)
|
||||
#endif
|
||||
}
|
||||
/* Use the alternate, vendor-specific, interface so we have access to the registers */
|
||||
|
||||
|
||||
errno = usb_set_altinterface(p->usbHandle, 2);
|
||||
if (errno) {
|
||||
report(RPT_WARNING, "hd_init_uss720: unable to set alt interface: %s", strerror(errno));
|
||||
@@ -200,7 +200,7 @@ hd_init_uss720(Driver *drvthis)
|
||||
|
||||
/* init the HD44780 LCD */
|
||||
common_init(p, IF_8BIT);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -225,17 +225,17 @@ uss720_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char f
|
||||
portControl = RS; /* enable RS for data */
|
||||
else
|
||||
portControl = 0; /* disable RS for instruction */
|
||||
|
||||
|
||||
portControl |= VCC; /* keep the power on */
|
||||
portControl |= p->backlight_bit;
|
||||
|
||||
if (displayID == 0)
|
||||
enableLines = EnMask[0]
|
||||
enableLines = EnMask[0]
|
||||
| ((p->have_backlight) ? 0 : EnMask[1])
|
||||
| ((p->numDisplays == 3) ? EnMask[2] : 0);
|
||||
else
|
||||
enableLines = EnMask[displayID - 1];
|
||||
|
||||
|
||||
uss720_set_1284_register(p->usbHandle, ControlRegAdr, portControl ^ OUTMASK);
|
||||
|
||||
uss720_set_1284_register(p->usbHandle, DataRegAdr, ch);
|
||||
@@ -243,7 +243,7 @@ uss720_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char f
|
||||
|
||||
uss720_set_1284_register(p->usbHandle, ControlRegAdr, (portControl | enableLines ) ^ OUTMASK);
|
||||
p->hd44780_functions->uPause(p, 1);
|
||||
|
||||
|
||||
uss720_set_1284_register(p->usbHandle, ControlRegAdr, portControl ^ OUTMASK);
|
||||
}
|
||||
|
||||
@@ -303,13 +303,13 @@ uss720_get_1284_register(usb_dev_handle *usbHandle, unsigned int regIndex, unsig
|
||||
/* Data */ (char *)regData,
|
||||
/* wLength */ 7,
|
||||
10000 );
|
||||
|
||||
|
||||
if (res) {
|
||||
|
||||
|
||||
} else if (value && (regIndex < 8)) {
|
||||
*value = regData[(int)regIndex];
|
||||
}
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ uss720_set_1284_register(usb_dev_handle *usbHandle, unsigned int regAddress, uns
|
||||
#pragma mark -Extended Methods
|
||||
|
||||
int
|
||||
uss720_set_1284_mode(usb_dev_handle *usbHandle, unsigned int mode)
|
||||
uss720_set_1284_mode(usb_dev_handle *usbHandle, unsigned int mode)
|
||||
{
|
||||
unsigned char regByte = 0x00;
|
||||
int res = 0;
|
||||
@@ -340,15 +340,15 @@ uss720_set_1284_mode(usb_dev_handle *usbHandle, unsigned int mode)
|
||||
res = uss720_get_1284_register(usbHandle, 3, ®Byte);
|
||||
|
||||
regByte &= ~0x01;
|
||||
|
||||
|
||||
res = uss720_set_1284_register(usbHandle, 7, regByte);
|
||||
if (res) return res;
|
||||
|
||||
|
||||
res = uss720_get_1284_register(usbHandle, 2, ®Byte);
|
||||
|
||||
regByte &= ~(mode<<5); /* Mask off the mode bits 7-5. */
|
||||
|
||||
regByte &= ~(mode<<5); /* Mask off the mode bits 7-5. */
|
||||
regByte |= (mode<<5); /* Set the mode bits 7-5. */
|
||||
|
||||
|
||||
return uss720_set_1284_register(usbHandle, 6, regByte);
|
||||
}
|
||||
|
||||
|
||||
+23
-23
@@ -67,7 +67,7 @@
|
||||
#define KEYPAD_AUTOREPEAT_DELAY 500
|
||||
#define KEYPAD_AUTOREPEAT_FREQ 15
|
||||
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
@@ -276,7 +276,7 @@ HD44780_init(Driver *drvthis)
|
||||
if (timing_init() == -1) {
|
||||
report(RPT_ERR, "%s: timing_init() failed (%s)", drvthis->name, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined DELAY_NANOSLEEP
|
||||
// Change to Round-Robin scheduling for nanosleep
|
||||
@@ -399,7 +399,7 @@ HD44780_init(Driver *drvthis)
|
||||
report(RPT_ERR, "%s: incomplete functions for connection type",
|
||||
drvthis->name);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// set scankeypad function if local readkeypad function is defined
|
||||
if ((p->hd44780_functions->readkeypad != NULL) &&
|
||||
@@ -538,7 +538,7 @@ HD44780_close(Driver *drvthis)
|
||||
free(p->backingstore);
|
||||
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
drvthis->store_private_ptr(drvthis, NULL);
|
||||
}
|
||||
|
||||
@@ -710,7 +710,7 @@ HD44780_flush(Driver *drvthis)
|
||||
}
|
||||
}
|
||||
if (p->hd44780_functions->flush != NULL)
|
||||
p->hd44780_functions->flush(p);
|
||||
p->hd44780_functions->flush(p);
|
||||
debug(RPT_DEBUG, "%s: flushed %d custom chars", drvthis->name, count);
|
||||
}
|
||||
|
||||
@@ -879,7 +879,7 @@ HD44780_backlight(Driver *drvthis, int on)
|
||||
|
||||
if (p->hd44780_functions->backlight != NULL)
|
||||
p->hd44780_functions->backlight(p, on);
|
||||
|
||||
|
||||
p->backlightstate = on;
|
||||
}
|
||||
|
||||
@@ -1047,7 +1047,7 @@ HD44780_set_char(Driver *drvthis, int n, unsigned char *dat)
|
||||
int letter = 0;
|
||||
|
||||
if (p->lastline || (row < p->cellheight - 1))
|
||||
letter = dat[row] & mask;
|
||||
letter = dat[row] & mask;
|
||||
|
||||
if (p->cc[n].cache[row] != letter)
|
||||
p->cc[n].clean = 0; /* only mark dirty if really different */
|
||||
@@ -1068,7 +1068,7 @@ HD44780_set_char(Driver *drvthis, int n, unsigned char *dat)
|
||||
MODULE_EXPORT int
|
||||
HD44780_icon(Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
static unsigned char heart_open[] =
|
||||
static unsigned char heart_open[] =
|
||||
{ b__XXXXX,
|
||||
b__X_X_X,
|
||||
b_______,
|
||||
@@ -1077,7 +1077,7 @@ HD44780_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XX_XX,
|
||||
b__XXXXX };
|
||||
static unsigned char heart_filled[] =
|
||||
static unsigned char heart_filled[] =
|
||||
{ b__XXXXX,
|
||||
b__X_X_X,
|
||||
b___X_X_,
|
||||
@@ -1086,7 +1086,7 @@ HD44780_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__X_X_X,
|
||||
b__XX_XX,
|
||||
b__XXXXX };
|
||||
static unsigned char arrow_up[] =
|
||||
static unsigned char arrow_up[] =
|
||||
{ b____X__,
|
||||
b___XXX_,
|
||||
b__X_X_X,
|
||||
@@ -1095,7 +1095,7 @@ HD44780_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b____X__,
|
||||
b____X__,
|
||||
b_______ };
|
||||
static unsigned char arrow_down[] =
|
||||
static unsigned char arrow_down[] =
|
||||
{ b____X__,
|
||||
b____X__,
|
||||
b____X__,
|
||||
@@ -1105,7 +1105,7 @@ HD44780_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b____X__,
|
||||
b_______ };
|
||||
/*
|
||||
static unsigned char arrow_left[] =
|
||||
static unsigned char arrow_left[] =
|
||||
{ b_______,
|
||||
b____X__,
|
||||
b___X___,
|
||||
@@ -1114,7 +1114,7 @@ HD44780_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b____X__,
|
||||
b_______,
|
||||
b_______ };
|
||||
static unsigned char arrow_right[] =
|
||||
static unsigned char arrow_right[] =
|
||||
{ b_______,
|
||||
b____X__,
|
||||
b_____X_,
|
||||
@@ -1124,7 +1124,7 @@ HD44780_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b_______,
|
||||
b_______ };
|
||||
*/
|
||||
static unsigned char checkbox_off[] =
|
||||
static unsigned char checkbox_off[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b__XXXXX,
|
||||
@@ -1133,7 +1133,7 @@ HD44780_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
static unsigned char checkbox_on[] =
|
||||
static unsigned char checkbox_on[] =
|
||||
{ b____X__,
|
||||
b____X__,
|
||||
b__XXX_X,
|
||||
@@ -1142,7 +1142,7 @@ HD44780_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
static unsigned char checkbox_gray[] =
|
||||
static unsigned char checkbox_gray[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b__XXXXX,
|
||||
@@ -1152,7 +1152,7 @@ HD44780_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
/*
|
||||
static unsigned char selector_left[] =
|
||||
static unsigned char selector_left[] =
|
||||
{ b___X___,
|
||||
b___XX__,
|
||||
b___XXX_,
|
||||
@@ -1161,7 +1161,7 @@ HD44780_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b___XX__,
|
||||
b___X___,
|
||||
b_______ };
|
||||
static unsigned char selector_right[] =
|
||||
static unsigned char selector_right[] =
|
||||
{ b_____X_,
|
||||
b____XX_,
|
||||
b___XXX_,
|
||||
@@ -1170,7 +1170,7 @@ HD44780_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b____XX_,
|
||||
b_____X_,
|
||||
b_______ };
|
||||
static unsigned char ellipsis[] =
|
||||
static unsigned char ellipsis[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b_______,
|
||||
@@ -1179,8 +1179,8 @@ HD44780_icon(Driver *drvthis, int x, int y, int icon)
|
||||
b_______,
|
||||
b__X_X_X,
|
||||
b_______ };
|
||||
*/
|
||||
static unsigned char block_filled[] =
|
||||
*/
|
||||
static unsigned char block_filled[] =
|
||||
{ b__XXXXX,
|
||||
b__XXXXX,
|
||||
b__XXXXX,
|
||||
@@ -1312,7 +1312,7 @@ HD44780_get_key(Driver *drvthis)
|
||||
* - excluding one for EN1, 5 status pins).
|
||||
*
|
||||
* Note that a connection type may support even less rows/columns!
|
||||
*
|
||||
*
|
||||
* \param p Pointer to PrivateData structure.
|
||||
* \return Scancode of the key.
|
||||
*/
|
||||
@@ -1416,7 +1416,7 @@ HD44780_output(Driver *drvthis, int on)
|
||||
|
||||
p->output_state = on;
|
||||
|
||||
// call output function only if it is defined for the commenction type
|
||||
// call output function only if it is defined for the commenction type
|
||||
if (p->hd44780_functions->output != NULL)
|
||||
p->hd44780_functions->output(p, on);
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ icp_a106_close (Driver *drvthis)
|
||||
close(p->fd);
|
||||
}
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
drvthis->store_private_ptr(drvthis, NULL);
|
||||
|
||||
report(RPT_INFO, "%s: closed", drvthis->name);
|
||||
|
||||
+27
-27
@@ -106,7 +106,7 @@ typedef struct imonlcd_private_data {
|
||||
int backlightOn; /* stores the backlight state */
|
||||
|
||||
/*
|
||||
* 0 = two disc-segments spinning as default, 1 = their complement
|
||||
* 0 = two disc-segments spinning as default, 1 = their complement
|
||||
* spinning
|
||||
*/
|
||||
int discMode;
|
||||
@@ -266,7 +266,7 @@ static void send_packet(PrivateData *p);
|
||||
* \retval 0 Success.
|
||||
* \retval <0 Error.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
imonlcd_init(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = NULL;
|
||||
@@ -433,7 +433,7 @@ imonlcd_init(Driver *drvthis)
|
||||
* Send the "initialize" commands to the screen.
|
||||
* \param drvthis Pointer to driver structure.
|
||||
*/
|
||||
static void
|
||||
static void
|
||||
imonlcd_display_init(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -458,7 +458,7 @@ imonlcd_display_init(Driver *drvthis)
|
||||
* Close the driver (do necessary clean-up).
|
||||
* \param drvthis Pointer to driver structure.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
imonlcd_close(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -539,7 +539,7 @@ imonlcd_get_info(Driver *drvthis)
|
||||
* Clear the screen.
|
||||
* \param drvthis Pointer to driver structure.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
imonlcd_clear(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -552,7 +552,7 @@ imonlcd_clear(Driver *drvthis)
|
||||
* Flush data on screen to the LCD.
|
||||
* \param drvthis Pointer to driver structure.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
imonlcd_flush(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -592,7 +592,7 @@ imonlcd_flush(Driver *drvthis)
|
||||
* \param y Vertical character position (row).
|
||||
* \param string String that gets written.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
imonlcd_string(Driver *drvthis, int x, int y, const char string[])
|
||||
{
|
||||
int i;
|
||||
@@ -610,7 +610,7 @@ imonlcd_string(Driver *drvthis, int x, int y, const char string[])
|
||||
* \param y Vertical character position (row).
|
||||
* \param ch Character that gets written. (ISO 8859-1 + special characters)
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
imonlcd_chr(Driver *drvthis, int x, int y, char ch)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -643,7 +643,7 @@ imonlcd_chr(Driver *drvthis, int x, int y, char ch)
|
||||
* \param promille Current height level of the bar in promille.
|
||||
* \param options Options (currently unused).
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
imonlcd_vbar(Driver *drvthis, int x, int y, int len, int promille, int options)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -666,7 +666,7 @@ imonlcd_vbar(Driver *drvthis, int x, int y, int len, int promille, int options)
|
||||
* \param promille Current length level of the bar in promille (i.e. from 0 to 1000).
|
||||
* \param options Options (currently unused).
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
imonlcd_hbar(Driver *drvthis, int x, int y, int len, int promille, int options)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -709,7 +709,7 @@ imonlcd_hbar(Driver *drvthis, int x, int y, int len, int promille, int options)
|
||||
* \retval 0 Icon has been successfully defined/written.
|
||||
* \retval <0 Server core shall define/write the icon.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
imonlcd_icon(Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
char ch1 = '?';
|
||||
@@ -797,7 +797,7 @@ imonlcd_icon(Driver *drvthis, int x, int y, int icon)
|
||||
* \param x The x-coordinate to display the character at.
|
||||
* \param num The number to display ("10" is the colon).
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
imonlcd_num(Driver *drvthis, int x, int num)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -850,7 +850,7 @@ imonlcd_num(Driver *drvthis, int x, int num)
|
||||
* 0 <= length <= 32, bars extend from left to right.
|
||||
* length > 32, bars extend from right to left, length is counted
|
||||
* from 32 up (i.e. 35 means a length of 3).
|
||||
*
|
||||
*
|
||||
* Remember: There are two kinds of calls!
|
||||
* With bit 28 set to 1: Set all bars (leaving the symbols as is),
|
||||
* with bit 28 set to 0: Set the symbols (leaving the bars as is).
|
||||
@@ -863,7 +863,7 @@ imonlcd_num(Driver *drvthis, int x, int num)
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \param state This symbols or bars to display.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
imonlcd_output(Driver *drvthis, int state)
|
||||
{
|
||||
|
||||
@@ -1096,7 +1096,7 @@ imonlcd_output(Driver *drvthis, int state)
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \return Number of characters the display is wide.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
imonlcd_width(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -1110,7 +1110,7 @@ imonlcd_width(Driver *drvthis)
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \return Number of characters the display is high.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
imonlcd_height(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -1124,7 +1124,7 @@ imonlcd_height(Driver *drvthis)
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \return Number of pixel columns a character cell is wide.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
imonlcd_cellwidth(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -1138,7 +1138,7 @@ imonlcd_cellwidth(Driver *drvthis)
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \return Number of pixel lines a character cell is high.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
imonlcd_cellheight(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -1157,7 +1157,7 @@ imonlcd_cellheight(Driver *drvthis)
|
||||
* the device. The kernel module doesn't actually do validation.
|
||||
* \param p The private data containing the file descriptor to write to.
|
||||
*/
|
||||
static void
|
||||
static void
|
||||
send_command_data(uint64_t value, PrivateData *p)
|
||||
{
|
||||
int i;
|
||||
@@ -1175,7 +1175,7 @@ send_command_data(uint64_t value, PrivateData *p)
|
||||
*
|
||||
* \param p The private data structure containing a tx_buf with the data to send.
|
||||
*/
|
||||
static void
|
||||
static void
|
||||
send_packet(PrivateData *p)
|
||||
{
|
||||
int err;
|
||||
@@ -1195,7 +1195,7 @@ send_packet(PrivateData *p)
|
||||
* \return 0 on failure, >0 on success.
|
||||
*/
|
||||
MODULE_EXPORT
|
||||
void
|
||||
void
|
||||
imonlcd_set_contrast(Driver *drvthis, int promille)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -1222,7 +1222,7 @@ imonlcd_set_contrast(Driver *drvthis, int promille)
|
||||
* \return The current contrast in promille (0 = lowest contrast;
|
||||
* 1000 = highest contrast).
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
imonlcd_get_contrast(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -1235,7 +1235,7 @@ imonlcd_get_contrast(Driver *drvthis)
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \param on The backlight state boolean-like: 0 = off; >0 = on.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
imonlcd_backlight(Driver *drvthis, int on)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -1262,7 +1262,7 @@ imonlcd_backlight(Driver *drvthis, int on)
|
||||
* \param y vertical position
|
||||
* \param p pointer to the PrivateData structure
|
||||
*/
|
||||
static void
|
||||
static void
|
||||
draw_bigchar(imon_bigfont *font, int ch, int x, int y, PrivateData *p)
|
||||
{
|
||||
imon_bigfont *defn = font;
|
||||
@@ -1305,7 +1305,7 @@ draw_bigchar(imon_bigfont *font, int ch, int x, int y, PrivateData *p)
|
||||
* \param botProgress Length of the bottom progress bar (-32 to 32)
|
||||
* \param p The private data structure containing the file descriptor to write to.
|
||||
*/
|
||||
static void
|
||||
static void
|
||||
setLineLength(int topLine, int botLine, int topProgress, int botProgress, PrivateData *p)
|
||||
{
|
||||
setBuiltinProgressBars(lengthToPixels(topLine),
|
||||
@@ -1328,7 +1328,7 @@ setLineLength(int topLine, int botLine, int topProgress, int botProgress, Privat
|
||||
* \param botProgress Pitmap of the bottom progress bar
|
||||
* \param p The private data structure containing the file descriptor to write to.
|
||||
*/
|
||||
static void
|
||||
static void
|
||||
setBuiltinProgressBars(int topLine, int botLine,
|
||||
int topProgress, int botProgress, PrivateData *p)
|
||||
{
|
||||
@@ -1359,7 +1359,7 @@ setBuiltinProgressBars(int topLine, int botLine,
|
||||
* \param length The length of the bar.
|
||||
* \return The pixmap that represents the given length.
|
||||
*/
|
||||
static int
|
||||
static int
|
||||
lengthToPixels(int length)
|
||||
{
|
||||
int pixLen[] =
|
||||
|
||||
@@ -49,7 +49,7 @@ MODULE_EXPORT int imonlcd_cellheight (Driver *drvthis);
|
||||
|
||||
/* Hardware functions */
|
||||
MODULE_EXPORT int imonlcd_get_contrast (Driver *drvthis);
|
||||
MODULE_EXPORT void imonlcd_set_contrast (Driver *drvthis, int promille);
|
||||
MODULE_EXPORT void imonlcd_set_contrast (Driver *drvthis, int promille);
|
||||
/* MODULE_EXPORT int imonlcd_get_brightness (Driver *drvthis, int state); NOT IMPLEMENTED */
|
||||
/* MODULE_EXPORT void imonlcd_set_brightness (Driver *drvthis, int state, int promille); NOT IMPLEMENTED */
|
||||
MODULE_EXPORT void imonlcd_backlight(Driver *drvthis, int on);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// -*- coding:iso-8859-15 -*-
|
||||
/** \file server/drivers/imonlcd_font.h
|
||||
* This is a definition of a font for use with the iMON LCD.
|
||||
*
|
||||
*
|
||||
* The iMON LCD doesn't have a "text mode" - everthing is pixel-based.
|
||||
* So we need to define our own font, basically.
|
||||
*/
|
||||
|
||||
@@ -109,7 +109,7 @@ joy_init (Driver *drvthis)
|
||||
/* End of config file parsing (1st part) */
|
||||
|
||||
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));
|
||||
return -1;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ joy_init (Driver *drvthis)
|
||||
p->axismap[2*i] = strdup(mapval);
|
||||
report(RPT_DEBUG, "%s: map Axis%dneg to %s",
|
||||
drvthis->name, i+1, p->axismap[2*i]);
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(mapkey, sizeof(mapkey), "Map_Axis%dpos", i+1);
|
||||
mapval = drvthis->config_get_string(drvthis->name, mapkey, 0, NULL);
|
||||
@@ -155,7 +155,7 @@ joy_init (Driver *drvthis)
|
||||
p->axismap[2*i + 1] = strdup(mapval);
|
||||
report(RPT_DEBUG, "%s: map Axis%dpos to %s",
|
||||
drvthis->name, i+1, p->axismap[2*i + 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < p->buttons; i++) {
|
||||
@@ -168,7 +168,7 @@ joy_init (Driver *drvthis)
|
||||
p->buttonmap[i] = strdup(mapval);
|
||||
report(RPT_DEBUG, "%s: map Button%d to %s",
|
||||
drvthis->name, i+1, p->buttonmap[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* End of config file parsing (2nd part) */
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* This function places a hbar using the v0.5 API format and the given cellwidth.
|
||||
* It assumes that custom chars have been statically defined, so that number
|
||||
* 1 has 1 pixel, number 2 has 2 etc.
|
||||
*
|
||||
*
|
||||
* LCDs that have the custom chars at other char numbers than 0 should put the
|
||||
* first custom char number in cc_offset.
|
||||
*/
|
||||
@@ -38,7 +38,7 @@ lib_hbar_static (Driver *drvthis, int x, int y, int len, int promille, int optio
|
||||
|
||||
if ( pixels >= cellwidth ) {
|
||||
/* write a "full" block to the screen... */
|
||||
#if defined(SEAMLESS_HBARS)
|
||||
#if defined(SEAMLESS_HBARS)
|
||||
drvthis->chr (drvthis, x+pos, y, cellwidth + cc_offset);
|
||||
#else
|
||||
drvthis->icon (drvthis, x+pos, y, ICON_BLOCK_FILLED);
|
||||
@@ -59,7 +59,7 @@ lib_hbar_static (Driver *drvthis, int x, int y, int len, int promille, int optio
|
||||
* This function places a vbar using the v0.5 API format and the given cellwidth.
|
||||
* It assumes that custom chars have been statically defined, so that number
|
||||
* 1 has 1 pixel, number 2 has 2 etc., just like in good old times.
|
||||
*
|
||||
*
|
||||
* LCDs that have the custom chars at other char numbers than 0 should put the
|
||||
* first custom char number in cc_offset.
|
||||
*/
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
/*
|
||||
* lcd_sem.c -- semaphore code written for lcdtime and meter to mediate
|
||||
* access to the parallel port.
|
||||
*
|
||||
*
|
||||
* Written by Benjamin Tse (blt@mundil.cs.mu.edu.au); August,October 1995
|
||||
*
|
||||
*
|
||||
* Functions in this file:
|
||||
* getkey returns the key for the semaphore
|
||||
* sem_get create the semaphore (and initialise) if one doesn't exist
|
||||
@@ -15,13 +15,13 @@
|
||||
* sem_wait wait on the semaphore
|
||||
* sem_signal signal on the semaphore
|
||||
* sem_remove remove the semaphore
|
||||
*
|
||||
*
|
||||
* Legal stuff: At no stage was this program written, assembled or compiled on
|
||||
* any computer at the University of Melbourne, Australia. This program is
|
||||
* Copyright (C) 1995 Benjamin Tse (blt@mundil.cs.mu.oz.au) and covered by
|
||||
* GNU's GPL. In particular, this program is free software and comes WITHOUT
|
||||
* ANY WARRANTY.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -75,7 +75,7 @@ getkey(register char *p)
|
||||
|
||||
/**
|
||||
* Get semaphore.
|
||||
* If the semaphore does not exist, create it and initialise it to 1,
|
||||
* If the semaphore does not exist, create it and initialise it to 1,
|
||||
* otherwise simply return the semaphore ID.
|
||||
* \return Semaphore ID on success; terminate program with code \c 1 on error.
|
||||
*/
|
||||
|
||||
+11
-11
@@ -19,8 +19,8 @@
|
||||
* This file is released under the GNU General Public License. Refer to the
|
||||
* COPYING file distributed with this package.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* 2007/05/22 Removed useless Device= config option.
|
||||
* Added VendorID= and ProductID= config
|
||||
* option parsting. Moved constants to
|
||||
* lis.h where they belong. Added
|
||||
* lis.h where they belong. Added
|
||||
* lis_cellheight() and lis_cellwidth().
|
||||
* Completely commented out lis_test() to
|
||||
* save memory.
|
||||
@@ -145,7 +145,7 @@ const unsigned char UPD16314_charmap[] = {
|
||||
224, 225, 226, 227, 228, 229, 230, 231,
|
||||
232, 233, 234, 235, 237, 237, 238, 239,
|
||||
240, 241, 242, 243, 244, 245, 246, 247,
|
||||
248, 249, 250, 251, 252, 253, 254, 1
|
||||
248, 249, 250, 251, 252, 253, 254, 1
|
||||
};
|
||||
|
||||
/////////////////////////////////////////
|
||||
@@ -155,7 +155,7 @@ lis_standard_custom_chars (Driver *drvthis) {
|
||||
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
static unsigned char checkbox_gray[] =
|
||||
static unsigned char checkbox_gray[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b__XXXXX,
|
||||
@@ -165,7 +165,7 @@ PrivateData *p = drvthis->private_data;
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
|
||||
static unsigned char block_filled[] =
|
||||
static unsigned char block_filled[] =
|
||||
{ b__XXXXX,
|
||||
b__XXXXX,
|
||||
b__XXXXX,
|
||||
@@ -177,7 +177,7 @@ PrivateData *p = drvthis->private_data;
|
||||
|
||||
lis_set_char(drvthis, 1, block_filled);
|
||||
lis_set_char(drvthis, 2, checkbox_gray);
|
||||
|
||||
|
||||
p->ccmode = standard;
|
||||
|
||||
}
|
||||
@@ -320,7 +320,7 @@ lis_set_brightness(Driver *drvthis, int state, int promille)
|
||||
unsigned char buffer[2];
|
||||
int err;
|
||||
PrivateData *p = (PrivateData *) drvthis->private_data;
|
||||
|
||||
|
||||
if (promille < 0 || promille > 1000) {
|
||||
report(RPT_WARNING, "%s: invalid brightness %d less then 0 or greater than 1000",
|
||||
drvthis->name, promille);
|
||||
@@ -446,7 +446,7 @@ lis_init(Driver *drvthis)
|
||||
// open the device
|
||||
err = ftdi_usb_open(&p->ftdic, p->VendorID, p->ProductID);
|
||||
if (err < 0) {
|
||||
report(RPT_ERR, "%s: cannot open USB device %x:%x",
|
||||
report(RPT_ERR, "%s: cannot open USB device %x:%x",
|
||||
drvthis->name,
|
||||
p->VendorID,
|
||||
p->ProductID);
|
||||
@@ -1022,7 +1022,7 @@ lis_init(Driver *drvthis)
|
||||
// }
|
||||
//
|
||||
// timing_uPause(16000);
|
||||
|
||||
|
||||
// set DTR high
|
||||
err = ftdi_setdtr(&p->ftdic, SIO_SET_DTR_HIGH);
|
||||
if (err < 0) {
|
||||
@@ -1420,7 +1420,7 @@ lis_set_char(Driver *drvthis, int n, unsigned char *dat)
|
||||
int letter = 0;
|
||||
|
||||
if (p->lastline || (row < p->cellheight - 1))
|
||||
letter = dat[row] & mask;
|
||||
letter = dat[row] & mask;
|
||||
|
||||
if (p->cc[n].cache[row] != letter) {
|
||||
p->cc[n].clean = 0; /* only mark dirty if really different */
|
||||
|
||||
@@ -66,7 +66,7 @@ typedef struct lis_private_data {
|
||||
|
||||
// the width and the height (in number of characters) of the display
|
||||
int width, height;
|
||||
|
||||
|
||||
// pixel width and height of each character
|
||||
int cellwidth, cellheight;
|
||||
|
||||
@@ -98,7 +98,7 @@ typedef struct lis_private_data {
|
||||
/* lastline controls the use of the last line, if pixel addressable (true, default) or */
|
||||
/* underline effect (false). To avoid the underline effect in the latter case, the last */
|
||||
/* line is always zeroed for whatever redefined character */
|
||||
char lastline;
|
||||
char lastline;
|
||||
} PrivateData;
|
||||
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ ms6931_init (Driver *drvthis)
|
||||
|
||||
tcsetattr(p->fd, TCSANOW, &portset);
|
||||
|
||||
// set display to comunications mode
|
||||
// set display to comunications mode
|
||||
ms6931_write(p->fd, "~\040", 2);
|
||||
sleep(1);
|
||||
|
||||
@@ -255,7 +255,7 @@ ms6931_close (Driver *drvthis)
|
||||
ms6931_clear(drvthis);
|
||||
ms6931_flush(drvthis);
|
||||
ms6931_backlight (drvthis, BACKLIGHT_OFF);
|
||||
}
|
||||
}
|
||||
|
||||
if (p->fd >= 0)
|
||||
close(p->fd);
|
||||
@@ -508,7 +508,7 @@ ms6931_get_key (Driver *drvthis)
|
||||
key = "Down";
|
||||
break;
|
||||
default:
|
||||
report(RPT_DEBUG, "%s get_key: illegal key 0x%02X",
|
||||
report(RPT_DEBUG, "%s get_key: illegal key 0x%02X",
|
||||
drvthis->name, buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ MTC_S16209X_init (Driver *drvthis)
|
||||
if (reboot) {
|
||||
report(RPT_INFO, "%s: rebooting LCD...", drvthis->name);
|
||||
MTC_S16209X_reboot();
|
||||
}
|
||||
}
|
||||
#endif // CAN_REBOOT_LCD
|
||||
|
||||
result = write(p->fd, lcd_clearscreen, sizeof(lcd_clearscreen)); // Clear the LCD, unbuffered
|
||||
|
||||
+13
-13
@@ -2,7 +2,7 @@
|
||||
* LCDd \c mx5000 driver for the Logitech MX5000 keyboard.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
Author: Christian Jodar (tian@gcstar.org)
|
||||
|
||||
Copyright (C) 2008 Christian Jodar
|
||||
@@ -150,7 +150,7 @@ mx5000_height (Driver *drvthis)
|
||||
/*
|
||||
* Returns the display's character cell width
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
mx5000_cellwidth(Driver *drvthis)
|
||||
{
|
||||
return CELL_WIDTH;
|
||||
@@ -160,7 +160,7 @@ mx5000_cellwidth(Driver *drvthis)
|
||||
/*
|
||||
* Returns the display's character cell height
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
mx5000_cellheight(Driver *drvthis)
|
||||
{
|
||||
return CELL_HEIGHT;
|
||||
@@ -179,7 +179,7 @@ mx5000_flush (Driver *drvthis)
|
||||
We could only update the needed part. But it would be hard to really
|
||||
figure out what has been changed
|
||||
*/
|
||||
|
||||
|
||||
if (p->changed)
|
||||
{
|
||||
mx5000_sc_send(p->sc, p->fd);
|
||||
@@ -200,15 +200,15 @@ mx5000_chr (Driver *drvthis, int x, int y, char c)
|
||||
char str[2];
|
||||
// The position should be given in pixels
|
||||
int px, py;
|
||||
|
||||
|
||||
if ((x <= 0) || (y <= 0) || (x > SCREEN_WIDTH) || (y > SCREEN_HEIGHT))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
px = (x - 1) * CELL_WIDTH;
|
||||
py = y * CELL_HEIGHT;
|
||||
|
||||
|
||||
str[0] = c;
|
||||
str[1] = 0;
|
||||
mx5000_sc_add_text(p->sc, str, -1, STATIC, py, px);
|
||||
@@ -226,7 +226,7 @@ mx5000_string (Driver *drvthis, int x, int y, const char string[])
|
||||
int actual_len;
|
||||
// The position should be given in pixels
|
||||
int px, py;
|
||||
|
||||
|
||||
if ((x <= 0) || (y <= 0) || (x > SCREEN_WIDTH) || (y > SCREEN_HEIGHT))
|
||||
{
|
||||
return;
|
||||
@@ -238,7 +238,7 @@ mx5000_string (Driver *drvthis, int x, int y, const char string[])
|
||||
{
|
||||
actual_len = SCREEN_WIDTH - x + 1;
|
||||
}
|
||||
|
||||
|
||||
px = (x - 1) * CELL_WIDTH;
|
||||
py = y * CELL_HEIGHT;
|
||||
|
||||
@@ -274,8 +274,8 @@ mx5000_hbar (Driver *drvthis, int x, int y, int len, int promille, int options)
|
||||
//printf("Bar : %d, %d, %d, %d, %d\n", x, y, len, promille, options);
|
||||
px = (x - 1) * CELL_WIDTH;
|
||||
py = y * CELL_HEIGHT;
|
||||
|
||||
mx5000_sc_add_progress_bar(p->sc,
|
||||
|
||||
mx5000_sc_add_progress_bar(p->sc,
|
||||
promille * len / 1000,
|
||||
len,
|
||||
STATIC,
|
||||
@@ -292,7 +292,7 @@ mx5000_num (Driver *drvthis, int x, int num)
|
||||
char text[10];
|
||||
px = (x - 1) * CELL_WIDTH;
|
||||
py = 33;
|
||||
|
||||
|
||||
if (num < 10)
|
||||
{
|
||||
sprintf(text, "%d", num);
|
||||
@@ -352,7 +352,7 @@ mx5000_icon(Driver *drvthis, int x, int y, int icon)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
return -1; /* Let the core do other icons */
|
||||
}
|
||||
}
|
||||
|
||||
+66
-66
@@ -6,7 +6,7 @@
|
||||
* (c) 2007 NitroSecurity, Inc.
|
||||
* Written by Gatewood Green <woody@nitrosecurity.com> or <woody@linif.org>
|
||||
* (c) 2007-2008 Peter Marschall - adapted coding style and reporting to LCDproc
|
||||
* (c) 2007 Mini-Box.com, Nicu Pavel <npavel@ituner.com>
|
||||
* (c) 2007 Mini-Box.com, Nicu Pavel <npavel@ituner.com>
|
||||
* - removed libusblcd and hid dependency
|
||||
* - added vbar, hbar, custom char, bignum support
|
||||
* (c) 2008 Jack Cleaver - add LIRC connection
|
||||
@@ -18,16 +18,16 @@
|
||||
* - Removed usb_clear_halt, because it breaks picoLCD 20x2 (1.57) communication
|
||||
* License: GPL (same as usblcd and lcdPROC)
|
||||
*
|
||||
* picoLCD: http://www.mini-box.com/picoLCD-20x2-OEM
|
||||
* Can be purchased separately or preinstalled in units such as the
|
||||
* picoLCD: http://www.mini-box.com/picoLCD-20x2-OEM
|
||||
* Can be purchased separately or preinstalled in units such as the
|
||||
* M300 http://www.mini-box.com/Mini-Box-M300-LCD
|
||||
* picoLCD 4x20: http://www.mini-box.com/PicoLCD-4X20-Sideshow
|
||||
*
|
||||
* The picoLCD is usb connected and is driven (currently) via userspace
|
||||
* The picoLCD is usb connected and is driven (currently) via userspace
|
||||
* using libusb library.
|
||||
*
|
||||
* libusb: http://www.libusb.org/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/* lcdPROC includes */
|
||||
@@ -61,7 +61,7 @@
|
||||
#define DEFAULT_KEYLIGHTS 1 /* On */
|
||||
#define DEFAULT_TIMEOUT 500 /* Half second */
|
||||
|
||||
#define NUM_CCs 8 /* max. number of custom characters */
|
||||
#define NUM_CCs 8 /* max. number of custom characters */
|
||||
|
||||
typedef enum {
|
||||
standard, /* only char 0 is used for heartbeat */
|
||||
@@ -148,7 +148,7 @@ picolcd_device picolcd_device_ids[] = {
|
||||
.write = picolcd_20x4_write,
|
||||
.cchar = picolcd_20x4_set_char,
|
||||
/* all keymap labels must be shorter than KEYPAD_LABEL_MAX */
|
||||
.keymap = { NULL, "Escape", "F1", "F2", "F3", "Home", "Down",
|
||||
.keymap = { NULL, "Escape", "F1", "F2", "F3", "Home", "Down",
|
||||
"Enter", "Up", "", "", "", ""},
|
||||
.initseq = { 0x94, 0x00, 0x07, 0x00, 0x32, 0x30, 0x00, 0x32,
|
||||
0x30, 0x00, 0x32, 0x30, 0x00, 0x32, 0x38, 0x00,
|
||||
@@ -243,12 +243,12 @@ MODULE_EXPORT int picoLCD_init(Driver *drvthis)
|
||||
else {
|
||||
report(RPT_ERR, "%s: no device found", drvthis->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* if the device has a init sequence sent it to device */
|
||||
picolcd_send(p->lcd, p->device->initseq, PICOLCD_MAX_DATA_LEN);
|
||||
|
||||
p->width = p->device->width;
|
||||
p->width = p->device->width;
|
||||
p->height = p->device->height;
|
||||
p->info = p->device->description;
|
||||
p->cellwidth = LCD_DEFAULT_CELLWIDTH;
|
||||
@@ -267,7 +267,7 @@ MODULE_EXPORT int picoLCD_init(Driver *drvthis)
|
||||
|
||||
sprintf(configkey, "Key%dLight", x);
|
||||
p->key_light[x] = drvthis->config_get_bool(drvthis->name, configkey, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
p->framebuf = (unsigned char *) malloc(p->width * p->height + 1);
|
||||
if (p->framebuf == NULL) {
|
||||
@@ -299,8 +299,8 @@ MODULE_EXPORT int picoLCD_init(Driver *drvthis)
|
||||
p->flush_threshold = drvthis->config_get_int(drvthis->name, "LircFlushThreshold", 0,
|
||||
DEFAULT_FLUSH_THRESHOLD_JIFFY);
|
||||
if (p->flush_threshold < 16) /* Prevent small 'foolish' values these will disable the check also! */
|
||||
p->flush_threshold = 0x8000; /* Disabled, send check will always fail! */
|
||||
|
||||
p->flush_threshold = 0x8000; /* Disabled, send check will always fail! */
|
||||
|
||||
p->IRenabled = (lirchost != NULL && *lirchost != '\0') ? 1 : 0;
|
||||
|
||||
/* Simulate that the last value send was a PULSE,
|
||||
@@ -329,8 +329,8 @@ MODULE_EXPORT int picoLCD_init(Driver *drvthis)
|
||||
p->lircserver.sin_addr = *(struct in_addr *) hostinfo->h_addr; /* IP address */
|
||||
p->lircserver.sin_port = htons(lircport); /* server port */
|
||||
|
||||
report(RPT_INFO, "%s: IR events will be sent to LIRC on %s:%d, with flush threshold=%d",
|
||||
drvthis->name, lirchost, lircport, p->flush_threshold);
|
||||
report(RPT_INFO, "%s: IR events will be sent to LIRC on %s:%d, with flush threshold=%d",
|
||||
drvthis->name, lirchost, lircport, p->flush_threshold);
|
||||
}
|
||||
|
||||
report(RPT_INFO, "%s: init complete", drvthis->name);
|
||||
@@ -410,8 +410,8 @@ MODULE_EXPORT void picoLCD_flush(Driver *drvthis)
|
||||
|
||||
debug(RPT_DEBUG, "%s: flush started", drvthis->name);
|
||||
|
||||
for (line = 0; line < p->height; line++) {
|
||||
memset(text, 0, sizeof(text));
|
||||
for (line = 0; line < p->height; line++) {
|
||||
memset(text, 0, sizeof(text));
|
||||
offset = line * p->width;
|
||||
fb = p->framebuf + offset;
|
||||
lf = p->lstframe + offset;
|
||||
@@ -513,7 +513,7 @@ MODULE_EXPORT void picoLCD_chr(Driver *drvthis, int x, int y, unsigned char c)
|
||||
MODULE_EXPORT void picoLCD_set_char (Driver *drvthis, int n, unsigned char *dat)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
|
||||
p->device->cchar(drvthis, n, dat);
|
||||
}
|
||||
|
||||
@@ -650,16 +650,16 @@ MODULE_EXPORT void picoLCD_num (Driver *drvthis, int x, int num)
|
||||
MODULE_EXPORT int picoLCD_icon (Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
|
||||
/* 8x5 icons each number represents one row in binary */
|
||||
|
||||
static unsigned char heart_open[] =
|
||||
static unsigned char heart_open[] =
|
||||
{ 0x0, 0xa, 0x15, 0x11, 0x1b, 0xa, 0x4, 0x0 };
|
||||
|
||||
|
||||
static unsigned char heart_filled[] =
|
||||
|
||||
static unsigned char heart_filled[] =
|
||||
{ 0x0, 0xa, 0x1f, 0x1f, 0x1f, 0xe, 0x4, 0x0 };
|
||||
|
||||
|
||||
switch (icon) {
|
||||
case ICON_BLOCK_FILLED:
|
||||
picoLCD_chr(drvthis, x, y, 255);
|
||||
@@ -763,32 +763,32 @@ MODULE_EXPORT char *picoLCD_get_key(Driver *drvthis)
|
||||
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* Due to how key events are reported, we need to keep reading key presses
|
||||
/*
|
||||
* Due to how key events are reported, we need to keep reading key presses
|
||||
* until we get the all clear (all keys up) event.
|
||||
*
|
||||
* Key events come back in such a way to report up to two simultanious keys
|
||||
* pressed. The highest numbered key always comes back as the first key and
|
||||
* the lower numbered key follows. If only one key was pressed, the second
|
||||
*
|
||||
* Key events come back in such a way to report up to two simultanious keys
|
||||
* pressed. The highest numbered key always comes back as the first key and
|
||||
* the lower numbered key follows. If only one key was pressed, the second
|
||||
* key is 0. I will refer to a key event as: <high key, low key>.
|
||||
*
|
||||
*
|
||||
* The picoLCD also sends key-up events.
|
||||
*
|
||||
* On a single key press, the return is <keynum, 0>. The key-up event is a
|
||||
* read that returns <0, 0> (all clear). On a dual key press, if one key is
|
||||
* released later than the other key, the first key-up event is
|
||||
* <remainingkey, 0>. This will be followed by a final "all clear" key-up
|
||||
* <0, 0>. If both keys are release simultaniously, then after <hk, lk>,
|
||||
* you will receive <0, 0>. If the keys are pressed down in a staggard
|
||||
* fashion, you will receive <first key, 0> followed by <hk, lk> followed by
|
||||
* On a single key press, the return is <keynum, 0>. The key-up event is a
|
||||
* read that returns <0, 0> (all clear). On a dual key press, if one key is
|
||||
* released later than the other key, the first key-up event is
|
||||
* <remainingkey, 0>. This will be followed by a final "all clear" key-up
|
||||
* <0, 0>. If both keys are release simultaniously, then after <hk, lk>,
|
||||
* you will receive <0, 0>. If the keys are pressed down in a staggard
|
||||
* fashion, you will receive <first key, 0> followed by <hk, lk> followed by
|
||||
* key-up events as already detailed.
|
||||
*
|
||||
* What this means is that we need to keep reading key presses until we get
|
||||
* What this means is that we need to keep reading key presses until we get
|
||||
* the <0, 0> all clear.
|
||||
*
|
||||
* For keymapping see the picolcd_device structs.
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -823,11 +823,11 @@ MODULE_EXPORT void picoLCD_set_contrast(Driver *drvthis, int promille)
|
||||
PrivateData *p = drvthis->private_data;
|
||||
int inv; /* The hardware seems to go dark on higher values, so we turn it around */
|
||||
unsigned char packet[2] = { 0x92 }; /* set contrast id */
|
||||
|
||||
|
||||
if (promille <= 1000 && promille > 0) {
|
||||
p->contrast = promille;
|
||||
|
||||
if (p->device->contrast_max == 1)
|
||||
if (p->device->contrast_max == 1)
|
||||
packet[1] = 0x00; /* picoLCD20x4 permits contrast as 0/1 value */
|
||||
else {
|
||||
inv = 1000 - promille;
|
||||
@@ -842,7 +842,7 @@ MODULE_EXPORT void picoLCD_set_contrast(Driver *drvthis, int promille)
|
||||
p->contrast = 0;
|
||||
packet[1] = p->device->contrast_max;
|
||||
}
|
||||
|
||||
|
||||
picolcd_send(p->lcd, packet, 2);
|
||||
}
|
||||
|
||||
@@ -869,13 +869,13 @@ MODULE_EXPORT void picoLCD_set_contrast(Driver *drvthis, int promille)
|
||||
MODULE_EXPORT void picoLCD_set_brightness(Driver *drvthis, int state, int promille)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
if (promille < 0 || promille > 1000)
|
||||
|
||||
if (promille < 0 || promille > 1000)
|
||||
return;
|
||||
|
||||
|
||||
if (state)
|
||||
p->brightness = promille;
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -889,19 +889,19 @@ MODULE_EXPORT void picoLCD_backlight(Driver *drvthis, int state)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
unsigned char packet[2] = { 0x91 }; /* set backlight id */
|
||||
|
||||
|
||||
int s = p->brightness / 10; /* scale in 0-100 range for picoLCDs */
|
||||
|
||||
|
||||
/* picoLCD 20x2 doesn't have brightness levels */
|
||||
if (s > p->device->bklight_max)
|
||||
s = p->device->bklight_max;
|
||||
|
||||
|
||||
if (state == BACKLIGHT_OFF) {
|
||||
//packet[1] = (unsigned char) p->device->bklight_min;
|
||||
//packet[1] = (unsigned char) p->device->bklight_min;
|
||||
packet[1] = 0xff;
|
||||
picolcd_send(p->lcd, packet, 2);
|
||||
set_key_lights(p->lcd, p->key_light, state);
|
||||
}
|
||||
}
|
||||
else if (state == BACKLIGHT_ON) {
|
||||
packet[1] = (unsigned char) s;
|
||||
picolcd_send(p->lcd, packet, 2);
|
||||
@@ -944,12 +944,12 @@ MODULE_EXPORT char *picoLCD_get_info(Driver *drvthis)
|
||||
* Transcode from picoLCD USB format to LIRC UDP format.
|
||||
* LIRC UDP packets expect 16-bit intervals, with MSB set for space.
|
||||
* Intervals are measured in jiffies (1/16384 s).
|
||||
* PicoLCD USB packets contain 16-bit intervals, with value negated
|
||||
* PicoLCD USB packets contain 16-bit intervals, with value negated
|
||||
* for space. Intervals are in microseconds.
|
||||
* PicoLCD presents the bytes in network order, and they must be put back
|
||||
* in that order for transmission via UDP.
|
||||
* One jiffy == 61 us. 537 us == 9j.
|
||||
*
|
||||
* One jiffy == 61 us. 537 us == 9j.
|
||||
*
|
||||
* \param drvthis Pointer to driver structure [used for debug() and report()].
|
||||
* \param data Buffer of integers to be transcoded.
|
||||
* \param cbdata Buffer of integers to be transcoded.
|
||||
@@ -961,7 +961,7 @@ MODULE_EXPORT char *picoLCD_get_info(Driver *drvthis)
|
||||
* To fix this I queue the samples and send it when a sync is detected or by a timeout.
|
||||
* 2. The sync (long space) are not send by the picoLCD.
|
||||
* To fix this we look for a pulse at the end of the last message and a pulse at the
|
||||
* begin new message, we then flush the queue and start with a (sync) space, with
|
||||
* begin new message, we then flush the queue and start with a (sync) space, with
|
||||
* the duration of the time between the last and current message.
|
||||
*
|
||||
* \note To make LIRC happy I send the queued samples with the sync space a the begin,
|
||||
@@ -1153,7 +1153,7 @@ static void picolcd_20x2_write(usb_dev_handle *lcd, const int row, const int col
|
||||
static void picolcd_20x2_set_char(Driver *drvthis, int n, unsigned char *dat)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
unsigned char packet[10] = { 0x9c }; /* define character */
|
||||
unsigned char packet[10] = { 0x9c }; /* define character */
|
||||
unsigned char mask = (1 << p->cellwidth) - 1;
|
||||
int row;
|
||||
|
||||
@@ -1167,7 +1167,7 @@ static void picolcd_20x2_set_char(Driver *drvthis, int n, unsigned char *dat)
|
||||
for (row = 0; row < p->cellheight; row++) {
|
||||
packet[row + 2] = dat[row] & mask;
|
||||
}
|
||||
|
||||
|
||||
picolcd_send(p->lcd, packet, 10);
|
||||
}
|
||||
|
||||
@@ -1176,17 +1176,17 @@ static void picolcd_20x2_set_char(Driver *drvthis, int n, unsigned char *dat)
|
||||
static void picolcd_20x4_set_char(Driver *drvthis, int n, unsigned char *dat)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
|
||||
if ((n < 0) || (n >= NUM_CCs))
|
||||
return;
|
||||
if (!dat)
|
||||
return;
|
||||
|
||||
|
||||
unsigned char command[6] = { OUT_REPORT_CMD, 0x00, 0x01, 0x00, 0x64, 0x40+8*n }; /* 0x94 */
|
||||
unsigned char data[13] = { OUT_REPORT_DATA, 0x01, 0x00, 0x01, 0x08,
|
||||
dat[0], dat[1], dat[2], dat[3],
|
||||
dat[0], dat[1], dat[2], dat[3],
|
||||
dat[4], dat[5], dat[6], dat[7]}; /* 0x95 */
|
||||
|
||||
|
||||
picolcd_send(p->lcd, command, 6);
|
||||
picolcd_send(p->lcd, data, 13);
|
||||
}
|
||||
@@ -1219,22 +1219,22 @@ static void get_key_event(usb_dev_handle *lcd, lcd_packet *packet, int timeout)
|
||||
static void set_key_lights(usb_dev_handle *lcd, int keys[], int state)
|
||||
{
|
||||
unsigned char packet[2] = { 0x81 }; /* set led */
|
||||
unsigned int leds = 0;
|
||||
unsigned int leds = 0;
|
||||
int i;
|
||||
|
||||
if (state) {
|
||||
/* Only LEDs we want on */
|
||||
for (i = 0; i < KEYPAD_LIGHTS; i++)
|
||||
if(keys[i])
|
||||
for (i = 0; i < KEYPAD_LIGHTS; i++)
|
||||
if(keys[i])
|
||||
leds |= (1 << i);
|
||||
else
|
||||
else
|
||||
leds &= ~ (1 << i);
|
||||
}
|
||||
else {
|
||||
/* All LEDs off */
|
||||
leds = 0;
|
||||
}
|
||||
|
||||
|
||||
packet[1] = leds;
|
||||
picolcd_send(lcd, packet, 2);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* (c) 2007 NitroSecurity, Inc.
|
||||
* Written by Gatewood Green <woody@nitrosecurity.com> or <woody@linif.org>
|
||||
* (c) 2007-2008 Peter Marschall - adapted coding style and reporting to LCDproc
|
||||
* (c) 2007 Mini-Box.com, Nicu Pavel <npavel@ituner.com>
|
||||
* (c) 2007 Mini-Box.com, Nicu Pavel <npavel@ituner.com>
|
||||
* - removed libusblcd and hid dependency
|
||||
* - added vbar, hbar, custom char, bignum support
|
||||
* (c) 2008 Jack Cleaver - add LIRC connection
|
||||
@@ -12,16 +12,16 @@
|
||||
* - Added support for 4x20 picoLCD
|
||||
* License: GPL (same as usblcd and lcdPROC)
|
||||
*
|
||||
* picoLCD: http://www.mini-box.com/picoLCD-20x2-OEM
|
||||
* Can be purchased separately or preinstalled in units such as the
|
||||
* picoLCD: http://www.mini-box.com/picoLCD-20x2-OEM
|
||||
* Can be purchased separately or preinstalled in units such as the
|
||||
* M300 http://www.mini-box.com/Mini-Box-M300-LCD
|
||||
* picoLCD 4x20: http://www.mini-box.com/PicoLCD-4X20-Sideshow
|
||||
*
|
||||
* The picoLCD is usb connected and is driven (currently) via userspace
|
||||
* The picoLCD is usb connected and is driven (currently) via userspace
|
||||
* using libusb library.
|
||||
*
|
||||
* libusb: http://www.libusb.org/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PICOLCD_H
|
||||
@@ -41,8 +41,8 @@
|
||||
#define IN_REPORT_KEY_STATE 0x11
|
||||
#define IN_REPORT_IR_DATA 0x21
|
||||
|
||||
#define OUT_REPORT_CMD 0x94
|
||||
#define OUT_REPORT_DATA 0x95
|
||||
#define OUT_REPORT_CMD 0x94
|
||||
#define OUT_REPORT_DATA 0x95
|
||||
|
||||
#define PICOLCD_MAX_DATA_LEN 24
|
||||
|
||||
@@ -69,7 +69,7 @@ typedef struct _picolcd_device {
|
||||
int width; /* width of lcd screen */
|
||||
int height; /* height of lcd screen */
|
||||
/* Pointer to function that writes data to the LCD format */
|
||||
void (*write)(usb_dev_handle *lcd, const int row, const int col, const unsigned char *data);
|
||||
void (*write)(usb_dev_handle *lcd, const int row, const int col, const unsigned char *data);
|
||||
/* Pointer to function that defines a custom character */
|
||||
void (*cchar) (Driver *drvthis, int n, unsigned char *dat);
|
||||
} picolcd_device;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Low level I/O functions taken from led-stat.txt
|
||||
* Jan 22 95 copyright damianf@wpi.edu
|
||||
*
|
||||
@@ -63,7 +63,7 @@ not be in this file but in lpt-port.h ...
|
||||
#if defined HAVE_IOPERM
|
||||
|
||||
/* Glibc2 and Glibc1 */
|
||||
# ifdef HAVE_SYS_IO_H
|
||||
# ifdef HAVE_SYS_IO_H
|
||||
# include <sys/io.h>
|
||||
# endif
|
||||
|
||||
|
||||
+31
-31
@@ -30,7 +30,7 @@
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Changes:
|
||||
* 2006-02-20 Stefan Reinauer <stepan@coresystems.de>
|
||||
* - add support for onboard LEDs via "output" command
|
||||
@@ -163,13 +163,13 @@ read_ACK(PrivateData *p)
|
||||
return (retval && buffer[0]=='Q');
|
||||
}
|
||||
|
||||
/* Send the input as telegramm.
|
||||
*
|
||||
/* Send the input as telegramm.
|
||||
*
|
||||
* The telegram buffer just contains the raw telegram data
|
||||
* - It shall not contain <STX> and <ETX> marks
|
||||
* - It may contain bytes below 0x20, they are automatically escaped by
|
||||
* real_sent_tele
|
||||
*
|
||||
*
|
||||
* NOTE: This function does not wait for any ACKs.
|
||||
*/
|
||||
int
|
||||
@@ -179,7 +179,7 @@ real_send_tele(PrivateData *p, char *buffer, int len)
|
||||
int i, j;
|
||||
char buffer2[255];
|
||||
|
||||
i=0; j=0;
|
||||
i=0; j=0;
|
||||
buffer2[j++]=2; // emit <STX>
|
||||
|
||||
/* copy the whole telegram package and escape
|
||||
@@ -195,7 +195,7 @@ real_send_tele(PrivateData *p, char *buffer, int len)
|
||||
buffer2[j++]=buffer[i++];
|
||||
}
|
||||
}
|
||||
buffer2[j++]=3; // emit <ETX>
|
||||
buffer2[j++]=3; // emit <ETX>
|
||||
len=j; // new package length
|
||||
|
||||
/* calculate <BCC> over all bytes */
|
||||
@@ -301,7 +301,7 @@ set_leds(PrivateData *p)
|
||||
* \retval 0 Success.
|
||||
* \retval <0 Error.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
pyramid_init (Driver *drvthis)
|
||||
{
|
||||
char buffer[6]="";
|
||||
@@ -335,7 +335,7 @@ pyramid_init (Driver *drvthis)
|
||||
strcpy(p->framebuffer, "D ");
|
||||
p->FB_modified = 1;
|
||||
|
||||
/* read config file, fill configuration
|
||||
/* read config file, fill configuration
|
||||
* dependent elements of private data
|
||||
*/
|
||||
|
||||
@@ -408,7 +408,7 @@ pyramid_init (Driver *drvthis)
|
||||
* Close the driver (do necessary clean-up).
|
||||
* \param drvthis Pointer to driver structure.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
pyramid_close (Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = (PrivateData *) drvthis->private_data;
|
||||
@@ -422,7 +422,7 @@ pyramid_close (Driver *drvthis)
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \return Number of characters the display is wide.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
pyramid_width (Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = (PrivateData *) drvthis->private_data;
|
||||
@@ -436,7 +436,7 @@ pyramid_width (Driver *drvthis)
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \return Number of characters the display is high.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
pyramid_height (Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = (PrivateData *) drvthis->private_data;
|
||||
@@ -449,7 +449,7 @@ pyramid_height (Driver *drvthis)
|
||||
* Clear the screen.
|
||||
* \param drvthis Pointer to driver structure.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
pyramid_clear (Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = (PrivateData *) drvthis->private_data;
|
||||
@@ -465,7 +465,7 @@ pyramid_clear (Driver *drvthis)
|
||||
* that means, nothing has to be done
|
||||
* \param drvthis Pointer to driver structure.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
pyramid_flush (Driver *drvthis)
|
||||
{
|
||||
static char mesg[33];
|
||||
@@ -513,7 +513,7 @@ pyramid_flush (Driver *drvthis)
|
||||
* \param y Vertical character position (row).
|
||||
* \param string String that gets written.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
pyramid_string (Driver *drvthis, int x, int y, const char string[])
|
||||
{
|
||||
int offset;
|
||||
@@ -537,7 +537,7 @@ pyramid_string (Driver *drvthis, int x, int y, const char string[])
|
||||
* \param y Vertical character position (row).
|
||||
* \param c Character that gets written.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
pyramid_chr (Driver *drvthis, int x, int y, char c)
|
||||
{
|
||||
PrivateData *p = (PrivateData *) drvthis->private_data;
|
||||
@@ -580,7 +580,7 @@ MODULE_EXPORT void pyramid_set_char (Driver *drvthis, int n, char *dat)
|
||||
tele[1]=n+0x40;
|
||||
|
||||
for (row = 0; row < p->cellheight; row++) {
|
||||
pixels=0;
|
||||
pixels=0;
|
||||
for (column = 0; column < p->cellwidth; column++) {
|
||||
pixels <<= 1;
|
||||
pixels |= (dat[(row * p->cellwidth) + column] != 0);
|
||||
@@ -931,7 +931,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
|
||||
},
|
||||
|
||||
{
|
||||
0, 0, 1, 0, 0, // Arrow up
|
||||
0, 0, 1, 0, 0, // Arrow up
|
||||
0, 1, 1, 1, 0,
|
||||
1, 0, 1, 0, 1,
|
||||
0, 0, 1, 0, 0,
|
||||
@@ -953,7 +953,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
|
||||
},
|
||||
|
||||
{
|
||||
0, 0, 0, 0, 0, // Checkbox off
|
||||
0, 0, 0, 0, 0, // Checkbox off
|
||||
0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1,
|
||||
1, 0, 0, 0, 1,
|
||||
@@ -975,7 +975,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
|
||||
},
|
||||
|
||||
{
|
||||
0, 0, 0, 0, 0, // Checkbox gray
|
||||
0, 0, 0, 0, 0, // Checkbox gray
|
||||
0, 0, 0, 0, 0,
|
||||
1, 1, 1, 1, 1,
|
||||
1, 0, 1, 0, 1,
|
||||
@@ -1002,7 +1002,7 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
|
||||
|
||||
// notify the others that we messed up their character set.
|
||||
// Unused for heartbeats as we should always leave that icon alone.
|
||||
//
|
||||
//
|
||||
// Leaving this in the code as notification for other similar cases
|
||||
if (p->custom == bign) {
|
||||
debug(RPT_DEBUG, "%s: Switching to beat", __FUNCTION__);
|
||||
@@ -1074,9 +1074,9 @@ pyramid_icon (Driver *drvthis, int x, int y, int icon)
|
||||
|
||||
|
||||
/*
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
pyramid_num (Driver *drvthis, int x, int num){};
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
pyramid_heartbeat (Driver *drvthis, int state){};
|
||||
*/
|
||||
|
||||
@@ -1087,7 +1087,7 @@ pyramid_heartbeat (Driver *drvthis, int state){};
|
||||
* \param y Vertical cursor position (row).
|
||||
* \param state New cursor state.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
pyramid_cursor (Driver *drvthis, int x, int y, int state)
|
||||
{
|
||||
PrivateData *p = (PrivateData *) drvthis->private_data;
|
||||
@@ -1116,15 +1116,15 @@ pyramid_cursor (Driver *drvthis, int x, int y, int state)
|
||||
|
||||
#if 0
|
||||
// all of these are not supported by the display (data sheet)
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
pyramid_get_contrast (Driver *drvthis){return 0;};
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
pyramid_set_contrast (Driver *drvthis, int promille){};
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
pyramid_get_brightness (Driver *drvthis, int state){return 0;};
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
pyramid_set_brightness (Driver *drvthis, int state, int promille){};
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
pyramid_backlight (Driver *drvthis, int on)
|
||||
#endif
|
||||
|
||||
@@ -1136,13 +1136,13 @@ pyramid_backlight (Driver *drvthis, int on)
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \param state Integer with bits representing port states.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
pyramid_output (Driver *drvthis, int state)
|
||||
{
|
||||
PrivateData *p = (PrivateData *) drvthis->private_data;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 7; i++)
|
||||
for (i = 0; i < 7; i++)
|
||||
p->led[i] = state & (1 << i);
|
||||
|
||||
set_leds(p);
|
||||
@@ -1172,7 +1172,7 @@ pyramid_get_key (Driver *drvthis)
|
||||
PrivateData *p = (PrivateData *) drvthis->private_data;
|
||||
|
||||
/* Now we read everything from the display,
|
||||
* 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)
|
||||
*/
|
||||
|
||||
|
||||
+11
-11
@@ -196,11 +196,11 @@
|
||||
* type=G191D
|
||||
* type=G2446
|
||||
* type=SP14Q002
|
||||
*
|
||||
*
|
||||
* You can also change the wiring scheme by using the ConnectionType= option:
|
||||
* ConnectionType=<classic|bitshaker>
|
||||
* If not set, classic wiring is used.
|
||||
*
|
||||
*
|
||||
* The port= value should be set to the LPT port address that the LCD is
|
||||
* connected to. Examples:
|
||||
* port=0x378
|
||||
@@ -428,7 +428,7 @@ sed1330_init( Driver * drvthis )
|
||||
// Use classic wiring
|
||||
p->A0 = SEL; // port 17
|
||||
p->nRESET = STRB; // port 1
|
||||
p->nWR = INIT; // port 16
|
||||
p->nWR = INIT; // port 16
|
||||
} else if(strcmp(s, "bitshaker") == 0) {
|
||||
// Use bitshaker wiring
|
||||
p->A0 = nLF; // port 14
|
||||
@@ -437,7 +437,7 @@ sed1330_init( Driver * drvthis )
|
||||
} else {
|
||||
report(RPT_ERR, "%s: Unknown ConnectionType %s", drvthis->name, s);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
report(RPT_INFO, "%s: Using ConnectionType %s", drvthis->name, s);
|
||||
|
||||
// Keypad ?
|
||||
@@ -502,14 +502,14 @@ sed1330_init( Driver * drvthis )
|
||||
if (p->framebuf_text == NULL) {
|
||||
report(RPT_ERR, "%s: error allocating text framebuffer", drvthis->name);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
memset(p->framebuf_text, ' ', p->bytesperline * p->textlines_in_memory);
|
||||
|
||||
p->lcd_contents_text = (unsigned char *) malloc(p->bytesperline * p->textlines_in_memory);
|
||||
if (p->lcd_contents_text == NULL) {
|
||||
report(RPT_ERR, "%s: error allocating lcd_contents_text", drvthis->name);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
memset(p->lcd_contents_text, 0, p->bytesperline * p->textlines_in_memory);
|
||||
|
||||
p->framebuf_graph = (unsigned char *) malloc(p->bytesperline * p->graph_height);
|
||||
@@ -523,7 +523,7 @@ sed1330_init( Driver * drvthis )
|
||||
if (p->lcd_contents_graph == NULL) {
|
||||
report(RPT_ERR, "%s: error allocating lcd_contents_graph", drvthis->name);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
memset(p->lcd_contents_graph, 0xFF, p->bytesperline * p->graph_height);
|
||||
|
||||
// Arrange for access to port
|
||||
@@ -538,7 +538,7 @@ sed1330_init( Driver * drvthis )
|
||||
report(RPT_ERR, "%s: timing_init() failed (%s)",
|
||||
drvthis->name, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// INITIALIZE THE LCD
|
||||
// End reset-state
|
||||
@@ -650,7 +650,7 @@ sed1330_close( Driver * drvthis )
|
||||
if (p->keyMapMatrix[i][j] != NULL)
|
||||
free(p->keyMapMatrix[i][j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (p->framebuf_text != NULL)
|
||||
free(p->framebuf_text);
|
||||
@@ -700,7 +700,7 @@ sed1330_height( Driver * drvthis )
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \return Number of pixel columns a character cell is wide.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
sed1330_cellwidth(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -716,7 +716,7 @@ PrivateData *p = drvthis->private_data;
|
||||
* \param drvthis Pointer to driver structure.
|
||||
* \return Number of pixel lines a character cell is high.
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
sed1330_cellheight(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
+34
-34
@@ -3,14 +3,14 @@
|
||||
* various protocols.
|
||||
*/
|
||||
|
||||
/* This is the LCDproc driver for Point Of Sale ("POS") devices using
|
||||
various protocols. While it currently only supports AEDEX,
|
||||
/* This is the LCDproc driver for Point Of Sale ("POS") devices using
|
||||
various protocols. While it currently only supports AEDEX,
|
||||
it can be extended to provide support for many POS emulation types.
|
||||
|
||||
Copyright (C) 2006, 2007 Eric Pooch
|
||||
|
||||
This driver is based on MtxOrb.c driver and is subject to its copyrights.
|
||||
|
||||
|
||||
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
|
||||
@@ -107,7 +107,7 @@ get_info Implemented.
|
||||
|
||||
|
||||
typedef enum {
|
||||
POS_IEE = 0,
|
||||
POS_IEE = 0,
|
||||
POS_AEDEX, /* http://www.posguys.com/download/CD5220_Manual.pdf */
|
||||
POS_Epson, /* http://www.barcode-manufacturer.com/pdf/vfd_manual.pdf */
|
||||
POS_Emax,
|
||||
@@ -146,7 +146,7 @@ typedef enum {
|
||||
/** private data for the \c serialPOS driver */
|
||||
typedef struct serialPOS_private_data {
|
||||
int fd; /**< LCD file descriptor */
|
||||
|
||||
|
||||
/* dimensions */
|
||||
int width, height;
|
||||
int cellwidth, cellheight;
|
||||
@@ -157,7 +157,7 @@ typedef struct serialPOS_private_data {
|
||||
|
||||
/* defineable characters */
|
||||
CGmode ccmode;
|
||||
|
||||
|
||||
/* feature enable */
|
||||
int hardwrap;
|
||||
int hardscroll;
|
||||
@@ -243,7 +243,7 @@ serialPOS_init (Driver *drvthis)
|
||||
p->hardscroll = 0;
|
||||
|
||||
p->emulation_mode = POS_AEDEX;
|
||||
|
||||
|
||||
debug(RPT_INFO, "serialPOS: init(%p)", drvthis);
|
||||
|
||||
/* READ CONFIG FILE */
|
||||
@@ -395,7 +395,7 @@ serialPOS_close (Driver *drvthis)
|
||||
p->backingstore = NULL;
|
||||
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
drvthis->store_private_ptr(drvthis, NULL);
|
||||
debug(RPT_DEBUG, "serialPOS: closed");
|
||||
}
|
||||
@@ -552,19 +552,19 @@ serialPOS_flush (Driver *drvthis)
|
||||
|
||||
/* there are differences, ... */
|
||||
report(RPT_DEBUG, "%s: l=%d string='%.*s'", __FUNCTION__, i, p->width, sp);
|
||||
|
||||
|
||||
switch ((int)p->emulation_mode) {
|
||||
case POS_AEDEX: {
|
||||
|
||||
|
||||
int command = i+1;
|
||||
if ( i == 0 && p->hardscroll == 1 )
|
||||
command = AEDEXContinuousScroll;
|
||||
|
||||
|
||||
snprintf(out, length, "%s%d%.*s%c", AEDEXPrefix, command, p->width, sp, 13);
|
||||
debug(RPT_DEBUG, "%s%d%.*s%c", AEDEXPrefix, command, p->width, sp, 13);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
default:
|
||||
/* Send to correct line, then write the data */
|
||||
serialPOS_cursor_goto(drvthis, 1, i+1);
|
||||
@@ -618,10 +618,10 @@ serialPOS_hardware_init(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
|
||||
|
||||
switch ((int)p->emulation_mode) {
|
||||
case POS_AEDEX: {
|
||||
/* The # character might interfere with the AEDEX command set,
|
||||
/* The # character might interfere with the AEDEX command set,
|
||||
so change the AEDEX attention code.
|
||||
*/
|
||||
unsigned int length = 8;
|
||||
@@ -635,11 +635,11 @@ serialPOS_hardware_init(Driver *drvthis)
|
||||
case POS_Epson:
|
||||
write(p->fd, "\x1B\x40", 2);
|
||||
break;
|
||||
|
||||
|
||||
case POS_LogicControls:
|
||||
write(p->fd, "\x11", 1);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@@ -655,29 +655,29 @@ serialPOS_hardware_clear (Driver *drvthis)
|
||||
{
|
||||
/* Do a hardware clear, if possible. */
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
|
||||
switch ((int)p->emulation_mode) {
|
||||
case POS_AEDEX: {
|
||||
unsigned int length = 7;
|
||||
char out[length];
|
||||
|
||||
|
||||
snprintf(out, length, "%s%c %d", AEDEXPrefix, AEDEXAllLineDisplay, 13);
|
||||
write(p->fd, out, length);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case POS_Epson:
|
||||
write(p->fd, "\x0C", 1);
|
||||
break;
|
||||
|
||||
|
||||
case POS_LogicControls:
|
||||
write(p->fd, "\x1F", 1);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
debug(RPT_DEBUG, "serialPOS: cleared LCD");
|
||||
}
|
||||
|
||||
@@ -691,7 +691,7 @@ static void
|
||||
serialPOS_linewrap (Driver *drvthis, int on)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
|
||||
p->hardwrap = on;
|
||||
|
||||
debug(RPT_DEBUG, "serialPOS: linewrap turned %s", (on) ? "on" : "off");
|
||||
@@ -741,24 +741,24 @@ serialPOS_cursor_goto(Driver *drvthis, int x, int y)
|
||||
PrivateData *p = drvthis->private_data;
|
||||
unsigned int length = 8;
|
||||
char out[length];
|
||||
|
||||
|
||||
switch ((int)p->emulation_mode) {
|
||||
case POS_Epson:
|
||||
case POS_Epson:
|
||||
length = 7;
|
||||
|
||||
|
||||
snprintf(out, length, "%c%c%02d%02d", 0x1F, 0x24, x, y);
|
||||
break;
|
||||
|
||||
|
||||
case POS_LogicControls:
|
||||
length = 4;
|
||||
|
||||
|
||||
snprintf(out, length, "%c%02d", 0x10, (x-1+((y-1)*(p->width))));
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
write(p->fd, out, length);
|
||||
}
|
||||
|
||||
@@ -899,11 +899,11 @@ serialPOS_num(Driver * drvthis, int x, int num)
|
||||
* \param y Vertical cursor position (row).
|
||||
* \param state New cursor state.
|
||||
*/
|
||||
MODULE_EXPORT void
|
||||
MODULE_EXPORT void
|
||||
serialPOS_cursor (Driver *drvthis, int x, int y, int state)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
|
||||
switch ((int)p->emulation_mode) {
|
||||
case POS_LogicControls:
|
||||
switch (state) {
|
||||
@@ -917,7 +917,7 @@ serialPOS_cursor (Driver *drvthis, int x, int y, int state)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
/* set cursor state not supported */
|
||||
break;
|
||||
@@ -988,7 +988,7 @@ serialPOS_get_key (Driver *drvthis)
|
||||
key = "Escape";
|
||||
break;
|
||||
default:
|
||||
report(RPT_DEBUG, "%s get_key: illegal key 0x%02X",
|
||||
report(RPT_DEBUG, "%s get_key: illegal key 0x%02X",
|
||||
drvthis->name, buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -142,11 +142,11 @@ serialVFD_init (Driver *drvthis)
|
||||
|
||||
|
||||
debug(RPT_INFO, "%s(%p)", __FUNCTION__, drvthis);
|
||||
|
||||
|
||||
/* Read config file */
|
||||
|
||||
p->use_parallel = drvthis->config_get_bool(drvthis->name, "use_parallel", 0, 0);
|
||||
|
||||
|
||||
/* Which device should be used */
|
||||
strncpy(p->device, drvthis->config_get_string(drvthis->name, "Device", 0, DEFAULT_DEVICE), sizeof(p->device));
|
||||
p->device[sizeof(p->device)-1] = '\0';
|
||||
@@ -210,7 +210,7 @@ serialVFD_init (Driver *drvthis)
|
||||
|
||||
/* Which displaytype */
|
||||
p->display_type = drvthis->config_get_int(drvthis->name, "Type", 0, DEFAULT_DISPLAYTYPE);
|
||||
|
||||
|
||||
/* Number of custom characters */
|
||||
tmp = drvthis->config_get_int(drvthis->name, "Custom-Characters", 0, -83);
|
||||
if ((tmp < 0) || (tmp > 99)) {
|
||||
@@ -425,13 +425,13 @@ serialVFD_flush (Driver *drvthis)
|
||||
Port_Function[p->use_parallel].write_fkt(drvthis, &p->hw_cmd[pos1_cursor][1], p->hw_cmd[pos1_cursor][0]);
|
||||
last_chr = -1;
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < (p->height * p->width); i++) {
|
||||
|
||||
|
||||
/* Backing-store implementation. If it's already
|
||||
* on the screen, don't put it there again
|
||||
*/
|
||||
|
||||
|
||||
if ((p->framebuf[i] != p->backingstore[i]) || (p->hw_cmd[hor_tab][0] == 0) ||
|
||||
((p->framebuf[i] <= 30) && (custom_char_changed[(int)p->framebuf[i]] != 0))) {
|
||||
if (last_chr < i-1) { // if not last char written cursor has to be moved.
|
||||
|
||||
@@ -104,7 +104,7 @@ typedef struct serialVFD_private_data {
|
||||
unsigned char hw_cmd[11][10]; // hardwarespecific commands
|
||||
int usr_chr_dot_assignment[57]; // how to setup usercharacters
|
||||
unsigned int usr_chr_mapping[31];// where to place the usercharacters (0..30) in the asciicode
|
||||
unsigned int usr_chr_load_mapping[31];// needed for displays with different read and write mapping
|
||||
unsigned int usr_chr_load_mapping[31];// needed for displays with different read and write mapping
|
||||
int hbar_cc_offset; // character offset of the bars
|
||||
int vbar_cc_offset; // character offset of the bars
|
||||
char info[255];
|
||||
|
||||
@@ -108,15 +108,15 @@ serialVFD_load_NEC_FIPC (Driver *drvthis)
|
||||
{1 ,0x03},
|
||||
{1 ,0x02},
|
||||
{1 ,0x01}, // bright
|
||||
{1 ,0x0D}, // pos1
|
||||
{1 ,0x0D}, // pos1
|
||||
// pos1 command is only used (and needed), when mv_cursor command is not supported
|
||||
{1 ,0x1B}, // move cursor (set to 0 if not supported)
|
||||
{1 ,0x0C}, // reset
|
||||
{2 ,0x14, 0x11}, // init
|
||||
{1 ,0x1A}, // set user char
|
||||
{1 ,0x09}, // tab
|
||||
{1 ,0x09}, // tab
|
||||
{0 }}; // next_line (only used in line mode)
|
||||
// Line mode will be used if Next_line command is set!!!
|
||||
// Line mode will be used if Next_line command is set!!!
|
||||
// Do not set if the display supports normal mode (most displays should do this).
|
||||
|
||||
for (tmp = 0; tmp < 11; tmp++)
|
||||
@@ -467,7 +467,7 @@ serialVFD_load_IEE_95B (Driver *drvthis)
|
||||
{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8, 0xF7, 0xF6};
|
||||
for (tmp = 0; tmp < 31; tmp++)
|
||||
p->usr_chr_mapping[tmp] = usr_chr_mapping[tmp];
|
||||
|
||||
|
||||
// The following is only needet to set if the display needs a different setting
|
||||
// for loading the usercharacters.
|
||||
// Example: The character loaded to 0x00 will be shown at 0xFD.
|
||||
@@ -556,7 +556,7 @@ serialVFD_load_IEE_96 (Driver *drvthis)
|
||||
{0xFF, 0xFE, 0xFD};
|
||||
for (tmp = 0; tmp < 31; tmp++)
|
||||
p->usr_chr_mapping[tmp] = usr_chr_mapping[tmp];
|
||||
|
||||
|
||||
// The following is only needet to set if the display needs a different setting
|
||||
// for loading the usercharacters.
|
||||
// Example: The character loaded to 0x00 will be shown at 0xFD.
|
||||
@@ -589,7 +589,7 @@ serialVFD_load_Futaba_NA202SD08FA (Driver *drvthis)
|
||||
const char hw_cmd[10][4] ={{2 ,0x04, 0x20}, // dark
|
||||
{2 ,0x04, 0x40},
|
||||
{2 ,0x04, 0x60},
|
||||
{2 ,0x04, 0xFF}, // bright
|
||||
{2 ,0x04, 0xFF}, // bright
|
||||
{1 ,0x16}, // pos1
|
||||
{1 ,0x1B}, // move cursor (set to 0 if not supported)
|
||||
{1 ,0x15}, // reset
|
||||
@@ -639,7 +639,7 @@ serialVFD_load_Futaba_NA202SD08FA (Driver *drvthis)
|
||||
{0,0,0,0,0,0, 0xF4, 0xF4, 0xF5, 0xF6, 0xF6, 0xF7, 0, 0xF0, 0xF1, 0xF2, 0xF3};
|
||||
for (tmp = 0; tmp < 31; tmp++)
|
||||
p->usr_chr_mapping[tmp] = usr_chr_mapping[tmp];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -748,10 +748,10 @@ serialVFD_load_Nixdorf_BA6x (Driver *drvthis)
|
||||
{4 ,0x1B, 0x5B, 0x32, 0x4A}, // reset
|
||||
{3 ,0x1B, 0x52, 0x00}, // init
|
||||
{0 }, // set user char
|
||||
{0 }, // tab
|
||||
{0 }, // tab
|
||||
{2 ,0x0D, 0x0A} // next_line
|
||||
// Next_line command is only used in line mode.
|
||||
// Line mode will be used if Next_line command is set!!!
|
||||
// Next_line command is only used in line mode.
|
||||
// Line mode will be used if Next_line command is set!!!
|
||||
// Set to "0" if display supports normal_mode!
|
||||
};
|
||||
for (tmp = 0; tmp < 11; tmp++)
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
* ShuttleVFD driver
|
||||
*
|
||||
* Copyright (C) 2007 Thien Vu
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*
|
||||
* Copyright (c) 2001 Manuel Stahl <mythos@xmythos.de>
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -487,7 +487,7 @@ t6963_low_dsp_ready (Driver *drvthis)
|
||||
t6963_low_set_control(drvthis, 1, 0, 1, 0);
|
||||
t6963_low_set_control(drvthis, 1, 1, 1, 1);
|
||||
port_out(0x80, 0x00); // wait 1ms
|
||||
}
|
||||
}
|
||||
T6963_DATAOUT(p->port);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
*/
|
||||
|
||||
/* Copyright (C) 1998-2004 The LCDproc Team
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||
@@ -121,7 +121,7 @@ text_close (Driver *drvthis)
|
||||
free(p->framebuf);
|
||||
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
drvthis->store_private_ptr(drvthis, NULL);
|
||||
}
|
||||
|
||||
|
||||
+32
-32
@@ -2,7 +2,7 @@
|
||||
* LCDd \c tyan driver for the CLD module found in Tyan GS series barebones.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
Author: yhlu@tyan.com
|
||||
|
||||
Copyright (C) 2004 Tyan Corp
|
||||
@@ -60,7 +60,7 @@ static void tyan_lcdm_hardware_clear(int fd);
|
||||
|
||||
static void tyan_lcdm_set_rampos(int fd, unsigned char pos);
|
||||
static void tyan_lcdm_write_str(int fd, unsigned char *str, unsigned char start_addr, int length);
|
||||
#if 0
|
||||
#if 0
|
||||
static void tyan_lcdm_set_cursor(int fd, unsigned char start_addr, int pos);
|
||||
#endif
|
||||
static unsigned char tyan_lcdm_read_key(int fd);
|
||||
@@ -119,7 +119,7 @@ tyan_lcdm_init (Driver *drvthis, char *args)
|
||||
if (tmp == 4800) p->speed = B4800;
|
||||
else if (tmp == 9600) p->speed = B9600;
|
||||
else {
|
||||
report(RPT_WARNING, "%s: Speed must be 4800 or 9600; using default %d",
|
||||
report(RPT_WARNING, "%s: Speed must be 4800 or 9600; using default %d",
|
||||
drvthis->name, DEFAULT_SPEED);
|
||||
p->speed = 9600;
|
||||
}
|
||||
@@ -233,7 +233,7 @@ tyan_lcdm_height (Driver *drvthis)
|
||||
/*
|
||||
* Returns the display's character cell width
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
tyan_lcmd_cellwidth(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -245,7 +245,7 @@ PrivateData *p = drvthis->private_data;
|
||||
/*
|
||||
* Returns the display's character cell height
|
||||
*/
|
||||
MODULE_EXPORT int
|
||||
MODULE_EXPORT int
|
||||
tyan_lcmd_cellheight(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
@@ -318,7 +318,7 @@ tyan_lcdm_get_key (Driver *drvthis)
|
||||
return "Right";
|
||||
break;
|
||||
case TYAN_LCDM_KEY_ENTER:
|
||||
return "Enter";
|
||||
return "Enter";
|
||||
break;
|
||||
case TYAN_LCDM_KEY_ESCAPE:
|
||||
return "Escape";
|
||||
@@ -517,7 +517,7 @@ MODULE_EXPORT int
|
||||
tyan_lcdm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
static unsigned char heart_open[] =
|
||||
static unsigned char heart_open[] =
|
||||
{ b__XXXXX,
|
||||
b__X_X_X,
|
||||
b_______,
|
||||
@@ -526,7 +526,7 @@ tyan_lcdm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XX_XX,
|
||||
b__XXXXX };
|
||||
static unsigned char heart_filled[] =
|
||||
static unsigned char heart_filled[] =
|
||||
{ b__XXXXX,
|
||||
b__X_X_X,
|
||||
b___X_X_,
|
||||
@@ -535,7 +535,7 @@ tyan_lcdm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b__X_X_X,
|
||||
b__XX_XX,
|
||||
b__XXXXX };
|
||||
static unsigned char arrow_up[] =
|
||||
static unsigned char arrow_up[] =
|
||||
{ b____X__,
|
||||
b___XXX_,
|
||||
b__X_X_X,
|
||||
@@ -544,7 +544,7 @@ tyan_lcdm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b____X__,
|
||||
b____X__,
|
||||
b_______ };
|
||||
static unsigned char arrow_down[] =
|
||||
static unsigned char arrow_down[] =
|
||||
{ b____X__,
|
||||
b____X__,
|
||||
b____X__,
|
||||
@@ -554,7 +554,7 @@ tyan_lcdm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b____X__,
|
||||
b_______ };
|
||||
/*
|
||||
static unsigned char arrow_left[] =
|
||||
static unsigned char arrow_left[] =
|
||||
{ b_______,
|
||||
b____X__,
|
||||
b___X___,
|
||||
@@ -563,7 +563,7 @@ tyan_lcdm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b____X__,
|
||||
b_______,
|
||||
b_______ };
|
||||
static unsigned char arrow_right[] =
|
||||
static unsigned char arrow_right[] =
|
||||
{ b_______,
|
||||
b____X__,
|
||||
b_____X_,
|
||||
@@ -573,7 +573,7 @@ tyan_lcdm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b_______,
|
||||
b_______ };
|
||||
*/
|
||||
static unsigned char checkbox_off[] =
|
||||
static unsigned char checkbox_off[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b__XXXXX,
|
||||
@@ -582,7 +582,7 @@ tyan_lcdm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
static unsigned char checkbox_on[] =
|
||||
static unsigned char checkbox_on[] =
|
||||
{ b____X__,
|
||||
b____X__,
|
||||
b__XXX_X,
|
||||
@@ -591,7 +591,7 @@ tyan_lcdm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b__X___X,
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
static unsigned char checkbox_gray[] =
|
||||
static unsigned char checkbox_gray[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b__XXXXX,
|
||||
@@ -601,7 +601,7 @@ tyan_lcdm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b__XXXXX,
|
||||
b_______ };
|
||||
/*
|
||||
static unsigned char selector_left[] =
|
||||
static unsigned char selector_left[] =
|
||||
{ b___X___,
|
||||
b___XX__,
|
||||
b___XXX_,
|
||||
@@ -610,7 +610,7 @@ tyan_lcdm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b___XX__,
|
||||
b___X___,
|
||||
b_______ };
|
||||
static unsigned char selector_right[] =
|
||||
static unsigned char selector_right[] =
|
||||
{ b_____X_,
|
||||
b____XX_,
|
||||
b___XXX_,
|
||||
@@ -619,7 +619,7 @@ tyan_lcdm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b____XX_,
|
||||
b_____X_,
|
||||
b_______ };
|
||||
static unsigned char ellipsis[] =
|
||||
static unsigned char ellipsis[] =
|
||||
{ b_______,
|
||||
b_______,
|
||||
b_______,
|
||||
@@ -628,7 +628,7 @@ tyan_lcdm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b_______,
|
||||
b__X_X_X,
|
||||
b_______ };
|
||||
static unsigned char block_filled[] =
|
||||
static unsigned char block_filled[] =
|
||||
{ b__XXXXX,
|
||||
b__XXXXX,
|
||||
b__XXXXX,
|
||||
@@ -637,7 +637,7 @@ tyan_lcdm_icon (Driver *drvthis, int x, int y, int icon)
|
||||
b__XXXXX,
|
||||
b__XXXXX,
|
||||
b__XXXXX };
|
||||
*/
|
||||
*/
|
||||
|
||||
/* Yes we know, this is a VERY BAD implementation :-) */
|
||||
switch (icon) {
|
||||
@@ -761,7 +761,7 @@ tyan_lcdm_hardware_clear(int fd)
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
static
|
||||
void tyan_lcdm_set_rampos(int fd, unsigned char pos)
|
||||
{
|
||||
char cmd_str[5] = { TYAN_LCDM_CMD_BEGIN, 0x70, 0x00, 0x00, TYAN_LCDM_CMD_END };
|
||||
@@ -771,10 +771,10 @@ void tyan_lcdm_set_rampos(int fd, unsigned char pos)
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
static
|
||||
void tyan_lcdm_write_str(int fd, unsigned char *str,unsigned char start_addr, int length)
|
||||
{
|
||||
//CGRAM 0x40, 0x48,....
|
||||
//CGRAM 0x40, 0x48,....
|
||||
//if Line 1: start_addr = 0x80
|
||||
//if Line 2: start_addr = 0xc0
|
||||
// 1<= length <=16
|
||||
@@ -788,28 +788,28 @@ void tyan_lcdm_write_str(int fd, unsigned char *str,unsigned char start_addr, in
|
||||
cmd_str[19] = TYAN_LCDM_CMD_END;
|
||||
memcpy(cmd_str+3, str, (length < 16) ? length : 16);
|
||||
write(fd, cmd_str, 20);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
static
|
||||
#if 0
|
||||
static
|
||||
void tyan_lcdm_set_cursor(int fd, unsigned char start_addr, int pos)
|
||||
{
|
||||
char cmd_str[5] = { TYAN_LCDM_CMD_BEGIN, 0x70, 0x00, 0x0e, TYAN_LCDM_CMD_END };
|
||||
char cmd_str[5] = { TYAN_LCDM_CMD_BEGIN, 0x70, 0x00, 0x0e, TYAN_LCDM_CMD_END };
|
||||
|
||||
tyan_lcdm_set_rampos(pos+start_addr);
|
||||
write(fd,cmd_str,5);
|
||||
}
|
||||
tyan_lcdm_set_rampos(pos+start_addr);
|
||||
write(fd,cmd_str,5);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Note: this implementation works although it differs from the documentation
|
||||
* available at ftp://ftp.tyan.com/barebone_support/GS10-GS12%20LCD-Pack.zip
|
||||
* (i.e. with respect to this the docs are wrong) */
|
||||
static
|
||||
static
|
||||
unsigned char tyan_lcdm_read_key(int fd)
|
||||
{
|
||||
int count = 0;
|
||||
int count = 0;
|
||||
char key_str[4];
|
||||
|
||||
memset(key_str, '\0', 4);
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
// display).
|
||||
//
|
||||
// I tried several hours to fix this, I simply find the reason for this problem.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Implementation note:
|
||||
//
|
||||
@@ -239,7 +239,7 @@ typedef struct ula200_private_data {
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Reads a USB characters
|
||||
// Reads a USB characters
|
||||
static inline int
|
||||
ula200_ftdi_usb_read(PrivateData *p)
|
||||
{
|
||||
@@ -262,7 +262,7 @@ ula200_ftdi_usb_read(PrivateData *p)
|
||||
//
|
||||
// @return true if ACK was responded, false if NACk was responded
|
||||
//
|
||||
static bool
|
||||
static bool
|
||||
ula200_ftdi_read_response(Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = (PrivateData *) drvthis->private_data;
|
||||
@@ -318,7 +318,7 @@ ula200_ftdi_read_response(Driver *drvthis)
|
||||
// @param p the private data
|
||||
// @param data the data bytes
|
||||
// @param length the number of bytes in @p data which are valid
|
||||
// @param escape if the data should be escaped (see the User's Guide of the
|
||||
// @param escape if the data should be escaped (see the User's Guide of the
|
||||
// ULA-200)
|
||||
// @return 0 on success, negative value on error
|
||||
//
|
||||
@@ -480,7 +480,7 @@ ula200_ftdi_string(Driver *drvthis, const unsigned char *string, int len)
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Enables the raw register access mode.
|
||||
//
|
||||
static int
|
||||
static int
|
||||
ula200_ftdi_enable_raw_mode(Driver *drvthis)
|
||||
{
|
||||
unsigned char command[3];
|
||||
@@ -635,14 +635,14 @@ ula200_init(Driver *drvthis)
|
||||
for (i = 0; i < MAX_KEY_MAP; i++) {
|
||||
char buf[40];
|
||||
|
||||
// First fill with default value
|
||||
// First fill with default value
|
||||
p->key_map[i] = default_key_map[i];
|
||||
|
||||
// Read config value
|
||||
// Read config value
|
||||
sprintf(buf, "KeyMap_%c", i+'A');
|
||||
s = drvthis->config_get_string(drvthis->name, buf, 0, NULL);
|
||||
|
||||
// Was a key specified in the config file ?
|
||||
// Was a key specified in the config file ?
|
||||
if (s != NULL) {
|
||||
p->key_map[i] = strdup(s);
|
||||
report(RPT_INFO, "%s: Key '%c' mapped to \"%s\"",
|
||||
@@ -903,7 +903,7 @@ ula200_flush(Driver *drvthis)
|
||||
|
||||
if (firstdiff >= 0) {
|
||||
ula200_ftdi_position(drvthis, firstdiff, y);
|
||||
ula200_ftdi_string(drvthis, p->framebuf + (y*wid) + firstdiff,
|
||||
ula200_ftdi_string(drvthis, p->framebuf + (y*wid) + firstdiff,
|
||||
lastdiff - firstdiff + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* LCDd \c xosd driver for on screen display on X windows.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
Copyright(C) 2005 Peter Marschall <peter@adpm.de>
|
||||
|
||||
based on GPL'ed code:
|
||||
@@ -123,8 +123,8 @@ xosdlib_drv_init (Driver *drvthis)
|
||||
if (sscanf(offset, "%dx%d", &x, &y) != 2) {
|
||||
report(RPT_WARNING, "%s: cannot read Offset: %s. using default %s",
|
||||
drvthis->name, offset, DEFAULT_OFFSET);
|
||||
sscanf(DEFAULT_OFFSET, "%dx%d", &x, &y);
|
||||
}
|
||||
sscanf(DEFAULT_OFFSET, "%dx%d", &x, &y);
|
||||
}
|
||||
p->xoffs= x;
|
||||
p->yoffs = y;
|
||||
|
||||
@@ -162,7 +162,7 @@ xosdlib_drv_init (Driver *drvthis)
|
||||
if (p->osd == NULL) {
|
||||
report(RPT_ERR, "%s: xosd_create() failed", drvthis->name);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* set font */
|
||||
if (xosd_set_font(p->osd, p->font) != 0) {
|
||||
@@ -227,7 +227,7 @@ xosdlib_drv_close (Driver *drvthis)
|
||||
p->backingstore = NULL;
|
||||
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
drvthis->store_private_ptr(drvthis, NULL);
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ xosdlib_drv_flush (Driver *drvthis)
|
||||
|
||||
debug(RPT_DEBUG, "xosd: flushed string \"%s\" at (%d,%d)", buffer, 0, i);
|
||||
xosd_display(p->osd, i, XOSD_string, buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@ xosdlib_drv_string (Driver *drvthis, int x, int y, const char string[])
|
||||
if (c == 255)
|
||||
c = '#';
|
||||
p->framebuf[(y * p->width) + x++] = c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -461,7 +461,7 @@ xosdlib_drv_get_contrast (Driver *drvthis)
|
||||
|
||||
/**
|
||||
* Change display contrast.
|
||||
* \note
|
||||
* \note
|
||||
* This is currently not implemented.
|
||||
*
|
||||
* \param drvthis Pointer to driver structure.
|
||||
|
||||
+8
-8
@@ -90,7 +90,7 @@
|
||||
#define DEFAULT_TITLESPEED TITLESPEED_MAX
|
||||
|
||||
/* All variables are set to 'unset' values*/
|
||||
#define UNSET_INT -1
|
||||
#define UNSET_INT -1
|
||||
#define UNSET_STR "\01"
|
||||
|
||||
/* Socket to bind to...
|
||||
@@ -316,11 +316,11 @@ process_command_line(int argc, char **argv)
|
||||
drivernames[num_drivers] = strdup(optarg);
|
||||
if (drivernames[num_drivers] != NULL) {
|
||||
num_drivers++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
report(RPT_ERR, "alloc error storing driver name: %s", optarg);
|
||||
e = -1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
report(RPT_ERR, "Too many drivers!");
|
||||
e = -1;
|
||||
@@ -451,7 +451,7 @@ process_configfile(char *configfile)
|
||||
titlespeed = (speed <= TITLESPEED_NO)
|
||||
? TITLESPEED_NO
|
||||
: min(speed, TITLESPEED_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
if (report_dest == UNSET_INT) {
|
||||
int rs = config_get_bool("Server", "ReportToSyslog", 0, UNSET_INT);
|
||||
@@ -480,7 +480,7 @@ process_configfile(char *configfile)
|
||||
if (drivernames[num_drivers] == NULL) {
|
||||
report(RPT_ERR, "alloc error storing driver name: %s", s);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
num_drivers++;
|
||||
}
|
||||
}
|
||||
@@ -530,7 +530,7 @@ set_default_settings(void)
|
||||
if (drivernames[0] == NULL) {
|
||||
report(RPT_ERR, "alloc error storing driver name: %s", DEFAULT_DRIVER);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
num_drivers = 1;
|
||||
}
|
||||
}
|
||||
@@ -549,7 +549,7 @@ install_signal_handlers(int allow_reload)
|
||||
|
||||
sigemptyset(&(sa.sa_mask));
|
||||
|
||||
/* Clients can cause SIGPIPE if they quit unexpectedly, and the
|
||||
/* Clients can cause SIGPIPE if they quit unexpectedly, and the
|
||||
* default action is to kill the server. Just ignore it. */
|
||||
sa.sa_handler = SIG_IGN;
|
||||
sigaction(SIGPIPE, &sa, NULL);
|
||||
@@ -893,7 +893,7 @@ interpret_boolean_arg(char *s)
|
||||
{
|
||||
/* keep these checks consistent with config_get_boolean() */
|
||||
if (strcasecmp(s, "0") == 0 || strcasecmp(s, "false") == 0
|
||||
|| strcasecmp(s, "n") == 0 || strcasecmp(s, "no") == 0
|
||||
|| strcasecmp(s, "n") == 0 || strcasecmp(s, "no") == 0
|
||||
|| strcasecmp(s, "off") == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
+7
-7
@@ -5,7 +5,7 @@
|
||||
* It works much like a command line. Only the first token is used to
|
||||
* determine what function to call.
|
||||
*/
|
||||
|
||||
|
||||
/* This file is part of LCDd, the lcdproc server.
|
||||
*
|
||||
* This file is released under the GNU General Public License.
|
||||
@@ -85,7 +85,7 @@ static int parse_message(const char *str, Client *c)
|
||||
if (is_final(ch)) {
|
||||
state = ST_FINAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* otherwise fall through */
|
||||
state = ST_ARGUMENT;
|
||||
case ST_ARGUMENT:
|
||||
@@ -140,7 +140,7 @@ static int parse_message(const char *str, Client *c)
|
||||
}
|
||||
else if (is_opening_quote(ch, quote)) {
|
||||
quote = ch;
|
||||
}
|
||||
}
|
||||
else if (is_closing_quote(ch, quote)) {
|
||||
quote = '\0';
|
||||
if (argc >= MAX_ARGUMENTS-1) {
|
||||
@@ -165,10 +165,10 @@ static int parse_message(const char *str, Client *c)
|
||||
argpos = 0;
|
||||
}
|
||||
state = ST_WHITESPACE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
argv[argc][argpos++] = ch;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ST_FINAL:
|
||||
/* This will never be reached */
|
||||
@@ -190,7 +190,7 @@ static int parse_message(const char *str, Client *c)
|
||||
int i;
|
||||
for (i = 0; i < argc; i++) {
|
||||
printf("%s%c", argv[i], (i == argc-1) ? '\n' : ' ');
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Now find and call the appropriate function...*/
|
||||
@@ -201,7 +201,7 @@ static int parse_message(const char *str, Client *c)
|
||||
if (error) {
|
||||
sock_printf_error(c->sock, "Function returned error \"%.40s\"\n", argv[0]);
|
||||
report(RPT_WARNING, "Command function returned an error after command from client on socket %d: %.40s", c->sock, str);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
sock_printf_error(c->sock, "Invalid command \"%.40s\"\n", argv[0]);
|
||||
|
||||
+11
-11
@@ -94,8 +94,8 @@ server_screen_init(void)
|
||||
if ((w != NULL) && (w->text != NULL)) {
|
||||
strncpy(w->text, line, LCD_MAX_WIDTH);
|
||||
w->text[LCD_MAX_WIDTH] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* And enqueue the screen */
|
||||
@@ -162,13 +162,13 @@ update_server_screen(void)
|
||||
if ((w != NULL) && (w->text != NULL)) {
|
||||
snprintf(w->text, LCD_MAX_WIDTH,
|
||||
"Clients: %i", num_clients);
|
||||
}
|
||||
}
|
||||
|
||||
w = screen_find_widget(server_screen, "line3");
|
||||
if ((w != NULL) && (w->text != NULL)) {
|
||||
snprintf(w->text, LCD_MAX_WIDTH,
|
||||
"Screens: %i", num_screens);
|
||||
}
|
||||
}
|
||||
} else { /* 2-line display */
|
||||
w = screen_find_widget(server_screen, "line2");
|
||||
if ((w != NULL) && (w->text != NULL)) {
|
||||
@@ -177,7 +177,7 @@ update_server_screen(void)
|
||||
? "Cli: %i Scr: %i"
|
||||
: "C: %i S: %i"),
|
||||
num_clients, num_screens);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -194,14 +194,14 @@ goodbye_screen(void)
|
||||
|
||||
if (config_has_key("Server", "GoodBye")) { /* custom GoodBye */
|
||||
int i;
|
||||
|
||||
|
||||
/* loop over all display lines to read config & display message */
|
||||
for (i = 0; i < display_props->height; i++) {
|
||||
const char *line = config_get_string("Server", "GoodBye", i, "");
|
||||
|
||||
drivers_string(1, 1+i, line);
|
||||
}
|
||||
}
|
||||
}
|
||||
else { /* default GoodBye */
|
||||
if ((display_props->height >= 2) && (display_props->width >= 16)) {
|
||||
int xoffs = (display_props->width - 16) / 2;
|
||||
@@ -257,10 +257,10 @@ reset_server_screen(int rotate, int heartbeat, int title)
|
||||
if ((i == 0) && (title) && (rotate != SERVERSCREEN_BLANK)) {
|
||||
strncpy(w->text, "LCDproc Server", LCD_MAX_WIDTH);
|
||||
w->text[LCD_MAX_WIDTH] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+15
-15
@@ -95,7 +95,7 @@ sock_init(char* bind_addr, int bind_port)
|
||||
/* Create the socket and set it up to accept connections. */
|
||||
listening_fd = sock_create_inet_socket(bind_addr, bind_port);
|
||||
if (listening_fd < 0) {
|
||||
report(RPT_ERR, "%s: error creating socket - %s",
|
||||
report(RPT_ERR, "%s: error creating socket - %s",
|
||||
__FUNCTION__, sock_geterror());
|
||||
return -1;
|
||||
}
|
||||
@@ -103,7 +103,7 @@ sock_init(char* bind_addr, int bind_port)
|
||||
/* Create the socket -> Client mapping pool */
|
||||
/* How large can FD_SETSIZE be? Even if it is ~2000 this only uses a
|
||||
few kilobytes of memory. Let's trade size for speed! */
|
||||
freeClientSocketPool = (ClientSocketMap *)
|
||||
freeClientSocketPool = (ClientSocketMap *)
|
||||
calloc(FD_SETSIZE, sizeof(ClientSocketMap));
|
||||
if (freeClientSocketPool == NULL) {
|
||||
report(RPT_ERR, "%s: Error allocating client sockets.",
|
||||
@@ -205,13 +205,13 @@ sock_create_inet_socket(char *addr, unsigned int port)
|
||||
sock = socket(PF_INET, SOCK_STREAM, 0);
|
||||
if (sock < 0)
|
||||
{
|
||||
report(RPT_ERR, "%s: cannot create socket - %s",
|
||||
report(RPT_ERR, "%s: cannot create socket - %s",
|
||||
__FUNCTION__, sock_geterror());
|
||||
return -1;
|
||||
}
|
||||
/* Set the socket so we can re-use it*/
|
||||
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &sockopt, sizeof(sockopt)) < 0) {
|
||||
report(RPT_ERR, "%s: error setting socket option SO_REUSEADDR - %s",
|
||||
report(RPT_ERR, "%s: error setting socket option SO_REUSEADDR - %s",
|
||||
__FUNCTION__, sock_geterror());
|
||||
return -1;
|
||||
}
|
||||
@@ -223,14 +223,14 @@ sock_create_inet_socket(char *addr, unsigned int port)
|
||||
inet_aton(addr, &name.sin_addr);
|
||||
|
||||
if (bind(sock, (struct sockaddr *) &name, sizeof(name)) < 0) {
|
||||
report(RPT_ERR, "%s: cannot bind to port %d at address %s - %s",
|
||||
report(RPT_ERR, "%s: cannot bind to port %d at address %s - %s",
|
||||
__FUNCTION__, port, addr, sock_geterror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (listen(sock, 1) < 0) {
|
||||
report(RPT_ERR, "%s: error in attempting to listen to port "
|
||||
"%d at %s - %s",
|
||||
"%d at %s - %s",
|
||||
__FUNCTION__, port, addr, sock_geterror());
|
||||
return -1;
|
||||
}
|
||||
@@ -264,15 +264,15 @@ sock_poll_clients(void)
|
||||
read_fd_set = active_fd_set;
|
||||
|
||||
if (select(FD_SETSIZE, &read_fd_set, NULL, NULL, &t) < 0) {
|
||||
report(RPT_ERR, "%s: Select error - %s",
|
||||
report(RPT_ERR, "%s: Select error - %s",
|
||||
__FUNCTION__, sock_geterror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Service all the sockets with input pending. */
|
||||
LL_Rewind(openSocketList);
|
||||
for (clientSocket = (ClientSocketMap *) LL_Get(openSocketList);
|
||||
clientSocket != NULL;
|
||||
for (clientSocket = (ClientSocketMap *) LL_Get(openSocketList);
|
||||
clientSocket != NULL;
|
||||
clientSocket = LL_GetNext(openSocketList)) {
|
||||
|
||||
if (FD_ISSET(clientSocket->socket, &read_fd_set)) {
|
||||
@@ -285,7 +285,7 @@ sock_poll_clients(void)
|
||||
|
||||
new_sock = accept(listening_fd, (struct sockaddr *) &clientname, &size);
|
||||
if (new_sock < 0) {
|
||||
report(RPT_ERR, "%s: Accept error - %s",
|
||||
report(RPT_ERR, "%s: Accept error - %s",
|
||||
__FUNCTION__, sock_geterror());
|
||||
return -1;
|
||||
}
|
||||
@@ -313,7 +313,7 @@ sock_poll_clients(void)
|
||||
LL_Next(openSocketList);
|
||||
}
|
||||
else {
|
||||
report(RPT_ERR, "%s: Error - free client socket list exhausted - %d clients.",
|
||||
report(RPT_ERR, "%s: Error - free client socket list exhausted - %d clients.",
|
||||
__FUNCTION__, FD_SETSIZE);
|
||||
return -1;
|
||||
}
|
||||
@@ -368,7 +368,7 @@ sock_read_from_client(ClientSocketMap *clientSocketMap)
|
||||
if (clientSocketMap->client) {
|
||||
client_add_message(clientSocketMap->client, str);
|
||||
} else {
|
||||
report(RPT_DEBUG, "%s: Can't find client %d",
|
||||
report(RPT_DEBUG, "%s: Can't find client %d",
|
||||
__FUNCTION__, clientSocketMap->socket);
|
||||
}
|
||||
} while (str != NULL);
|
||||
@@ -453,7 +453,7 @@ sock_destroy_socket(void)
|
||||
|
||||
|
||||
/* return 1 if addr is valid IPv4 */
|
||||
int verify_ipv4(const char *addr)
|
||||
int verify_ipv4(const char *addr)
|
||||
{
|
||||
int result = -1;
|
||||
|
||||
@@ -467,7 +467,7 @@ int verify_ipv4(const char *addr)
|
||||
}
|
||||
|
||||
/* return 1 if addr is valid IPv6 */
|
||||
int verify_ipv6(const char *addr)
|
||||
int verify_ipv6(const char *addr)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
@@ -478,4 +478,4 @@ int verify_ipv6(const char *addr)
|
||||
result = inet_pton(AF_INET6, addr, &a);
|
||||
}
|
||||
return (result > 0) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -223,7 +223,7 @@ widget_search_subs(Widget *w, char *id)
|
||||
/** Find a widget icon by type.
|
||||
* \param icon Icon type.
|
||||
* \return Pointer to constant string containing the icon name.
|
||||
*/
|
||||
*/
|
||||
char *widget_icon_to_iconname(int icon)
|
||||
{
|
||||
int i;
|
||||
|
||||
Reference in New Issue
Block a user