Skip to content

Commit

Permalink
Ensure part is up for some 100 ms before resetting it
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanrueger committed Jan 6, 2025
1 parent f1555ae commit 713241f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/linuxspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,14 @@ static int linuxspi_open(PROGRAMMER *pgm, const char *pt) {
goto close_gpiochip;
}

ret = linuxspi_reset_mcu(pgm, true);
if(ret)
// Ensure part is up for some 100 ms before resetting it
if((ret = linuxspi_reset_mcu(pgm, false)))
goto close_out;
usleep(100*1000);

if((ret = linuxspi_reset_mcu(pgm, true)))
goto close_out;
usleep(20000);

if(pgm->baudrate != 0) {
pmsg_warning("obsolete use of -b <clock> option for bit clock; use -B <clock>\n");
Expand Down

0 comments on commit 713241f

Please sign in to comment.