Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak user-bit math #52

Open
x42 opened this issue Nov 11, 2019 · 0 comments
Open

Tweak user-bit math #52

x42 opened this issue Nov 11, 2019 · 0 comments

Comments

@x42
Copy link
Owner

x42 commented Nov 11, 2019

Remaining part from #51 -- needs platform tests and check (ARM in particular)

diff --git a/src/ltc.c b/src/ltc.c
index bc54353..03afb1d 100644
--- a/src/ltc.c
+++ b/src/ltc.c
@@ -312,21 +312,21 @@ void ltc_encoder_set_user_bits(LTCEncoder *e, unsigned long data){

 unsigned long ltc_frame_get_user_bits(LTCFrame *f){
  unsigned long data = 0;
- data |= f->user8;
+ data += f->user8;
  data <<= 4;
- data |= f->user7;
+ data += f->user7;
  data <<= 4;
- data |= f->user6;
+ data += f->user6;
  data <<= 4;
- data |= f->user5;
+ data += f->user5;
  data <<= 4;
- data |= f->user4;
+ data += f->user4;
  data <<= 4;
- data |= f->user3;
+ data += f->user3;
  data <<= 4;
- data |= f->user2;
+ data += f->user2;
  data <<= 4;
- data |= f->user1;
+ data += f->user1;
  return data;
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant