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/5954/head
Russ Butler 2018-01-05 15:02:43 -06:00 committed by Cruz Monrreal II‰
parent 40125cf121
commit f0b9add71e
1 changed files with 3 additions and 3 deletions

View File

@ -500,7 +500,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
@ -555,13 +555,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;
} }
} }