X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/cb779e3d7d32d7c43e0a45bb526de0a04135b0c7..b87d0b45a2d613c2ecfd79447ccd3b8ceaf0bddb:/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c diff --git a/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c b/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c index 30d45c916..97e0fb305 100644 --- a/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c +++ b/Projects/AVRISP-MKII/Lib/ISP/ISPProtocol.c @@ -64,15 +64,9 @@ void ISPProtocol_EnterISPMode(void) CurrentAddress = 0; - /* Set up the synchronous USART to generate the .5MHz recovery clock on XCK pin */ - UBRR1 = (F_CPU / 500000UL); - UCSR1B = (1 << TXEN1); - UCSR1C = (1 << UMSEL10) | (1 << UPM11) | (1 << USBS1) | (1 << UCSZ11) | (1 << UCSZ10) | (1 << UCPOL1); - DDRD |= (1 << 5); - /* Perform execution delay, initialize SPI bus */ ISPProtocol_DelayMS(Enter_ISP_Params.ExecutionDelayMS); - ISPTarget_Init(); + ISPTarget_EnableTargetISP(); /* Continuously attempt to synchronize with the target until either the number of attempts specified * by the host has exceeded, or the the device sends back the expected response values */ @@ -124,15 +118,9 @@ void ISPProtocol_LeaveISPMode(void) /* Perform pre-exit delay, release the target /RESET, disable the SPI bus and perform the post-exit delay */ ISPProtocol_DelayMS(Leave_ISP_Params.PreDelayMS); ISPTarget_ChangeTargetResetLine(false); - ISPTarget_ShutDown(); + ISPTarget_DisableTargetISP(); ISPProtocol_DelayMS(Leave_ISP_Params.PostDelayMS); - /* Turn off the synchronous USART to terminate the recovery clock on XCK pin */ - UBRR1 = (F_CPU / 500000UL); - UCSR1B = (1 << TXEN1); - UCSR1C = (1 << UMSEL10) | (1 << UPM11) | (1 << USBS1) | (1 << UCSZ11) | (1 << UCSZ10) | (1 << UCPOL1); - DDRD &= ~(1 << 5); - Endpoint_Write_Byte(CMD_LEAVE_PROGMODE_ISP); Endpoint_Write_Byte(STATUS_CMD_OK); Endpoint_ClearIN();