diff options
Diffstat (limited to '')
-rw-r--r-- | system.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -1,4 +1,4 @@ -/* $Id: system.c,v 1.25 2002/12/05 19:12:47 reinelt Exp $ +/* $Id: system.c,v 1.26 2003/02/22 07:53:10 reinelt Exp $ * * system status retreivement * @@ -20,6 +20,9 @@ * * * $Log: system.c,v $ + * Revision 1.26 2003/02/22 07:53:10 reinelt + * cfg_get(key,defval) + * * Revision 1.25 2002/12/05 19:12:47 reinelt * sensors factor and offset patch from Petri Damsten <petri.damsten@raketti.net> * @@ -763,7 +766,7 @@ int Sensor (int index, double *val, double *min, double *max) if (fd[index]==-2) { snprintf(buffer, 32, "Sensor%d", index); - sensor[index]=cfg_get(buffer); + sensor[index]=cfg_get(buffer, NULL); if (sensor[index]==NULL || *sensor[index]=='\0') { error ("%s: no entry for '%s'", cfg_file(), buffer); fd[index]=-1; @@ -771,18 +774,18 @@ int Sensor (int index, double *val, double *min, double *max) } snprintf(buffer, 32, "Sensor%d_min", index); - min_buf[index]=atof(cfg_get(buffer)?:"0"); + min_buf[index]=atof(cfg_get(buffer,"0")); *min=min_buf[index]; snprintf(buffer, 32, "Sensor%d_max", index); - max_buf[index]=atof(cfg_get(buffer)?:"100"); + max_buf[index]=atof(cfg_get(buffer,"100")); *max=max_buf[index]; snprintf(buffer, 32, "Sensor%d_factor", index); - factor_buf[index]=atof(cfg_get(buffer)?:"1"); + factor_buf[index]=atof(cfg_get(buffer,"1")); snprintf(buffer, 32, "Sensor%d_offset", index); - offset_buf[index]=atof(cfg_get(buffer)?:"0"); + offset_buf[index]=atof(cfg_get(buffer,"0")); fd[index]=open(sensor[index], O_RDONLY); if (fd[index]==-1) { |