mirror of
https://github.com/netfun2000/lcd4linux.git
synced 2026-02-27 09:44:34 +08:00
[lcd4linux @ 2004-06-01 06:45:28 by reinelt]
some Fixme's processed documented some code git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@456 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
This commit is contained in:
+9
-5
@@ -1,4 +1,4 @@
|
||||
/* $Id: drv_Crystalfontz.c,v 1.20 2004/05/31 05:38:02 reinelt Exp $
|
||||
/* $Id: drv_Crystalfontz.c,v 1.21 2004/06/01 06:45:28 reinelt Exp $
|
||||
*
|
||||
* new style driver for Crystalfontz display modules
|
||||
*
|
||||
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: drv_Crystalfontz.c,v $
|
||||
* Revision 1.21 2004/06/01 06:45:28 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.20 2004/05/31 05:38:02 reinelt
|
||||
*
|
||||
* fixed possible bugs with user-defined chars (clear high bits)
|
||||
@@ -161,7 +166,7 @@ static double Fan_RPM[4] = {0.0,};
|
||||
static double Temperature[32] = {0.0,};
|
||||
|
||||
|
||||
// Fixme:
|
||||
// Fixme: GPO's not yet implemented
|
||||
// static int GPO[8];
|
||||
static int GPOS;
|
||||
|
||||
@@ -864,7 +869,7 @@ static void plugin_fan_pwm (RESULT *result, int argc, RESULT *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
// Fixme: other plugins for Fans, Temmperature sensors, ...
|
||||
// Fixme: other plugins for Fans, Temperature sensors, ...
|
||||
|
||||
|
||||
|
||||
@@ -919,13 +924,12 @@ int drv_CF_init (char *section)
|
||||
break;
|
||||
case 2:
|
||||
CHAR0 = 0; // ASCII of first user-defineable char
|
||||
GOTO_COST = 20; // there is no goto on 633
|
||||
GOTO_COST = 999; // there is no goto on 633
|
||||
drv_generic_text_real_write = drv_CF_write2;
|
||||
drv_generic_text_real_defchar = drv_CF_defchar23;
|
||||
break;
|
||||
case 3:
|
||||
CHAR0 = 0; // ASCII of first user-defineable char
|
||||
// Fixme:
|
||||
GOTO_COST = 3; // number of bytes a goto command requires
|
||||
drv_generic_text_real_write = drv_CF_write3;
|
||||
drv_generic_text_real_defchar = drv_CF_defchar23;
|
||||
|
||||
+7
-2
@@ -1,4 +1,4 @@
|
||||
/* $Id: drv_Cwlinux.c,v 1.10 2004/05/31 21:05:13 reinelt Exp $
|
||||
/* $Id: drv_Cwlinux.c,v 1.11 2004/06/01 06:45:29 reinelt Exp $
|
||||
*
|
||||
* new style driver for Cwlinux display modules
|
||||
*
|
||||
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: drv_Cwlinux.c,v $
|
||||
* Revision 1.11 2004/06/01 06:45:29 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.10 2004/05/31 21:05:13 reinelt
|
||||
*
|
||||
* fixed lots of bugs in the Cwlinux driver
|
||||
@@ -103,7 +108,7 @@ static char Name[]="Cwlinux";
|
||||
static int Model;
|
||||
static int Protocol;
|
||||
|
||||
// Fixme:
|
||||
// Fixme: GPO's not yet implemented
|
||||
// static int GPO[8];
|
||||
static int GPOS;
|
||||
|
||||
|
||||
+8
-3
@@ -1,4 +1,4 @@
|
||||
/* $Id: drv_HD44780.c,v 1.23 2004/05/31 05:38:02 reinelt Exp $
|
||||
/* $Id: drv_HD44780.c,v 1.24 2004/06/01 06:45:29 reinelt Exp $
|
||||
*
|
||||
* new style driver for HD44780-based displays
|
||||
*
|
||||
@@ -29,6 +29,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: drv_HD44780.c,v $
|
||||
* Revision 1.24 2004/06/01 06:45:29 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.23 2004/05/31 05:38:02 reinelt
|
||||
*
|
||||
* fixed possible bugs with user-defined chars (clear high bits)
|
||||
@@ -211,7 +216,7 @@ static unsigned char SIGNAL_GPO;
|
||||
static int UseBusy = 0;
|
||||
|
||||
|
||||
// Fixme
|
||||
// Fixme: GPO's not yet implemented
|
||||
static int GPOS;
|
||||
// static int GPO=0;
|
||||
|
||||
@@ -556,7 +561,7 @@ static int drv_HD_brightness (int brightness)
|
||||
}
|
||||
|
||||
|
||||
// Fixme
|
||||
// Fixme: GPO's
|
||||
#if 0
|
||||
static void drv_HD_setGPO (int bits)
|
||||
{
|
||||
|
||||
+8
-3
@@ -1,4 +1,4 @@
|
||||
/* $Id: drv_M50530.c,v 1.6 2004/05/31 05:38:02 reinelt Exp $
|
||||
/* $Id: drv_M50530.c,v 1.7 2004/06/01 06:45:29 reinelt Exp $
|
||||
*
|
||||
* new style driver for M50530-based displays
|
||||
*
|
||||
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: drv_M50530.c,v $
|
||||
* Revision 1.7 2004/06/01 06:45:29 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.6 2004/05/31 05:38:02 reinelt
|
||||
*
|
||||
* fixed possible bugs with user-defined chars (clear high bits)
|
||||
@@ -96,7 +101,7 @@ static unsigned char SIGNAL_IOC1;
|
||||
static unsigned char SIGNAL_IOC2;
|
||||
static unsigned char SIGNAL_GPO;
|
||||
|
||||
// Fixme
|
||||
// Fixme: GPO's not yet implemented
|
||||
static int GPOS;
|
||||
// static int GPO=0;
|
||||
|
||||
@@ -172,7 +177,7 @@ static void drv_M5_defchar (int ascii, unsigned char *matrix)
|
||||
}
|
||||
|
||||
|
||||
// Fixme
|
||||
// Fixme: GPO's
|
||||
#if 0
|
||||
static void drv_M5_setGPO (int bits)
|
||||
{
|
||||
|
||||
+8
-3
@@ -1,4 +1,4 @@
|
||||
/* $Id: drv_MatrixOrbital.c,v 1.27 2004/05/31 21:23:16 reinelt Exp $
|
||||
/* $Id: drv_MatrixOrbital.c,v 1.28 2004/06/01 06:45:29 reinelt Exp $
|
||||
*
|
||||
* new style driver for Matrix Orbital serial display modules
|
||||
*
|
||||
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: drv_MatrixOrbital.c,v $
|
||||
* Revision 1.28 2004/06/01 06:45:29 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.27 2004/05/31 21:23:16 reinelt
|
||||
*
|
||||
* some cleanups in the MatrixOrbital driver
|
||||
@@ -169,7 +174,7 @@ static char Name[]="MatrixOrbital";
|
||||
static int Model;
|
||||
static int Protocol;
|
||||
|
||||
// Fixme:
|
||||
// Fixme: GPO's not yet implemented
|
||||
// static int GPO[8];
|
||||
static int GPOS;
|
||||
|
||||
@@ -379,7 +384,7 @@ static int drv_MO_rpm (int num)
|
||||
debug ("rpm: buffer[5]=0x%01x", buffer[5]);
|
||||
debug ("rpm: buffer[6]=0x%01x", buffer[6]);
|
||||
|
||||
// Fixme:
|
||||
// Fixme: RPM calculations???
|
||||
RPM[num-1] = 42;
|
||||
|
||||
return RPM[num-1];
|
||||
|
||||
+6
-2
@@ -1,4 +1,4 @@
|
||||
/* $Id: drv_T6963.c,v 1.4 2004/02/24 05:55:04 reinelt Exp $
|
||||
/* $Id: drv_T6963.c,v 1.5 2004/06/01 06:45:30 reinelt Exp $
|
||||
*
|
||||
* new style driver for T6963-based displays
|
||||
*
|
||||
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: drv_T6963.c,v $
|
||||
* Revision 1.5 2004/06/01 06:45:30 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.4 2004/02/24 05:55:04 reinelt
|
||||
*
|
||||
* X11 driver ported
|
||||
@@ -98,7 +103,6 @@ static unsigned char SIGNAL_WR;
|
||||
|
||||
unsigned char *Buffer1, *Buffer2;
|
||||
|
||||
// Fixme:
|
||||
static int bug=0;
|
||||
|
||||
|
||||
|
||||
+24
-2
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: drv_generic_graphic.c,v $
|
||||
* Revision 1.7 2004/06/01 06:45:30 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.6 2004/03/03 03:47:04 reinelt
|
||||
* big patch from Martin Hejl:
|
||||
* - use qprintf() where appropriate
|
||||
@@ -54,12 +59,29 @@
|
||||
|
||||
/*
|
||||
*
|
||||
* exported fuctions:
|
||||
* exported functions:
|
||||
*
|
||||
* Fixme: document me!
|
||||
* int drv_generic_graphic_init (char *section, char *driver);
|
||||
* initializes the generic graphic driver
|
||||
*
|
||||
* int drv_generic_graphic_draw (WIDGET *W);
|
||||
* renders Text widget into framebuffer
|
||||
* calls drv_generic_graphic_real_blit()
|
||||
*
|
||||
* int drv_generic_graphic_icon_draw (WIDGET *W);
|
||||
* renders Icon widget into framebuffer
|
||||
* calls drv_generic_graphic_real_blit()
|
||||
*
|
||||
* int drv_generic_graphic_bar_draw (WIDGET *W);
|
||||
* renders Bar widget into framebuffer
|
||||
* calls drv_generic_graphic_real_blit()
|
||||
*
|
||||
* int drv_generic_graphic_quit (void);
|
||||
* closes generic graphic driver
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: drv_generic_graphic.h,v 1.2 2004/02/18 06:39:20 reinelt Exp $
|
||||
/* $Id: drv_generic_graphic.h,v 1.3 2004/06/01 06:45:30 reinelt Exp $
|
||||
*
|
||||
* generic driver helper for graphic displays
|
||||
*
|
||||
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: drv_generic_graphic.h,v $
|
||||
* Revision 1.3 2004/06/01 06:45:30 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.2 2004/02/18 06:39:20 reinelt
|
||||
* T6963 driver for graphic displays finished
|
||||
*
|
||||
@@ -34,13 +39,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
* exported fuctions:
|
||||
*
|
||||
* Fixme: document me!
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DRV_GENERIC_GRAPHIC_H_
|
||||
#define _DRV_GENERIC_GRAPHIC_H_
|
||||
|
||||
+11
-6
@@ -1,4 +1,4 @@
|
||||
/* $Id: drv_generic_serial.c,v 1.10 2004/05/31 21:05:13 reinelt Exp $
|
||||
/* $Id: drv_generic_serial.c,v 1.11 2004/06/01 06:45:30 reinelt Exp $
|
||||
*
|
||||
* generic driver helper for serial and usbserial displays
|
||||
*
|
||||
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: drv_generic_serial.c,v $
|
||||
* Revision 1.11 2004/06/01 06:45:30 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.10 2004/05/31 21:05:13 reinelt
|
||||
*
|
||||
* fixed lots of bugs in the Cwlinux driver
|
||||
@@ -81,21 +86,21 @@
|
||||
*
|
||||
* exported fuctions:
|
||||
*
|
||||
* int drv_generic_serial_open (char *driver, char *port, speed_t speed);
|
||||
* int drv_generic_serial_open (char *section, char *driver, unsigned int flags)
|
||||
* opens the serial port
|
||||
*
|
||||
* int drv_generic_serial_poll (unsigned char *string, int len)
|
||||
* reads from the serial or USB port
|
||||
* without retry
|
||||
*
|
||||
* int drv_generic_serial_read (unsigned char *string, int len);
|
||||
* int drv_generic_serial_read (unsigned char *string, int len);
|
||||
* reads from the serial or USB port
|
||||
* with retry
|
||||
*
|
||||
* void drv_generic_serial_write (unsigned char *string, int len);
|
||||
* void drv_generic_serial_write (unsigned char *string, int len);
|
||||
* writes to the serial or USB port
|
||||
*
|
||||
* int drv_generic_serial_close (void);
|
||||
* int drv_generic_serial_close (void);
|
||||
* closes the serial port
|
||||
*
|
||||
*/
|
||||
@@ -133,7 +138,7 @@ static int Device=-1;
|
||||
// *** generic serial/USB communication ***
|
||||
// ****************************************
|
||||
|
||||
pid_t drv_generic_serial_lock_port (char *Port)
|
||||
static pid_t drv_generic_serial_lock_port (char *Port)
|
||||
{
|
||||
char lockfile[256];
|
||||
char tempfile[256];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: drv_generic_serial.h,v 1.4 2004/05/28 13:51:42 reinelt Exp $
|
||||
/* $Id: drv_generic_serial.h,v 1.5 2004/06/01 06:45:30 reinelt Exp $
|
||||
*
|
||||
* generic driver helper for serial and usbserial displays
|
||||
*
|
||||
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: drv_generic_serial.h,v $
|
||||
* Revision 1.5 2004/06/01 06:45:30 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.4 2004/05/28 13:51:42 reinelt
|
||||
*
|
||||
* ported driver for Beckmann+Egle Mini-Terminals
|
||||
@@ -50,13 +55,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
* exported fuctions:
|
||||
*
|
||||
* Fixme: document me!
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DRV_GENERIC_SERIALH_
|
||||
#define _DRV_GENERIC_SERIAL_H_
|
||||
|
||||
+51
-2
@@ -1,4 +1,4 @@
|
||||
/* $Id: drv_generic_text.c,v 1.14 2004/05/26 11:37:36 reinelt Exp $
|
||||
/* $Id: drv_generic_text.c,v 1.15 2004/06/01 06:45:30 reinelt Exp $
|
||||
*
|
||||
* generic driver helper for text-based displays
|
||||
*
|
||||
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: drv_generic_text.c,v $
|
||||
* Revision 1.15 2004/06/01 06:45:30 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.14 2004/05/26 11:37:36 reinelt
|
||||
*
|
||||
* Curses driver ported.
|
||||
@@ -84,10 +89,54 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
* exported variables:
|
||||
*
|
||||
* extern int DROWS, DCOLS; // display size
|
||||
* extern int LROWS, LCOLS; // layout size
|
||||
* extern int XRES, YRES; // pixel width/height of one char
|
||||
* extern int GOTO_COST; // number of bytes a goto command requires
|
||||
* extern int CHARS, CHAR0; // number of user-defineable characters, ASCII of first char
|
||||
* extern int ICONS; // number of user-defineable characters reserved for icons
|
||||
*
|
||||
*
|
||||
* these functions must be implemented by the real driver:
|
||||
*
|
||||
* void (*drv_generic_text_real_write)(int row, int col, unsigned char *data, int len);
|
||||
* writes a text of specified length at position (row, col)
|
||||
*
|
||||
* void (*drv_generic_text_real_defchar)(int ascii, unsigned char *buffer);
|
||||
* defines the bitmap of a user-defined character
|
||||
*
|
||||
*
|
||||
* exported fuctions:
|
||||
*
|
||||
* Fixme: document me!
|
||||
* int drv_generic_text_init (char *section, char *driver);
|
||||
* initializes the generic text driver
|
||||
*
|
||||
* int drv_generic_text_draw (WIDGET *W);
|
||||
* renders Text widget into framebuffer
|
||||
* calls drv_generic_text_real_write()
|
||||
*
|
||||
* int drv_generic_text_icon_init (void);
|
||||
* initializes the generic icon driver
|
||||
*
|
||||
* int drv_generic_text_icon_draw (WIDGET *W);
|
||||
* renders Icon widget into framebuffer
|
||||
* calls drv_generic_text_real_write() and drv_generic_text_real_defchar()
|
||||
*
|
||||
* int drv_generic_text_bar_init (int single_segments);
|
||||
* initializes the generic icon driver
|
||||
*
|
||||
* void drv_generic_text_bar_add_segment (int val1, int val2, DIRECTION dir, int ascii);
|
||||
* adds a 'fixed' character to the bar-renderer
|
||||
*
|
||||
* int drv_generic_text_bar_draw (WIDGET *W);
|
||||
* renders Bar widget into framebuffer
|
||||
* calls drv_generic_text_real_write() and drv_generic_text_real_defchar()
|
||||
*
|
||||
* int drv_generic_text_quit (void);
|
||||
* closes the generic text driver
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
+6
-8
@@ -1,4 +1,4 @@
|
||||
/* $Id: drv_generic_text.h,v 1.9 2004/05/26 11:37:36 reinelt Exp $
|
||||
/* $Id: drv_generic_text.h,v 1.10 2004/06/01 06:45:30 reinelt Exp $
|
||||
*
|
||||
* generic driver helper for text-based displays
|
||||
*
|
||||
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: drv_generic_text.h,v $
|
||||
* Revision 1.10 2004/06/01 06:45:30 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.9 2004/05/26 11:37:36 reinelt
|
||||
*
|
||||
* Curses driver ported.
|
||||
@@ -61,13 +66,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
* exported fuctions:
|
||||
*
|
||||
* Fixme: document me!
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DRV_GENERIC_TEXT_H_
|
||||
#define _DRV_GENERIC_TEXT_H_
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: hash.c,v 1.18 2004/05/31 16:39:06 reinelt Exp $
|
||||
/* $Id: hash.c,v 1.19 2004/06/01 06:45:30 reinelt Exp $
|
||||
*
|
||||
* hashes (associative arrays)
|
||||
*
|
||||
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: hash.c,v $
|
||||
* Revision 1.19 2004/06/01 06:45:30 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.18 2004/05/31 16:39:06 reinelt
|
||||
*
|
||||
* added NULL display driver (for debugging/profiling purposes)
|
||||
@@ -105,8 +110,26 @@
|
||||
/*
|
||||
* exported functions:
|
||||
*
|
||||
* hash_anything
|
||||
* Fixme: document me!
|
||||
* void hash_set (HASH *Hash, char *key, char *val);
|
||||
* set an entry in the hash
|
||||
*
|
||||
* void hash_set_delta (HASH *Hash, char *key, char *val);
|
||||
* set a delta entry in the hash
|
||||
*
|
||||
* int hash_age (HASH *Hash, char *key, char **value);
|
||||
* return time of last hash_set
|
||||
*
|
||||
* char *hash_get (HASH *Hash, char *key);
|
||||
* fetch an entry from the hash
|
||||
*
|
||||
* double hash_get_delta (HASH *Hash, char *key, int delay);
|
||||
* fetch a delta antry from the hash
|
||||
*
|
||||
* double hash_get_regex (HASH *Hash, char *key, int delay);
|
||||
* fetch one or more entries from the hash
|
||||
*
|
||||
* void hash_destroy (HASH *Hash);
|
||||
* releases hash
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: hash.h,v 1.11 2004/03/11 06:39:59 reinelt Exp $
|
||||
/* $Id: hash.h,v 1.12 2004/06/01 06:45:30 reinelt Exp $
|
||||
*
|
||||
* hashes (associative arrays)
|
||||
*
|
||||
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: hash.h,v $
|
||||
* Revision 1.12 2004/06/01 06:45:30 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.11 2004/03/11 06:39:59 reinelt
|
||||
* big patch from Martin:
|
||||
* - reuse filehandles
|
||||
@@ -115,4 +120,5 @@ char *hash_get (HASH *Hash, char *key);
|
||||
double hash_get_delta (HASH *Hash, char *key, int delay);
|
||||
double hash_get_regex (HASH *Hash, char *key, int delay);
|
||||
void hash_destroy (HASH *Hash);
|
||||
|
||||
#endif
|
||||
|
||||
+10
-9
@@ -1,4 +1,4 @@
|
||||
/* $Id: plugin_i2c_sensors.c,v 1.15 2004/05/31 21:05:13 reinelt Exp $
|
||||
/* $Id: plugin_i2c_sensors.c,v 1.16 2004/06/01 06:45:30 reinelt Exp $
|
||||
*
|
||||
* I2C sensors plugin
|
||||
*
|
||||
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: plugin_i2c_sensors.c,v $
|
||||
* Revision 1.16 2004/06/01 06:45:30 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.15 2004/05/31 21:05:13 reinelt
|
||||
*
|
||||
* fixed lots of bugs in the Cwlinux driver
|
||||
@@ -137,6 +142,7 @@
|
||||
#include "plugin.h"
|
||||
#include "cfg.h"
|
||||
#include "hash.h"
|
||||
#include "qprintf.h"
|
||||
|
||||
#ifdef WITH_DMALLOC
|
||||
#include <dmalloc.h>
|
||||
@@ -160,7 +166,6 @@ static int (*parse_i2c_sensors)(char *key);
|
||||
|
||||
static int parse_i2c_sensors_sysfs(char *key)
|
||||
{
|
||||
double value;
|
||||
char val[32];
|
||||
char buffer[32];
|
||||
char file[64];
|
||||
@@ -189,13 +194,9 @@ static int parse_i2c_sensors_sysfs(char *key)
|
||||
!strncmp(key, "curr", 4) ||
|
||||
!strncmp(key, "in", 2) ||
|
||||
!strncmp(key, "vid", 3)) {
|
||||
value = strtod(buffer, NULL);
|
||||
// FIXME: any way to do this without converting to double ?
|
||||
value /= 1000.0;
|
||||
sprintf(val, "%f", value);
|
||||
|
||||
qprintf(val, sizeof(val), "%f", strtod(buffer, NULL) / 1000.0);
|
||||
} else {
|
||||
sprintf(val, "%s", buffer);
|
||||
qprintf(val, sizeof(val), "%s", buffer);
|
||||
// we supress this nasty \n at the end
|
||||
val[strlen(val)-1]='\0';
|
||||
}
|
||||
@@ -267,7 +268,7 @@ static int parse_i2c_sensors_procfs(char *key)
|
||||
// debug("%s pos %i -> BREAK", file, pos);
|
||||
break;
|
||||
} else {
|
||||
sprintf (final_key, "%s%s", procfs_tokens[tokens_index][pos], number);
|
||||
qprintf (final_key, sizeof(final_key), "%s%s", procfs_tokens[tokens_index][pos], number);
|
||||
// debug ("%s -> %s", final_key, value);
|
||||
hash_set (&I2Csensors, final_key, value);
|
||||
pos++;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: thread.c,v 1.3 2004/04/08 10:48:25 reinelt Exp $
|
||||
/* $Id: thread.c,v 1.4 2004/06/01 06:45:30 reinelt Exp $
|
||||
*
|
||||
* thread handling (mutex, shmem, ...)
|
||||
*
|
||||
@@ -26,6 +26,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: thread.c,v $
|
||||
* Revision 1.4 2004/06/01 06:45:30 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.3 2004/04/08 10:48:25 reinelt
|
||||
* finished plugin_exec
|
||||
* modified thread handling
|
||||
@@ -43,7 +48,27 @@
|
||||
/*
|
||||
* exported functions:
|
||||
*
|
||||
* Fixme: document me!
|
||||
* int mutex_create (void);
|
||||
* creates a mutex and treturns its ID
|
||||
*
|
||||
* void mutex_lock (int semid);
|
||||
* try to lock a mutex
|
||||
*
|
||||
* void mutex_unlock (int semid);
|
||||
* unlock a mutex
|
||||
*
|
||||
* void mutex_destroy (int semid);
|
||||
* release a mutex
|
||||
*
|
||||
*
|
||||
* int shm_create (void **buffer, int size);
|
||||
* create shared memory segment
|
||||
*
|
||||
* void shm_destroy (int shmid, void *buffer) ;
|
||||
* release shared memory segment
|
||||
*
|
||||
* int thread_create (char *name, void (*thread)(void *data), void *data);
|
||||
* create a new thread
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: timer.c,v 1.6 2004/03/03 04:44:16 reinelt Exp $
|
||||
/* $Id: timer.c,v 1.7 2004/06/01 06:45:30 reinelt Exp $
|
||||
*
|
||||
* generic timer handling
|
||||
*
|
||||
@@ -21,6 +21,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: timer.c,v $
|
||||
* Revision 1.7 2004/06/01 06:45:30 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.6 2004/03/03 04:44:16 reinelt
|
||||
* changes (cosmetics?) to the big patch from Martin
|
||||
* hash patch un-applied
|
||||
@@ -51,8 +56,14 @@
|
||||
/*
|
||||
* exported functions:
|
||||
*
|
||||
* int timer_junk(void)
|
||||
* Fixme: document me :-(
|
||||
* int timer_add (void(*callback)(void *data), void *data, int interval, int one_shot);
|
||||
* adds a timer to the queue
|
||||
*
|
||||
* int timer_process (struct timespec *delay);
|
||||
* process timer queue
|
||||
*
|
||||
* void timer_exit();
|
||||
* release all timers
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: timer.h,v 1.2 2004/03/03 03:47:04 reinelt Exp $
|
||||
/* $Id: timer.h,v 1.3 2004/06/01 06:45:30 reinelt Exp $
|
||||
*
|
||||
* generic timer handling
|
||||
*
|
||||
@@ -23,6 +23,11 @@
|
||||
*
|
||||
*
|
||||
* $Log: timer.h,v $
|
||||
* Revision 1.3 2004/06/01 06:45:30 reinelt
|
||||
*
|
||||
* some Fixme's processed
|
||||
* documented some code
|
||||
*
|
||||
* Revision 1.2 2004/03/03 03:47:04 reinelt
|
||||
* big patch from Martin Hejl:
|
||||
* - use qprintf() where appropriate
|
||||
@@ -43,4 +48,5 @@
|
||||
int timer_add (void(*callback)(void *data), void *data, int interval, int one_shot);
|
||||
int timer_process (struct timespec *delay);
|
||||
void timer_exit();
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user