-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: usb: unify endpoint helper macros #26612
drivers: usb: unify endpoint helper macros #26612
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a comment to address.
include/drivers/usb/usb_dc.h
Outdated
/** Get endpoint address from endpoint index and direction */ | ||
#define USB_EP_GET_ADDR(idx, dir) ((idx) | ((dir) & USB_EP_DIR_MASK)) | ||
/** True if the endpoint is an IN endpoint */ | ||
#define USB_EP_DIR_IS_IN(ep) (USB_EP_GET_DIR(ep) == USB_EP_DIR_IN ? true : false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not the simple version:
#define USB_EP_DIR_IS_IN(ep) (USB_EP_GET_DIR(ep) == USB_EP_DIR_IN)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turned out this way, I will change it
990e1dd
to
cf75bdf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I idon't know why but I cannot comment for unchanged line.
Line 24 inusb_dc_sam0.c
. Macro USB_SAM0_IN_EP
should be deleted and all occurances should be replaced with USB_EP_DIR_IN
as a part of this PR.
Unify endpoint index and direction helper macros across all usb device drivers. Signed-off-by: Johann Fischer <j.fischer@phytec.de>
ep_idx is common used designator for endpoint index, rename ep_num to ep_idx in usb_dc_sam0 driver. Signed-off-by: Johann Fischer <j.fischer@phytec.de>
cf75bdf
to
9d434e9
Compare
Unify endpoint index and direction helper macros
across all usb device drivers.
ep_idx is common used designator for endpoint index,
rename ep_num to ep_idx in usb_dc_sam0 driver.