From d5ef72ac125348bdc0a86df48c0ca02c1be97068 Mon Sep 17 00:00:00 2001 From: Marc Lasch Date: Wed, 17 Sep 2014 00:27:12 +0200 Subject: ebus-racket: fix field-decoder-data1b and 'data1c --- ebus-racket/ebus/layer7.rkt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ebus-racket/ebus') diff --git a/ebus-racket/ebus/layer7.rkt b/ebus-racket/ebus/layer7.rkt index b2947a0..f30e952 100644 --- a/ebus-racket/ebus/layer7.rkt +++ b/ebus-racket/ebus/layer7.rkt @@ -78,7 +78,7 @@ (list 'data1b (lambda (name field offset payload) (list name 'data1b (field-decoder-data1b (list-ref payload offset))))) (list 'data1c (lambda (name field offset payload) - (list name 'data1b (field-decoder-data1c (list-ref payload offset))))) + (list name 'data1c (field-decoder-data1c (list-ref payload offset))))) (list 'data2b (lambda (name field offset payload) (list name 'data2b (field-decoder-data2b (list-ref payload offset) @@ -106,7 +106,9 @@ (define (field-decoder-data1b value) (if (= value #x80) (ersatzwert) - value)) + (cond ((= 1 (arithmetic-shift value -7)) + (* -1 (+ 1 (bitwise-xor #xff value)))) + (else value)))) ;; type data1c (define (field-decoder-data1c value) -- cgit v1.2.1