File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -859,15 +859,12 @@ static int stk500_open(PROGRAMMER *pgm, const char *port) {
859859 if (stk500_getsync (pgm ) < 0 )
860860 return -1 ;
861861
862- if (pgm -> bitclock ) {
863- if (str_caseeq (pgmid , "arduino_as_isp" )) // The Arduino as ISP will crash if we change the bitclock
862+ if (pgm -> bitclock ) { // Set bitclock if programmer can do so
863+ // Arduino as ISP will crash on changing the bitclock: HAS_BITCLOCK_ADJ bit is not set
864+ if (!(pgm -> extra_features & HAS_BITCLOCK_ADJ ))
864865 pmsg_warning ("-c %s does not support adjustable bitclock speed; ignoring -B\n" , pgmid );
865- else {
866- if (!(pgm -> extra_features & HAS_BITCLOCK_ADJ ))
867- pmsg_warning ("setting bitclock despite HAS_BITCLOCK_ADJ missing in pgm->extra_features\n" );
868- if (pgm -> set_sck_period (pgm , pgm -> bitclock ) != 0 )
869- return -1 ;
870- }
866+ else if (pgm -> set_sck_period (pgm , pgm -> bitclock ))
867+ return -1 ;
871868 }
872869
873870 return 0 ;
You can’t perform that action at this time.
0 commit comments