From 5bba6d92068f869c880d8fe59712343146f63391 Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Thu, 4 Nov 2010 18:20:28 +1300 Subject: Fixed logic for clearing data toggle bits. --- include/libopenstm32/usb.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/libopenstm32/usb.h') diff --git a/include/libopenstm32/usb.h b/include/libopenstm32/usb.h index 6edfee3..608ee58 100644 --- a/include/libopenstm32/usb.h +++ b/include/libopenstm32/usb.h @@ -247,13 +247,13 @@ /* Macros for clearing DTOG bits */ #define USB_CLR_EP_TX_DTOG(EP) \ SET_REG(USB_EP_REG(EP), \ - (GET_REG(USB_EP_REG(EP)) & \ - USB_EP_NTOGGLE_MSK) | USB_EP_TX_DTOG) + GET_REG(USB_EP_REG(EP)) & \ + (USB_EP_NTOGGLE_MSK | USB_EP_TX_DTOG)) #define USB_CLR_EP_RX_DTOG(EP) \ SET_REG(USB_EP_REG(EP), \ - (GET_REG(USB_EP_REG(EP)) & \ - USB_EP_NTOGGLE_MSK) | USB_EP_RX_DTOG) + GET_REG(USB_EP_REG(EP)) & \ + (USB_EP_NTOGGLE_MSK | USB_EP_RX_DTOG)) /****************************************************************************** -- cgit v1.2.3