aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/modbuslog.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/modbuslog.c b/src/modbuslog.c
index 9ef6f49..b310cc7 100644
--- a/src/modbuslog.c
+++ b/src/modbuslog.c
@@ -311,10 +311,7 @@ int main(int argc, char *argv[]) {
}
// bitshifting magic
- switch (numregisters) {
- case 1:
- registervalue = byte[0];
- break;
+ switch (numregisters*2) {
case 2:
registervalue = ((byte[0]) << 8) + byte[1];
break;
@@ -323,7 +320,7 @@ int main(int argc, char *argv[]) {
+ ((byte[2]) << 8) + byte[3];
break;
default:
- registervalue = byte[0];
+ registervalue = ((byte[0]) << 8) + byte[1];
break;
}
n> 2010-02-11All static memory allocations were turned into dynamical ones.mjona1-128/+200 2010-02-07timer.c: two small optimizations (removed "flag"; tv_usec can't be negative)mzuther1-7/+4 2010-02-07added grouping of widgets by update interval (new file "timer_group.c")mzuther13-168/+441 2010-02-07BUG: handle negative delays in timer_process() (timer.c)mzuther1-0/+4 2010-02-06timer.c: I had forgotten how to initialize a "struct" :)mzuther1-3/+4 2010-02-06BUG: compensate timers for processing delay ("timer.c")mzuther1-1/+3 2010-02-06timer.c: exchanged "proprietary code" with timeradd() and timersub() functionsmzuther1-14/+10 2010-02-04timer.c: removed fruitless changes to variable "flag" from timer_process()mzuther1-2/+0 2010-02-04According to its man page, timercmp() is broken on some systems -- applied th...mzuther1-1/+1 2010-02-04small warning removedmichael1-1/+1 2010-02-04clear errno after creating the FIFO by Claas Hilbrechtmichael1-0/+2