- remove comment out pin check
- replace _delay_ms by Delay_MS
GlobalInterruptEnable();
/* Run the USB management task while the bootloader is supposed to be running */
- /*if bit_is_clear(PINB,PB5) // PB5 is Digital 9 on Arduino Pro Micro
- {
- loop_until_bit_is_set(PINB,PB5);
-
- while ((RunBootloader || WaitForExit) && bit_is_set(PINB,PB5))
- USB_USBTask();
-
- loop_until_bit_is_clear(PINB,PB5);
- }*/
-
stayinbootloader = false;
uint16_t i = 0;
if (!stayinbootloader)
{
- _delay_ms(1);
+ Delay_MS(1);
if (i++ > 5000)
{
break;