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
Russ Butler 2018-01-05 15:02:43 -06:00
parent 48cf4d85d1
commit beaac1525e
1 changed files with 3 additions and 3 deletions

View File

@ -438,7 +438,7 @@ void USBHAL::usbisr(void) {
if (istat & 1<<7) {
if (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
@ -493,13 +493,13 @@ void USBHAL::usbisr(void) {
// sleep interrupt
if (istat & 1<<4) {
USB0->ISTAT |= USB_ISTAT_SLEEP_MASK;
USB0->ISTAT = USB_ISTAT_SLEEP_MASK;
}
// error interrupt
if (istat & USB_ISTAT_ERROR_MASK) {
USB0->ERRSTAT = 0xFF;
USB0->ISTAT |= USB_ISTAT_ERROR_MASK;
USB0->ISTAT = USB_ISTAT_ERROR_MASK;
}
}