-
-
Notifications
You must be signed in to change notification settings - Fork 98
Open
Description
Describe the bug
Using this library to build a Control Panel on the Arduino Uno R4 Renesas platform (using PlatformIO), the PD is never polled. I believe this applies to more platforms, likely including all embedded devices, but I'm not entirely sure of that.
Expected behavior
The microcontroller would poll the reader every ~50ms
Observed behavior
The microcontroller never polls the reader and thus never receives the message that a card was scanned, a keypad button was pressed, or any other event.
Additional context
The cause of this issue is as follows:
osdp_cp.ccallsosdp_millis_since()to check whether it should pollosdp_millis_since()callsosdp_millis_now(), which callsmillis_now()which is defined ingoToMain/c-utilsmillis_now()callsusec_now(), which callsgettimeofday()- On (at least) this platform, the preprocessor condition
#elif defined(__BARE_METAL__)is met, meaninggettimeofday()is defined at line 167 as:
int gettimeofday(struct timeval * tp, struct timezone * tzp)
{
ARG_UNUSED(tzp);
tp->tv_sec = 0;
tp->tv_usec = 0;
return 0;
}- As a result,
osdp_millis_since()is never aware that any time has passed, and thus the initial conditional never triggers aCMD_POLL.
Metadata
Metadata
Assignees
Labels
No labels