X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/c1a1b6eeecb375259968ef6d989833312047f2d8..14c5615474b46716d69141ed459c5aa2af3bd65d:/Bootloaders/CDC/BootloaderCDC.c diff --git a/Bootloaders/CDC/BootloaderCDC.c b/Bootloaders/CDC/BootloaderCDC.c index 654eabd22..0add977ce 100644 --- a/Bootloaders/CDC/BootloaderCDC.c +++ b/Bootloaders/CDC/BootloaderCDC.c @@ -71,8 +71,8 @@ int main(void) MCUSR &= ~(1 << WDRF); wdt_disable(); - /* Disable Clock Division */ - SetSystemClockPrescaler(0); + /* Disable clock division */ + clock_prescale_set(clock_div_1); /* Relocate the interrupt vector table to the bootloader section */ MCUCR = (1 << IVCE); @@ -167,6 +167,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket) Endpoint_ClearSetupIN(); + /* Acknowledge status stage */ while (!(Endpoint_IsSetupOUTReceived())); Endpoint_ClearSetupOUT(); } @@ -184,6 +185,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket) Endpoint_ClearSetupOUT(); + /* Acknowledge status stage */ while (!(Endpoint_IsSetupINReady())); Endpoint_ClearSetupIN(); } @@ -194,6 +196,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket) { Endpoint_ClearSetupReceived(); + /* Acknowledge status stage */ while (!(Endpoint_IsSetupINReady())); Endpoint_ClearSetupIN(); } @@ -207,7 +210,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket) * * \param Command Single character AVR910 protocol command indicating what memory operation to perform */ -static void ProgramReadWriteMemoryBlock(const uint8_t Command) +static void ReadWriteMemoryBlock(const uint8_t Command) { uint16_t BlockSize; char MemoryType; @@ -503,7 +506,7 @@ TASK(CDC_Task) else if ((Command == 'B') || (Command == 'g')) { /* Delegate the block write/read to a seperate function for clarity */ - ProgramReadWriteMemoryBlock(Command); + ReadWriteMemoryBlock(Command); } else if (Command == 'R') {