aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2012-03-12 23:37:21 +0000
committerJonathan McCrohan <jmccrohan@gmail.com>2012-03-12 23:37:21 +0000
commit267d9a07255d96a564da64ce5c819ebc4701d5f1 (patch)
tree0fa84ee59a7e3a9ad53ae15780f7e80c40a75c1b
parent577e2f84f58a2f46839e82b096cf9493d2ef035b (diff)
downloadverteco-267d9a07255d96a564da64ce5c819ebc4701d5f1.tar.gz
Force log upon startup
Diffstat (limited to '')
-rw-r--r--src/modbuslog.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/modbuslog.c b/src/modbuslog.c
index 4c8ac60..5142646 100644
--- a/src/modbuslog.c
+++ b/src/modbuslog.c
@@ -141,6 +141,10 @@ int main(int argc, char *argv[]) {
int rc;
int i;
+ // used to force a reading 2 mins after power on
+ int firstrun;
+ firstrun = 1;
+
// SIGALRM used to wake for loop up every 60 secs
// sleep puts whole thread to sleep which isn't what we want
// other methods involve CPU spinlocks which are inefficient
@@ -201,8 +205,8 @@ int main(int argc, char *argv[]) {
else
intervalduration = intervalvalue * 60;
- // if we match the required time for the reading
- if (unixtime_min % intervalduration == 0) {
+ // if we match the required time for the reading or first run
+ if ((unixtime_min % intervalduration == 0)||firstrun) {
//printf("specified minute. %d %d\n", unixtime_min,
// intervalduration);
@@ -383,6 +387,8 @@ int main(int argc, char *argv[]) {
}
//printf("%d ", slaveid);
}
+ // revert to normal timing
+ firstrun=0;
//printf("%d\n", unixtime_min);
}
}
ux @ 2004-06-02 05:35:55 by reinelt]reinelt1-0/+20 added i2c_sensors example to lcd4linux.conf.sample git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@459 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-06-02[lcd4linux @ 2004-06-02 05:27:59 by reinelt]reinelt26-0/+2405 added documentation tree git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@458 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-06-02[lcd4linux @ 2004-06-02 05:14:16 by reinelt]reinelt2-17/+31 fixed models listing for Beckmann+Egle driver some cosmetic changes git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@457 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-06-01[lcd4linux @ 2004-06-01 06:45:28 by reinelt]reinelt18-71/+241 some Fixme's processed documented some code git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@456 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-06-01[lcd4linux @ 2004-06-01 06:04:25 by reinelt]reinelt2-25/+25 made README.Plugins and plugin_sample up to date. git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@455 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-05-31[lcd4linux @ 2004-05-31 21:23:16 by reinelt]reinelt1-37/+49 some cleanups in the MatrixOrbital driver git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@454 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-05-31[lcd4linux @ 2004-05-31 21:05:13 by reinelt]reinelt5-77/+111 fixed lots of bugs in the Cwlinux driver do not emit EAGAIN error on the first retry made plugin_i2c_sensors a bit less 'chatty' moved init and exit functions to the bottom of plugin_pop3 git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@453 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-05-31[lcd4linux @ 2004-05-31 16:39:05 by reinelt]reinelt11-180/+535 added NULL display driver (for debugging/profiling purposes) added backlight/contrast initialisation for matrixOrbital added Backlight initialisation for Cwlinux git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@452 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-05-31[lcd4linux @ 2004-05-31 06:27:34 by reinelt]reinelt1-0/+40 ChangeLog update git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@451 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-05-31[lcd4linux @ 2004-05-31 06:24:42 by reinelt]reinelt2-7/+29 fixed symlink security issue with the image driver git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@450 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-05-31[lcd4linux @ 2004-05-31 05:38:02 by reinelt]reinelt8-42/+94 fixed possible bugs with user-defined chars (clear high bits) thanks to Andy Baxter for debugging the MilfordInstruments driver! git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@449 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-05-31[lcd4linux @ 2004-05-31 01:31:01 by andy-b]andy-b1-10/+12 fixed bug in Milford Instruments driver which drew extra graphics chars in odd places when drawing double bars. (the display doesn't like it if you put the escape character 0xfe inside a define char sequence). git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@448 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-05-30[lcd4linux @ 2004-05-30 08:25:50 by reinelt]reinelt2-30/+92 Crystalfontz 631 driver finished git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@447 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-05-29[lcd4linux @ 2004-05-29 23:30:20 by reinelt]reinelt1-1/+9 fixed a compiler issue with drv_Image.c (thanks to Frank Stratmann) git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@446 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-05-29[lcd4linux @ 2004-05-29 15:53:28 by reinelt]reinelt3-9/+25 M50530: reset parport signals on exit plugin_ppp: ppp() has two parameters, not three lcd4linux.conf.sample: diskstats() corrected git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@445 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-05-29[lcd4linux @ 2004-05-29 01:07:56 by reinelt]reinelt2-21/+25 bug in plugin_diskstats fixed git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@444 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-05-29[lcd4linux @ 2004-05-29 00:27:14 by reinelt]reinelt8-11/+214 added plugin_diskstats.c git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@443 3ae390bd-cb1e-0410-b409-cd5a39f66f1f 2004-05-28[lcd4linux @ 2004-05-28 14:38:10 by reinelt]reinelt2-1/+41 Status and Changelog Update git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@442 3ae390bd-cb1e-0410-b409-cd5a39f66f1f