Merge tag 'LUFA-210130' into ProMicro
authorPeter Henn <Peter.Henn@web.de>
Wed, 29 Dec 2021 12:10:53 +0000 (12:10 +0000)
committerPeter Henn <Peter.Henn@web.de>
Sun, 2 Jan 2022 00:00:59 +0000 (00:00 +0000)
- use merge strategy "theirs", means in principle rebase ProMicro branch
  to LUFA-210130
- Still remove FUSE_BOOTRST check in Application_Jump_Check, although it
  is in meantime fixed, but ProMicro would now no longer enter bootloader
  once a application is flashed.

1  2 
Bootloaders/DFU/BootloaderDFU.c
Bootloaders/DFU/BootloaderDFU.h
Bootloaders/DFU/makefile

@@@ -180,37 -188,12 +180,40 @@@ int main(void
        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;
        while (RunBootloader || WaitForExit)
 -        USB_USBTask();
 +      {
 +              USB_USBTask();
 +
 +              if (!stayinbootloader)
 +              {
 +                      _delay_ms(1);
 +                      if (i++ > 5000)
 +                      {
 +                              break;
 +                      }
 +              }
 +              else
 +              {
 +                      i = 0;
 +              }
 +      }
  
+       /* Wait a short time to end all USB transactions and then disconnect */
+       _delay_us(1000);
        /* Reset configured hardware back to their original states for the user application */
        ResetHardware();
  
Simple merge
Simple merge