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

Should change the type from uint8_t to float #4

Open
sevstels opened this issue Apr 17, 2023 · 0 comments
Open

Should change the type from uint8_t to float #4

sevstels opened this issue Apr 17, 2023 · 0 comments

Comments

@sevstels
Copy link

sevstels commented Apr 17, 2023

The timeouts are not correctly.

For example: poll_delay = DEVREV_DELAY;
poll_delay is defined as uint8_t;
But its initializing macros are defined as float. And they are always less than 1.
That's why the entire library calculates delays incorrectly...

#define READ_DELAY ((uint8_t) (((0.4 * CPU_CLOCK_DEVIATION_NEGATIVE(<=0.99) - 0.5))) //0.4*0.99-0.5 = -0.104
Now when preprocessor convert types to: (uint8_t)(-0.104) we get 0
There was no point in defining macros more accurately than 1 ms.

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