mirror of https://github.com/ARMmbed/mbed-os.git
Fix clearing of ISTAT in Kinetis USB
The ISTAT register is write 1 to clear. Because of this ORing this register with itself fill clear all bits that are set. This patch updates the code to use plain assignment so only desired bit is cleared.pull/5874/head
parent
48cf4d85d1
commit
beaac1525e
|
|
@ -438,7 +438,7 @@ void USBHAL::usbisr(void) {
|
||||||
if (istat & 1<<7) {
|
if (istat & 1<<7) {
|
||||||
if (USB0->ENDPOINT[0].ENDPT & USB_ENDPT_EPSTALL_MASK)
|
if (USB0->ENDPOINT[0].ENDPT & USB_ENDPT_EPSTALL_MASK)
|
||||||
USB0->ENDPOINT[0].ENDPT &= ~USB_ENDPT_EPSTALL_MASK;
|
USB0->ENDPOINT[0].ENDPT &= ~USB_ENDPT_EPSTALL_MASK;
|
||||||
USB0->ISTAT |= USB_ISTAT_STALL_MASK;
|
USB0->ISTAT = USB_ISTAT_STALL_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// token interrupt
|
// token interrupt
|
||||||
|
|
@ -493,13 +493,13 @@ void USBHAL::usbisr(void) {
|
||||||
|
|
||||||
// sleep interrupt
|
// sleep interrupt
|
||||||
if (istat & 1<<4) {
|
if (istat & 1<<4) {
|
||||||
USB0->ISTAT |= USB_ISTAT_SLEEP_MASK;
|
USB0->ISTAT = USB_ISTAT_SLEEP_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// error interrupt
|
// error interrupt
|
||||||
if (istat & USB_ISTAT_ERROR_MASK) {
|
if (istat & USB_ISTAT_ERROR_MASK) {
|
||||||
USB0->ERRSTAT = 0xFF;
|
USB0->ERRSTAT = 0xFF;
|
||||||
USB0->ISTAT |= USB_ISTAT_ERROR_MASK;
|
USB0->ISTAT = USB_ISTAT_ERROR_MASK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue