mirror of
https://github.com/hathach/tinyusb.git
synced 2026-04-01 04:13:25 +00:00
net: cache ep_size in local variable in ncm_device.c xmit_insert_required_zlp
Co-authored-by: HiFiPhile <4375114+HiFiPhile@users.noreply.github.com> Agent-Logs-Url: https://github.com/hathach/tinyusb/sessions/5d355974-2223-4071-8d14-b6d4ac1fd030
This commit is contained in:
@ -340,7 +340,8 @@ static xmit_ntb_t *xmit_get_next_ready_ntb(void) {
|
||||
static bool xmit_insert_required_zlp(uint8_t rhport, uint32_t xferred_bytes) {
|
||||
TU_LOG_DRV("xmit_insert_required_zlp(%d,%ld)\n", rhport, xferred_bytes);
|
||||
|
||||
if (xferred_bytes == 0 || xferred_bytes % (tud_speed_get() == TUSB_SPEED_HIGH ? 512 : 64) != 0) {
|
||||
uint16_t const ep_size = (tud_speed_get() == TUSB_SPEED_HIGH) ? 512 : 64;
|
||||
if (xferred_bytes == 0 || xferred_bytes % ep_size != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user