git.ucc.asn.au
/
matches
/
MCTX3420.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of https://github.com/szmoore/MCTX3420.git
[matches/MCTX3420.git]
/
server
/
sensor.c
diff --git
a/server/sensor.c
b/server/sensor.c
index
9c3d2b4
..
e136988
100644
(file)
--- a/
server/sensor.c
+++ b/
server/sensor.c
@@
-45,8
+45,6
@@
int Sensor_Add(const char * name, int user_id, ReadFn read, InitFn init, CleanFn
s->name = name;
s->read = read; // Set read function
s->init = init; // Set init function
s->name = name;
s->read = read; // Set read function
s->init = init; // Set init function
- if (init != NULL)
- init(name, user_id); // Call it
// Start by averaging values taken over a second
s->sample_us = 1e6;
// Start by averaging values taken over a second
s->sample_us = 1e6;
@@
-54,6
+52,14
@@
int Sensor_Add(const char * name, int user_id, ReadFn read, InitFn init, CleanFn
// Set sanity function
s->sanity = sanity;
// Set sanity function
s->sanity = sanity;
+
+ if (init != NULL)
+ {
+ if (!init(name, user_id))
+ Fatal("Couldn't init sensor %s", name);
+ }
+
+
return g_num_sensors;
}
return g_num_sensors;
}
UCC
git Repository :: git.ucc.asn.au