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:
+7
-2
@@ -23,8 +23,9 @@ AC_ARG_ENABLE(drivers,
|
|||||||
drivers=[bayrad,CFontz,CFontz633,curses,CwLnx,glk,lb216,lcdm001,MtxOrb,pyramid,text])
|
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]
|
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]
|
||||||
|
if test "$debug" = yes; then
|
||||||
drivers=`echo $drivers | sed -e 's/,/ /g'`
|
allDrivers=["${allDrivers},debug"]
|
||||||
|
fi
|
||||||
|
|
||||||
dnl replace special keyword "all" in a secure manner
|
dnl replace special keyword "all" in a secure manner
|
||||||
drivers=[" $drivers "]
|
drivers=[" $drivers "]
|
||||||
@@ -131,6 +132,10 @@ dnl else
|
|||||||
DRIVERS="$DRIVERS CwLnx${SO}"
|
DRIVERS="$DRIVERS CwLnx${SO}"
|
||||||
actdrivers=["$actdrivers CwLnx"]
|
actdrivers=["$actdrivers CwLnx"]
|
||||||
;;
|
;;
|
||||||
|
debug)
|
||||||
|
DRIVERS="$DRIVERS debug${SO}"
|
||||||
|
actdrivers=["$actdrivers debug"]
|
||||||
|
;;
|
||||||
ea65)
|
ea65)
|
||||||
DRIVERS="$DRIVERS ea65${SO}"
|
DRIVERS="$DRIVERS ea65${SO}"
|
||||||
actdrivers=["$actdrivers ea65"]
|
actdrivers=["$actdrivers ea65"]
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ AM_LDFLAGS = @LDSHARED@
|
|||||||
## Keep the lists sorted!
|
## Keep the lists sorted!
|
||||||
|
|
||||||
pkglib_PROGRAMS = @DRIVERS@
|
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
|
noinst_LIBRARIES = libLCD.a libbignum.a
|
||||||
|
|
||||||
g15_CFLAGS = @LIBUSB_CFLAGS@ $(AM_CFLAGS)
|
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
|
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
|
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
|
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
|
ea65_SOURCES = lcd.h ea65.h ea65.c report.h
|
||||||
EyeboxOne_SOURCES = lcd.h lcd_lib.h EyeboxOne.c EyeboxOne.h 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
|
g15_SOURCES = lcd.h lcd_lib.h g15.h g15-num.c g15.c report.h
|
||||||
|
|||||||
+34
-32
@@ -4,35 +4,31 @@
|
|||||||
* any one of the driver's functions is called.
|
* any one of the driver's functions is called.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Copyright (C) ?????? ?????????
|
/*-
|
||||||
2008, Peter Marschall
|
* Copyright (C) 2008, Peter Marschall
|
||||||
|
*
|
||||||
This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
any later version.
|
* any later version.
|
||||||
|
*
|
||||||
This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 */
|
* 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>
|
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "report.h"
|
#include "report.h"
|
||||||
@@ -60,14 +56,13 @@ typedef struct debug_private_data {
|
|||||||
} PrivateData;
|
} PrivateData;
|
||||||
|
|
||||||
|
|
||||||
// Vars for the server core
|
/* Vars for the server core */
|
||||||
MODULE_EXPORT char *api_version = API_VERSION;
|
MODULE_EXPORT char *api_version = API_VERSION;
|
||||||
MODULE_EXPORT int stay_in_foreground = 1;
|
MODULE_EXPORT int stay_in_foreground = 1;
|
||||||
MODULE_EXPORT int supports_multiple = 0;
|
MODULE_EXPORT int supports_multiple = 0;
|
||||||
MODULE_EXPORT char *symbol_prefix = "debug_";
|
MODULE_EXPORT char *symbol_prefix = "debug_";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the driver.
|
* Initialize the driver.
|
||||||
* \param drvthis Pointer to driver structure.
|
* \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);
|
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))
|
if ((y < 0) || (y >= p->height))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; (string[i] != '\0') && (x < p->width); i++, x++) {
|
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];
|
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);
|
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))
|
if ((x >= 0) && (y >= 0) && (x < p->width) && (y < p->height))
|
||||||
p->framebuf[(y * p->width) + x] = c;
|
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++) {
|
for (pos = 0; pos < len; pos++) {
|
||||||
if (2 * pos < ((long)promille * len / 500 + 1)) {
|
if (2 * pos < ((long)promille * len / 500 + 1)) {
|
||||||
debug_chr(drvthis, x, y - pos, '|');
|
debug_chr(drvthis, x, y - pos, '|');
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
; /* print nothing */
|
; /* 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++) {
|
for (pos = 0; pos < len; pos++) {
|
||||||
if (2 * pos < ((long)promille * len / 500 + 1)) {
|
if (2 * pos < ((long)promille * len / 500 + 1)) {
|
||||||
debug_chr(drvthis, x + pos, y, '-');
|
debug_chr(drvthis, x + pos, y, '-');
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
; /* print nothing */
|
; /* print nothing */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -441,6 +440,8 @@ debug_get_brightness(Driver *drvthis, int state)
|
|||||||
{
|
{
|
||||||
PrivateData *p = drvthis->private_data;
|
PrivateData *p = drvthis->private_data;
|
||||||
|
|
||||||
|
report(RPT_INFO, "%s(%i)", __FUNCTION__, state);
|
||||||
|
|
||||||
return (state == BACKLIGHT_ON) ? p->brightness : p->offbrightness;
|
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;
|
PrivateData *p = drvthis->private_data;
|
||||||
|
|
||||||
|
report(RPT_INFO, "%s(%i,%i)", __FUNCTION__, state, promille);
|
||||||
|
|
||||||
/* Check it */
|
/* Check it */
|
||||||
if (promille < 0 || promille > 1000)
|
if (promille < 0 || promille > 1000)
|
||||||
return;
|
return;
|
||||||
@@ -514,4 +517,3 @@ debug_get_info(Driver *drvthis)
|
|||||||
|
|
||||||
return info_string;
|
return info_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
#ifndef LCD_DEBUG_H
|
#ifndef LCD_DEBUG_H
|
||||||
#define LCD_DEBUG_H
|
#define LCD_DEBUG_H
|
||||||
|
|
||||||
#include "lcd.h"
|
|
||||||
|
|
||||||
MODULE_EXPORT int debug_init (Driver *drvthis);
|
MODULE_EXPORT int debug_init (Driver *drvthis);
|
||||||
MODULE_EXPORT void debug_close (Driver *drvthis);
|
MODULE_EXPORT void debug_close (Driver *drvthis);
|
||||||
MODULE_EXPORT int debug_width (Driver *drvthis);
|
MODULE_EXPORT int debug_width (Driver *drvthis);
|
||||||
|
|||||||
Reference in New Issue
Block a user