summaryrefslogtreecommitdiff
path: root/ebus-racket/ebus
diff options
context:
space:
mode:
authorMarc Lasch <lasch.marc@gmail.com>2014-09-17 00:27:12 +0200
committerMarc Lasch <lasch.marc@gmail.com>2014-09-17 00:27:12 +0200
commitd5ef72ac125348bdc0a86df48c0ca02c1be97068 (patch)
treecb54a93cca2197b59c9fefdcff51d08636dffa44 /ebus-racket/ebus
parent02469a259e2b1878eeae82289d56780ea6c6f76e (diff)
downloadebus-alt-d5ef72ac125348bdc0a86df48c0ca02c1be97068.tar.gz
ebus-alt-d5ef72ac125348bdc0a86df48c0ca02c1be97068.zip
ebus-racket: fix field-decoder-data1b and 'data1c
Diffstat (limited to 'ebus-racket/ebus')
-rw-r--r--ebus-racket/ebus/layer7.rkt6
1 files changed, 4 insertions, 2 deletions
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)