How to program using USBASP and keep bootloader

hello, sorry for reviving,

I use arduino nano sketched by USBasp and without bootloader,

so the wdt will stuck in reset after the first timeout after programming.
and I did the same approach to overcome the problem
before finding this post :frowning:

there is no other library delaying the setup(); in my program
and my following code under setup works and will stops it from wdt_resetting.

#include <Adafruit_SleepyDog.h>

void setup() {

MCUSR = 0;
// I find the line above in <avr/wdt.h> , seems it clears the wdt_restart flag, not sure if it is the flag?
// and solves the ultimate_resetting after wdt reset.
// the flag is necessary to be clear before wdt_disable,

Watchdog.disable();
// I use the adafruit_watchdog library
// I believe this line is equal to "wdt_disable();" in the wdt.h .

....