diff options
author | Marc Lasch <lasch.marc@gmail.com> | 2014-09-17 00:27:12 +0200 |
---|---|---|
committer | Marc Lasch <lasch.marc@gmail.com> | 2014-09-17 00:27:12 +0200 |
commit | d5ef72ac125348bdc0a86df48c0ca02c1be97068 (patch) | |
tree | cb54a93cca2197b59c9fefdcff51d08636dffa44 | |
parent | 02469a259e2b1878eeae82289d56780ea6c6f76e (diff) | |
download | ebus-alt-d5ef72ac125348bdc0a86df48c0ca02c1be97068.tar.gz ebus-alt-d5ef72ac125348bdc0a86df48c0ca02c1be97068.zip |
ebus-racket: fix field-decoder-data1b and 'data1c
-rw-r--r-- | ebus-racket/ebus/layer7.rkt | 6 |
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) |