sha204-Breakout
sha204-Breakout copied to clipboard
Should change the type from uint8_t to float
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.