From a361b72680f536e07cbc8055c52fd83aec21a935 Mon Sep 17 00:00:00 2001 From: gyojir Date: Fri, 4 Jan 2019 01:15:41 +0900 Subject: [PATCH] Do not flip toggle value on Toggle Error --- Usb.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Usb.cpp b/Usb.cpp index 7843d49b..30790c45 100644 --- a/Usb.cpp +++ b/Usb.cpp @@ -172,8 +172,6 @@ uint8_t USB::ctrlReq(uint8_t addr, uint8_t ep, uint8_t bmReqType, uint8_t bReque rcode = InTransfer(pep, nak_limit, &read, dataptr); if(rcode == hrTOGERR) { - // yes, we flip it wrong here so that next time it is actually correct! - pep->bmRcvToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 0 : 1; continue; } @@ -239,9 +237,6 @@ uint8_t USB::InTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t *nbytesptr, ui #endif rcode = dispatchPkt(tokIN, pep->epAddr, nak_limit); //IN packet to EP-'endpoint'. Function takes care of NAKS. if(rcode == hrTOGERR) { - // yes, we flip it wrong here so that next time it is actually correct! - pep->bmRcvToggle = (regRd(rHRSL) & bmRCVTOGRD) ? 0 : 1; - regWr(rHCTL, (pep->bmRcvToggle) ? bmRCVTOG1 : bmRCVTOG0); //set toggle value continue; } if(rcode) { @@ -363,9 +358,6 @@ uint8_t USB::OutTransfer(EpInfo *pep, uint16_t nak_limit, uint16_t nbytes, uint8 //return ( rcode); break; case hrTOGERR: - // yes, we flip it wrong here so that next time it is actually correct! - pep->bmSndToggle = (regRd(rHRSL) & bmSNDTOGRD) ? 0 : 1; - regWr(rHCTL, (pep->bmSndToggle) ? bmSNDTOG1 : bmSNDTOG0); //set toggle value break; default: goto breakout;