From ba16f90be10b7a8e9685ca240ebb324ac678617c Mon Sep 17 00:00:00 2001 From: Anders Blomdell <anders.blomdell@control.lth.se> Date: Fri, 5 Mar 2021 11:15:31 +0100 Subject: [PATCH] Fix serial2002 32 bit error --- Makefile | 2 +- plugins/serial2002/serial2002.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 61caf1e..e59a87d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ LIBRARIES=libmoberg.so -MOBERG_VERSION=$(shell git describe --tags | sed -e 's/^v//;s/-/_/g' ) +MOBERG_VERSION=$(shell git describe --tags | sed -e 's/^v//;s/-/./g' ) CCFLAGS+=-Wall -Werror -I$(shell pwd) -O3 -g LDFLAGS+=-L$(shell pwd)/build/ -lmoberg PLUGINS:=$(wildcard plugins/*) diff --git a/plugins/serial2002/serial2002.c b/plugins/serial2002/serial2002.c index e94ca95..564e689 100644 --- a/plugins/serial2002/serial2002.c +++ b/plugins/serial2002/serial2002.c @@ -281,7 +281,7 @@ static void remap_analog( for (int i = 0 ; i < count ; i++) { if (channel[i].kind == kind) { remap->map[remap->count].index = i; - remap->map[remap->count].maxdata = (1 << channel[i].bits) - 1; + remap->map[remap->count].maxdata = (1ULL << channel[i].bits) - 1; remap->map[remap->count].min = channel[i].min; remap->map[remap->count].max = channel[i].max; if (remap->map[remap->count].maxdata) { -- GitLab