Fix supported for old compilers and make non-standard (termios.h) baud

rates optional (spotted by Tim Larson).
This commit is contained in:
mmdolze
2009-05-30 11:44:46 +00:00
parent 8e291370c3
commit 194e2a941e
4 changed files with 18 additions and 13 deletions
+1
View File
@@ -14,6 +14,7 @@ Things for the short term:
- MtxOrb: Recover the code for I2C connectivity to MtxOrb
- shuttleVFD: Use output() method for these special "out-of-band" symbols.
- glk: port icon, vBar and hBar to 0.5 API.
- Use non-standard serial baud rates (57600 and higher) only optional.
Things for the longer term:
+9 -6
View File
@@ -67,9 +67,13 @@ unsigned int bitrate_conversion[][2] = {
{ 4800, B4800 },
{ 9600, B9600 },
{ 19200, B19200 },
{ 38400, B38400 },
{ 57600, B57600 },
{ 115200, B115200 }
{ 38400, B38400 }
#if defined(B57600)
, { 57600, B57600 }
#endif
#if defined(B115200)
, { 115200, B115200 }
#endif
#if defined(B230400)
, { 230400, B230400 }
#endif
@@ -142,6 +146,8 @@ hd_init_serial(Driver *drvthis)
struct termios portset;
char device[256] = DEFAULT_DEVICE;
unsigned int conf_bitrate;
size_t bitrate;
/* READ CONFIG FILE */
@@ -173,9 +179,6 @@ hd_init_serial(Driver *drvthis)
}
/* Get bitrate */
unsigned int conf_bitrate;
size_t bitrate;
conf_bitrate = drvthis->config_get_int(drvthis->name, "Speed", 0, SERIAL_IF.default_bitrate);
if (conf_bitrate == 0)
conf_bitrate = SERIAL_IF.default_bitrate;
+1 -2
View File
@@ -150,6 +150,7 @@ HD44780_init(Driver *drvthis)
int if_type = IF_TYPE_UNKNOWN;
int tmp;
PrivateData *p;
char conf_charmap[MAX_CHARMAP_NAME_LENGTH];
// Alocate and store private data
p = (PrivateData *) calloc(1, sizeof(PrivateData));
@@ -347,8 +348,6 @@ HD44780_init(Driver *drvthis)
}
// Get configured charmap
char conf_charmap[MAX_CHARMAP_NAME_LENGTH];
strncpy(conf_charmap, drvthis->config_get_string(drvthis->name, "charmap", 0, "hd44780_default"), MAX_CHARMAP_NAME_LENGTH);
conf_charmap[MAX_CHARMAP_NAME_LENGTH-1] = '\0';
p->charmap = 0;
+7 -5
View File
@@ -31,6 +31,10 @@
* COPYING file distributed with this package.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@@ -39,12 +43,10 @@
#include <string.h>
#include <errno.h>
#include <time.h>
#include <stdint.h>
#include <math.h>
#ifdef HAVE_CONFIG_H
# include "config.h"
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <math.h>
#include "lcd.h"
#include "lcd_lib.h"