{\r
/* Configure hardware required by the bootloader */\r
SetupHardware();\r
+ \r
+ /* Enable global interrupts so that the USB stack can function */\r
+ sei();\r
\r
/* Run the USB management task while the bootloader is supposed to be running */\r
while (RunBootloader || WaitForExit)\r
/* Throw away the filler bytes before the start of the firmware */\r
DiscardFillerBytes(DFU_FILLER_BYTES_SIZE);\r
\r
- /* Throw away the page alignment filler bytes before the start of the firmware */\r
- DiscardFillerBytes(StartAddr % SPM_PAGESIZE);\r
+ /* Throw away the packet alignment filler bytes before the start of the firmware */\r
+ DiscardFillerBytes(StartAddr % FIXED_CONTROL_ENDPOINT_SIZE);\r
\r
/* Calculate the number of bytes remaining to be written */\r
uint16_t BytesRemaining = ((EndAddr - StartAddr) + 1);\r