Pinscape Controller version 1 fork. This is a fork to allow for ongoing bug fixes to the original controller version, from before the major changes for the expansion board project.
Dependencies: FastIO FastPWM SimpleDMA mbed
Fork of Pinscape_Controller by
Revision 67:4353ba51a465, committed 2016-02-12
- Comitter:
- mjr
- Date:
- Fri Feb 12 21:52:59 2016 +0000
- Parent:
- 66:cbb142cbf426
- Commit message:
- Revert all stall handling to original mbed version - testing fixes to compatibility problem
Changed in this revision
USBDevice/USBDevice/USBHAL_KL25Z.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/USBDevice/USBDevice/USBHAL_KL25Z.cpp Fri Feb 12 21:48:08 2016 +0000 +++ b/USBDevice/USBDevice/USBHAL_KL25Z.cpp Fri Feb 12 21:52:59 2016 +0000 @@ -538,35 +538,16 @@ void USBHAL::stallEndpoint(uint8_t endpoint) { + // Set the stall bit in the endpoint register. This causes the + // SIE to send a STALL handshake to the host on any transaction + // on this endpoint. USB0->ENDPOINT[PHY_TO_LOG(endpoint)].ENDPT |= USB_ENDPT_EPSTALL_MASK; } void USBHAL::unstallEndpoint(uint8_t endpoint) { - ENTER_CRITICAL_SECTION - { - // clear the stall bit in the endpoint register - USB0->ENDPOINT[PHY_TO_LOG(endpoint)].ENDPT &= ~USB_ENDPT_EPSTALL_MASK; - - // take ownership of the BDT entry - int idx = PEP_BDT_IDX(endpoint, 0); - bdt[idx].info &= ~(BD_OWN_MASK | BD_STALL_MASK | BD_DATA01_MASK); - - // if this is an RX endpoint, start a new read - if (OUT_EP(endpoint)) - { - bdt[idx].byte_count = epMaxPacket[endpoint]; - bdt[idx].info = BD_OWN_MASK | BD_DTS_MASK; - } - - // Reset Data1 for the endpoint - we need to set the bit to 1 for - // either TX or RX, by the same logic as in realiseEndpoint() - Data1 |= (1 << endpoint); - - // clear the 'completed' bit for the endpoint - epComplete &= ~(1 << endpoint); - } - EXIT_CRITICAL_SECTION + // clear the stall bit in the endpoint register + USB0->ENDPOINT[PHY_TO_LOG(endpoint)].ENDPT &= ~USB_ENDPT_EPSTALL_MASK; } bool USBHAL::getEndpointStallState(uint8_t endpoint)