mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-11 00:39:57 +00:00
enable -Wnull-dereference
This commit is contained in:
parent
099d3b377f
commit
826b34a8ac
@ -105,7 +105,8 @@ CFLAGS += \
|
|||||||
-Wunreachable-code \
|
-Wunreachable-code \
|
||||||
-Wcast-align \
|
-Wcast-align \
|
||||||
-Wcast-function-type \
|
-Wcast-function-type \
|
||||||
-Wcast-qual
|
-Wcast-qual \
|
||||||
|
-Wnull-dereference
|
||||||
|
|
||||||
# Debugging/Optimization
|
# Debugging/Optimization
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
|
@ -12,7 +12,7 @@ CFLAGS += \
|
|||||||
-DCFG_TUSB_MCU=OPT_MCU_SAMG
|
-DCFG_TUSB_MCU=OPT_MCU_SAMG
|
||||||
|
|
||||||
# suppress following warnings from mcu driver
|
# suppress following warnings from mcu driver
|
||||||
CFLAGS += -Wno-error=undef -Wno-error=cast-qual
|
CFLAGS += -Wno-error=undef -Wno-error=cast-qual -Wno-error=null-dereference
|
||||||
|
|
||||||
ASF_DIR = hw/mcu/microchip/samg55
|
ASF_DIR = hw/mcu/microchip/samg55
|
||||||
|
|
||||||
|
@ -144,7 +144,9 @@ static USBD_EP_T *ep_entry(uint8_t ep_addr, bool add)
|
|||||||
enum ep_enum ep_index;
|
enum ep_enum ep_index;
|
||||||
struct xfer_ctl_t *xfer;
|
struct xfer_ctl_t *xfer;
|
||||||
|
|
||||||
for (ep_index = PERIPH_EPA, xfer = &xfer_table[PERIPH_EPA], ep = USBD->EP; ep_index < PERIPH_MAX_EP; ep_index++, xfer++, ep++)
|
for (ep_index = PERIPH_EPA, xfer = &xfer_table[PERIPH_EPA], ep = USBD->EP;
|
||||||
|
ep_index < PERIPH_MAX_EP;
|
||||||
|
ep_index++, xfer++, ep++)
|
||||||
{
|
{
|
||||||
if (add)
|
if (add)
|
||||||
{
|
{
|
||||||
@ -396,6 +398,7 @@ bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t *buffer, uint16_t to
|
|||||||
/* mine the data for the information we need */
|
/* mine the data for the information we need */
|
||||||
tusb_dir_t dir = tu_edpt_dir(ep_addr);
|
tusb_dir_t dir = tu_edpt_dir(ep_addr);
|
||||||
USBD_EP_T *ep = ep_entry(ep_addr, false);
|
USBD_EP_T *ep = ep_entry(ep_addr, false);
|
||||||
|
TU_ASSERT(ep);
|
||||||
struct xfer_ctl_t *xfer = &xfer_table[ep - USBD->EP];
|
struct xfer_ctl_t *xfer = &xfer_table[ep - USBD->EP];
|
||||||
|
|
||||||
/* store away the information we'll needing now and later */
|
/* store away the information we'll needing now and later */
|
||||||
@ -457,6 +460,7 @@ void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
|
|||||||
if (tu_edpt_number(ep_addr))
|
if (tu_edpt_number(ep_addr))
|
||||||
{
|
{
|
||||||
USBD_EP_T *ep = ep_entry(ep_addr, false);
|
USBD_EP_T *ep = ep_entry(ep_addr, false);
|
||||||
|
TU_ASSERT(ep, );
|
||||||
ep->EPRSPCTL = (ep->EPRSPCTL & 0xf7) | USBD_EPRSPCTL_HALT_Msk;
|
ep->EPRSPCTL = (ep->EPRSPCTL & 0xf7) | USBD_EPRSPCTL_HALT_Msk;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -472,6 +476,7 @@ void dcd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr)
|
|||||||
if (tu_edpt_number(ep_addr))
|
if (tu_edpt_number(ep_addr))
|
||||||
{
|
{
|
||||||
USBD_EP_T *ep = ep_entry(ep_addr, false);
|
USBD_EP_T *ep = ep_entry(ep_addr, false);
|
||||||
|
TU_ASSERT(ep, );
|
||||||
ep->EPRSPCTL = USBD_EPRSPCTL_TOGGLE_Msk;
|
ep->EPRSPCTL = USBD_EPRSPCTL_TOGGLE_Msk;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user