Connect the debug driver to the build system. It has always lived only in

CVS and was not to be compiled by 'make'. However, it may serve as a template
for new drivers. Therefore add it to Makefile.am to have it in the
distribution. Note that it will only get compiled if explicitly given to
configure or if '--enable-debug' is used with '--drivers=all'.
This commit is contained in:
mmdolze
2010-12-27 10:39:35 +00:00
parent 5b6135c144
commit dfebe6206d
4 changed files with 91 additions and 85 deletions
+7 -2
View File
@@ -23,8 +23,9 @@ AC_ARG_ENABLE(drivers,
drivers=[bayrad,CFontz,CFontz633,curses,CwLnx,glk,lb216,lcdm001,MtxOrb,pyramid,text])
allDrivers=[bayrad,CFontz,CFontz633,CFontzPacket,curses,CwLnx,ea65,EyeboxOne,g15,glcdlib,glk,hd44780,i2500vfd,icp_a106,imon,imonlcd,IOWarrior,irman,irtrans,joy,lb216,lcdm001,lcterm,lirc,lis,MD8800,mdm166a,ms6931,mtc_s16209x,MtxOrb,mx5000,NoritakeVFD,picolcd,pyramid,sed1330,sed1520,serialPOS,serialVFD,shuttleVFD,sli,stv5730,SureElec,svga,t6963,text,tyan,ula200,xosd]
drivers=`echo $drivers | sed -e 's/,/ /g'`
if test "$debug" = yes; then
allDrivers=["${allDrivers},debug"]
fi
dnl replace special keyword "all" in a secure manner
drivers=[" $drivers "]
@@ -131,6 +132,10 @@ dnl else
DRIVERS="$DRIVERS CwLnx${SO}"
actdrivers=["$actdrivers CwLnx"]
;;
debug)
DRIVERS="$DRIVERS debug${SO}"
actdrivers=["$actdrivers debug"]
;;
ea65)
DRIVERS="$DRIVERS ea65${SO}"
actdrivers=["$actdrivers ea65"]
+2 -1
View File
@@ -21,7 +21,7 @@ AM_LDFLAGS = @LDSHARED@
## Keep the lists sorted!
pkglib_PROGRAMS = @DRIVERS@
EXTRA_PROGRAMS = bayrad CFontz CFontz633 CFontzPacket curses CwLnx ea65 EyeboxOne g15 glcdlib glk hd44780 icp_a106 imon imonlcd IOWarrior irman joy lb216 lcdm001 lcterm lirc lis MD8800 mdm166a ms6931 mtc_s16209x MtxOrb mx5000 NoritakeVFD picolcd pyramid sed1330 sed1520 serialPOS serialVFD shuttleVFD stv5730 SureElec svga t6963 text tyan sli ula200 xosd i2500vfd irtrans
EXTRA_PROGRAMS = bayrad CFontz CFontz633 CFontzPacket curses debug CwLnx ea65 EyeboxOne g15 glcdlib glk hd44780 icp_a106 imon imonlcd IOWarrior irman joy lb216 lcdm001 lcterm lirc lis MD8800 mdm166a ms6931 mtc_s16209x MtxOrb mx5000 NoritakeVFD picolcd pyramid sed1330 sed1520 serialPOS serialVFD shuttleVFD stv5730 SureElec svga t6963 text tyan sli ula200 xosd i2500vfd irtrans
noinst_LIBRARIES = libLCD.a libbignum.a
g15_CFLAGS = @LIBUSB_CFLAGS@ $(AM_CFLAGS)
@@ -80,6 +80,7 @@ CFontz633_SOURCES = lcd.h lcd_lib.h CFontz633.c CFontz633.h CFontz-charmap.h CF
CFontzPacket_SOURCES = lcd.h lcd_lib.h CFontzPacket.c CFontzPacket.h CFontz-charmap.h CFontz633io.c CFontz633io.h report.h adv_bignum.h
curses_SOURCES = lcd.h curses_drv.h curses_drv.c report.h
CwLnx_SOURCES = lcd.h lcd_lib.h CwLnx.c CwLnx.h report.h
debug_SOURCES = lcd.h report.h debug.c debug.h
ea65_SOURCES = lcd.h ea65.h ea65.c report.h
EyeboxOne_SOURCES = lcd.h lcd_lib.h EyeboxOne.c EyeboxOne.h report.h
g15_SOURCES = lcd.h lcd_lib.h g15.h g15-num.c g15.c report.h
+34 -32
View File
@@ -4,35 +4,31 @@
* any one of the driver's functions is called.
*/
/* Copyright (C) ?????? ?????????
2008, Peter Marschall
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 */
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
/*-
* Copyright (C) 2008, Peter Marschall
*
* 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
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "lcd.h"
#include "debug.h"
#include "report.h"
@@ -60,14 +56,13 @@ typedef struct debug_private_data {
} PrivateData;
// Vars for the server core
/* Vars for the server core */
MODULE_EXPORT char *api_version = API_VERSION;
MODULE_EXPORT int stay_in_foreground = 1;
MODULE_EXPORT int supports_multiple = 0;
MODULE_EXPORT char *symbol_prefix = "debug_";
/**
* Initialize the driver.
* \param drvthis Pointer to driver structure.
@@ -258,13 +253,14 @@ debug_string (Driver *drvthis, int x, int y, const char string[])
report(RPT_INFO, "%s(%i,%i,%.40s)", __FUNCTION__, x, y, string);
y --; x --; // Convert 1-based coords to 0-based...
y--; /* Convert 1-based coords to 0-based... */
x--;
if ((y < 0) || (y >= p->height))
return;
for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) {
if (x >= 0) // no write left of left border
if (x >= 0) /* no write left of left border */
p->framebuf[(y * p->width) + x] = string[i];
}
}
@@ -285,7 +281,8 @@ debug_chr (Driver *drvthis, int x, int y, char c)
report(RPT_DEBUG, "%s(%i,%i,%c)", __FUNCTION__, x, y, c);
x--; y--;
x--;
y--;
if ((x >= 0) && (y >= 0) && (x < p->width) && (y < p->height))
p->framebuf[(y * p->width) + x] = c;
@@ -312,7 +309,8 @@ debug_vbar (Driver *drvthis, int x, int y, int len, int promille, int options)
for (pos = 0; pos < len; pos++) {
if (2 * pos < ((long)promille * len / 500 + 1)) {
debug_chr(drvthis, x, y - pos, '|');
} else {
}
else {
; /* print nothing */
}
}
@@ -339,7 +337,8 @@ debug_hbar (Driver *drvthis, int x, int y, int len, int promille, int options)
for (pos = 0; pos < len; pos++) {
if (2 * pos < ((long)promille * len / 500 + 1)) {
debug_chr(drvthis, x + pos, y, '-');
} else {
}
else {
; /* print nothing */
}
}
@@ -441,6 +440,8 @@ debug_get_brightness(Driver *drvthis, int state)
{
PrivateData *p = drvthis->private_data;
report(RPT_INFO, "%s(%i)", __FUNCTION__, state);
return (state == BACKLIGHT_ON) ? p->brightness : p->offbrightness;
}
@@ -456,6 +457,8 @@ debug_set_brightness(Driver *drvthis, int state, int promille)
{
PrivateData *p = drvthis->private_data;
report(RPT_INFO, "%s(%i,%i)", __FUNCTION__, state, promille);
/* Check it */
if (promille < 0 || promille > 1000)
return;
@@ -514,4 +517,3 @@ debug_get_info(Driver *drvthis)
return info_string;
}
-2
View File
@@ -1,8 +1,6 @@
#ifndef LCD_DEBUG_H
#define LCD_DEBUG_H
#include "lcd.h"
MODULE_EXPORT int debug_init (Driver *drvthis);
MODULE_EXPORT void debug_close (Driver *drvthis);
MODULE_EXPORT int debug_width (Driver *drvthis);