add support vor vdr-wakeup

This commit is contained in:
marschap
2007-01-19 12:00:16 +00:00
parent 3651cb8ebc
commit d1f9493e22
2 changed files with 31 additions and 26 deletions
+5 -2
View File
@@ -181,7 +181,7 @@ hd_init_serial (Driver *drvthis)
/* Get serial device to use */
strncpy(device, drvthis->config_get_string(drvthis->name, "device", 0, DEFAULT_DEVICE), sizeof(device));
device[sizeof(device)-1]=0;
device[sizeof(device)-1] = '\0';
report (RPT_INFO,"HD44780: serial: using device: %s", device);
/* Set up io port correctly, and open it... */
@@ -243,7 +243,9 @@ serial_HD44780_senddata (PrivateData *p, unsigned char displayID, unsigned char
if (flags == RS_DATA) {
/* Do we need a DATA indicator byte? */
if( SERIAL_IF.data_escape!=0 && ch<SERIAL_IF.data_escape_max ) {
if ((SERIAL_IF.data_escape != '\0') &&
(ch >= SERIAL_IF.data_escape_min) &&
(ch < SERIAL_IF.data_escape_max)) {
write(p->fd, &SERIAL_IF.data_escape, 1);
}
write(p->fd, &ch, 1);
@@ -266,6 +268,7 @@ serial_HD44780_scankeypad (PrivateData *p)
{
unsigned char buffer = 0;
char hangcheck = 100;
read(p->fd, &buffer, 1);
if (buffer == SERIAL_IF.keypad_escape) {
while (hangcheck > 0) {
+8 -6
View File
@@ -11,7 +11,8 @@ typedef struct SerialInterface {
char name[SERIALIF_NAME_LENGTH];
char instruction_escape;
char data_escape;
char data_escape_max; /* data escape upper limit */
char data_escape_min; /* escaped data lower limit */
char data_escape_max; /* escaped data upper limit */
unsigned int default_bitrate;
char if_bits;
char keypad;
@@ -23,11 +24,12 @@ typedef struct SerialInterface {
/* List of connectiontypes managed by this driver, if you change
something here, remember also to change hd44780-drivers.h */
static const SerialInterface serial_interfaces[] = {
/* name instr data ^ bitrate bits K esc B esc */
{"picanlcd", 0x11, 0x12, 0x20, 9600, 8, 0, 0, 0, 0 },
{"lcdserializer", 0xFE, 0, 0, 9600, 8, 0, 0, 0, 0 },
{"los-panel", 0xFE, 0, 0, 9600, 4, 1, 0xFE, 1, 0 },
{"vdr-lcd", 0xFE, 0, 0, 9600, 4, 0, 0, 0, 0 }
/* name instr data v ^ bitrate bits K esc B esc */
{ "picanlcd", 0x11, 0x12, 0x00, 0x20, 9600, 8, 0, 0x00, 0, 0 },
{ "lcdserializer", 0xFE, 0, 0x00, 0x00, 9600, 8, 0, 0x00, 0, 0 },
{ "los-panel", 0xFE, 0, 0x00, 0x00, 9600, 4, 1, 0xFE, 1, 0 },
{ "vdr-lcd", 0xFE, 0, 0x00, 0x00, 9600, 4, 0, 0x00, 0, 0 }
{ "vdr-wakeup", 0xC0, 0xC4, 0xC0, 0xD0, 9600, 4, 0, 0x00, 0, 0 }
};
/* initialize this particular driver */