Skip to content

Commit

Permalink
Fix CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
HiFiPhile committed Dec 29, 2022
1 parent e4f0720 commit e833426
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,8 @@ void dcd_edpt_close (uint8_t rhport, uint8_t ep_addr)
(void)rhport;

xfer_ctl_t * xfer = xfer_ctl_ptr(ep_addr);
uint8_t const epnum = xfer->epnum;
// Fix -Werror=null-dereference
uint8_t const epnum = ((xfer_ctl_t *)xfer)->epnum;
uint8_t const dir = tu_edpt_dir(ep_addr);

if(dir == TUSB_DIR_IN)
Expand Down Expand Up @@ -1004,7 +1005,6 @@ bool dcd_edpt_iso_activate(uint8_t rhport, tusb_desc_endpoint_t const * p_endpo
{
(void)rhport;
uint8_t const epnum = xfer_ctl_ptr(p_endpoint_desc->bEndpointAddress)->epnum;
uint8_t const dir = tu_edpt_dir(p_endpoint_desc->bEndpointAddress);
const uint16_t packet_size = tu_edpt_packet_size(p_endpoint_desc);
uint16_t pma_addr;

Expand Down Expand Up @@ -1071,7 +1071,8 @@ bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t
(void) rhport;

xfer_ctl_t * xfer = xfer_ctl_ptr(ep_addr);
uint8_t const epnum = xfer->epnum;
// Fix -Werror=null-dereference
uint8_t const epnum = ((xfer_ctl_t *)xfer)->epnum;
uint8_t const dir = tu_edpt_dir(ep_addr);

xfer->buffer = buffer;
Expand Down Expand Up @@ -1108,7 +1109,8 @@ bool dcd_edpt_xfer_fifo (uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16
(void) rhport;

xfer_ctl_t * xfer = xfer_ctl_ptr(ep_addr);
uint8_t const epnum = xfer->epnum;
// Fix -Werror=null-dereference
uint8_t const epnum = ((xfer_ctl_t *)xfer)->epnum;
uint8_t const dir = tu_edpt_dir(ep_addr);

xfer->buffer = NULL;
Expand Down Expand Up @@ -1138,7 +1140,8 @@ void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
(void)rhport;

xfer_ctl_t * xfer = xfer_ctl_ptr(ep_addr);
uint8_t const epnum = xfer->epnum;
// Fix -Werror=null-dereference
uint8_t const epnum = ((xfer_ctl_t *)xfer)->epnum;
uint8_t const dir = tu_edpt_dir(ep_addr);

if (dir == TUSB_DIR_IN)
Expand All @@ -1156,7 +1159,8 @@ void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
(void)rhport;

xfer_ctl_t * xfer = xfer_ctl_ptr(ep_addr);
uint8_t const epnum = xfer->epnum;
// Fix -Werror=null-dereference
uint8_t const epnum = ((xfer_ctl_t *)xfer)->epnum;
uint8_t const dir = tu_edpt_dir(ep_addr);

if (dir == TUSB_DIR_IN)
Expand Down
2 changes: 1 addition & 1 deletion src/portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_cnt_reg(__O uint16_t * pdwRe
/* There should be no remainder in the above calculation */
TU_ASSERT((wCount - (numblocks * (blocksize ? 32 : 2))) == 0, /**/);

/* Encode into register. When BLSIZE==1, we need to substract 1 block count */
/* Encode into register. When BLSIZE==1, we need to subtract 1 block count */
*pdwReg = (blocksize << 15) | ((numblocks - blocksize) << 10);
}

Expand Down

0 comments on commit e833426

Please sign in to comment.