You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
here is a working functional equivalent of the original gpio_poll(), the latter should be considered broken
(in the context of the operating system version used, may be...)
int gpio_poll_val(int fd) // returns 0/1 - new pin state,
// -2 - error occured (see errno), for compatibility ret with gpio_poll()
{
char val;
int ret;
lseek(fd, 0, SEEK_SET);
if (read(fd, &val, 1) < 1)
return -2;
ret = val-'0';
return ret;
}
the reason this code (original gpio_poll()) doesn't work is that between the return from poll() and reading the value, events can happen that will be cancelled when reading the value
(has this code never been tested in real work??)
Description of problem: gpio_poll() hangs master
Using gpio_poll() as that
hangs master.
To Reproduce
I got that behaviour when
erpc_c/transports/erpc_spidev_master_transport.cpp
was tested with gpio synchronization turned on.
Expected behavior
No hangs.
Screenshots
Desktop (please complete the following information)
Steps you didn't forgot to do
Additional context
That's modification works fine:
The text was updated successfully, but these errors were encountered: