Skip to content
This repository has been archived by the owner on Dec 24, 2023. It is now read-only.

receiveNumber bug #50

Open
VanMo opened this issue Mar 20, 2019 · 1 comment
Open

receiveNumber bug #50

VanMo opened this issue Mar 20, 2019 · 1 comment

Comments

@VanMo
Copy link

VanMo commented Mar 20, 2019

Hello.
I faced a problem trying to read big value with method bool receiveNumber(uint32_t *number).
The method can't construct 32-bit value, because it shifting too small registers here:
*number = (temp[4] << 24) | (temp[3] << 16) | (temp[2] << 8) | (temp[1]);
it works better if doing this:
*number = ((uint32_t)temp[4] << 24) | ((uint32_t)temp[3] << 16) | ((uint32_t)temp[2] << 8) | (temp[1]);

@DanNixon
Copy link
Owner

Glad you find a solution, unfortunately as the readme states I no longer use (or have access to) these displays so do not support this library anymore.

If you have working modifications to the library I'd happily accept a PR through.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants