From 0bfb3a64e8334a81667834001d84a677a979773e Mon Sep 17 00:00:00 2001 From: Andrey Zonov Date: Thu, 30 Dec 2021 12:52:51 -0800 Subject: [PATCH] Fix the logic for default value of USB_INTR_CFG_SET Use `if` condition instead of `ifdef` for USB_COUNT_SOF macro which is consistent throughout the code base. USB_COUNT_SOF is set to 0 in usbconfig-prototype.h which causes interrupt to be set to falling edge instead of rising edge as it meant. --- usbdrv/usbdrv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usbdrv/usbdrv.h b/usbdrv/usbdrv.h index f094120..0d8c3c1 100644 --- a/usbdrv/usbdrv.h +++ b/usbdrv/usbdrv.h @@ -608,7 +608,7 @@ int usbDescriptorStringSerialNumber[]; # endif #endif #ifndef USB_INTR_CFG_SET /* allow user to override our default */ -# if defined(USB_COUNT_SOF) || defined(USB_SOF_HOOK) +# if USB_COUNT_SOF || defined(USB_SOF_HOOK) # define USB_INTR_CFG_SET (1 << ISC01) /* cfg for falling edge */ /* If any SOF logic is used, the interrupt must be wired to D- where * we better trigger on falling edge