diff --git a/linuxspi.c b/linuxspi.c index ffb17dfa..fa637d87 100644 --- a/linuxspi.c +++ b/linuxspi.c @@ -180,6 +180,14 @@ static int linuxspi_gpio_op_wr(PROGRAMMER* pgm, LINUXSPI_GPIO_OP op, int gpio, c FILE* f = fopen(fn, "w"); + int fopen_retries = 0; + while (!f && fopen_retries < 100) + { + usleep(20000); + f = fopen(fn, "w"); + fopen_retries++; + } + if (!f) { fprintf(stderr, "%s: linuxspi_gpio_op_wr(): Unable to open file %s", progname, fn);