uint64_t with chipKIT #482
Unanswered
JacobChrist
asked this question in
Q&A
Replies: 1 comment
-
I would guess it's related to your pos_* variables being only 8 bit and you're passing them through 64 bit parameters. Try passing that parameter as 8 bit not 64 bit (64 bit is wasteful for that parameter anyway). There should be no need to do any casting at all for a simple bit shift. You can also try looking at the generated assembly code to see what it thinks it's doing... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've seen some one off issues with uint64_t with the fubarino mini 2.0. I think this is the first time ever that I've used a uint64_t anytime. I have this function, and doesn't seem to always shift the correct amount of time. I don't feel like I need the type casting on the 3 or that pos needs to be a uint64_t but I was grasping for straws.
This code is being called the following code that read a 3-axis accelerometer and then displays one color per axis on a 16 pixel RGB dispay. X gets shifted two more times that pos_x, Y gets shifted one more time that pos_y and Z is correct. It so strange. I'm burnt out for the day, but when I get back to this I'm going to try using utint32_t to see if I have better results.
Jacob
Beta Was this translation helpful? Give feedback.
All reactions