summaryrefslogtreecommitdiff
path: root/src/device/usbd_pvt.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-11-03 16:36:07 +0700
committerhathach <[email protected]>2025-11-04 19:56:53 +0700
commit8979af34c0e5b97520070bcfdffe5280de9ac24c (patch)
tree4ca427d8a2bd73baedd52d1076e8386b447a85d0 /src/device/usbd_pvt.h
parent22f01aea0d31b5a54532877d02d61f51041aeb6f (diff)
Fixed more alert found by PVS-Studio
Diffstat (limited to 'src/device/usbd_pvt.h')
-rw-r--r--src/device/usbd_pvt.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/device/usbd_pvt.h b/src/device/usbd_pvt.h
index a688cf497..2894d3023 100644
--- a/src/device/usbd_pvt.h
+++ b/src/device/usbd_pvt.h
@@ -117,7 +117,9 @@ bool usbd_edpt_iso_activate(uint8_t rhport, tusb_desc_endpoint_t const * p_endp
// Check if endpoint is ready (not busy and not stalled)
TU_ATTR_ALWAYS_INLINE static inline
bool usbd_edpt_ready(uint8_t rhport, uint8_t ep_addr) {
- return !usbd_edpt_busy(rhport, ep_addr) && !usbd_edpt_stalled(rhport, ep_addr);
+ const bool is_busy = usbd_edpt_busy(rhport, ep_addr);
+ const bool is_stalled = usbd_edpt_stalled(rhport, ep_addr);
+ return !is_busy && !is_stalled;
}
// Enable SOF interrupt