Not able to upload sketches after adding exit (0) to last sketch.. please help.

The last sketch I uploaded into my ATMega32U4 added the command "exit (0) ;" to close the loop from running on and on... only ever since it's uploaded, I can't upload any new sketches to the board. Does anyone have any advice on what I can do? When I plug the board into a computer it still produces the text from the most recent program, so it's still on there, but I'm thinking that the exit command did more than I expected somehow and perhaps shut the board down after running it???? I was using ABRISP mkll to upload before, and still using it now to (not) upload.

Here's the sketch:

#include "Keyboard.h"
void setup() {
// put your setup code here, to run once:

}
void loop() {
// put your main code here, to run repeatedly:

Keyboard.begin();
delay(1000);
Keyboard.print(F("25k code was here but I replaced it with this text")) ;

Keyboard.end() ;
exit(0) ;

}

When I try to upload anything now, I get this error message:

Sketch uses 3620 bytes (12%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.

avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = ""; type = �
Software Version = a.�; Hardware Version = �.�
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = ""; type = �
Software Version = a.�; Hardware Version = �.�
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader

A better way to stop the processor is to use a while(true); statement. Even better is to put all of your code in setup() and leave loop() empty.

It looks like you have a 1-second window when it's actually running and might accept an upload. Try starting the upload and then plugging it in so that you hit the one-second once the program is compiled. Or hit the reset button just before the upload starts.

If that doesn't work, do you have another Arduino to act as an ISP programmer?

Thanks!!! It took a dozen tries, but the last one finally uploaded and things are back to normal. I really appreciate it.