Skip to content
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

#133 fix possible pedantic errors #137

Merged
merged 1 commit into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/usbd_stm32f103_devfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static void ep_deconfig(uint8_t ep) {
}

static uint16_t pma_read (uint8_t *buf, uint16_t blen, pma_rec *rx) {
uint16_t tmp;
uint16_t tmp = 0;
uint16_t *pma = PMA(rx->addr);
uint16_t rxcnt = rx->cnt & 0x03FF;
rx->cnt &= ~0x3FF;
Expand Down
5 changes: 3 additions & 2 deletions src/usbd_stm32f105_otgfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ static void ep_deconfig(uint8_t ep) {
}

static int32_t ep_read(uint8_t ep, void* buf, uint16_t blen) {
uint32_t len, tmp;
uint32_t len, tmp = 0;
volatile uint32_t *fifo = EPFIFO(0);
/* no data in RX FIFO */
if (!(OTG->GINTSTS & USB_OTG_GINTSTS_RXFLVL)) return -1;
Expand Down Expand Up @@ -416,6 +416,7 @@ static void evt_poll(usbd_device *dev, usbd_evt_callback callback) {
case 0x03: /* OUT completed */
case 0x04: /* SETUP completed */
_BST(EPOUT(ep)->DOEPCTL, USB_OTG_DOEPCTL_CNAK | USB_OTG_DOEPCTL_EPENA);
// fall through
default:
/* pop GRXSTSP */
OTG->GRXSTSP;
Expand All @@ -436,7 +437,7 @@ static void evt_poll(usbd_device *dev, usbd_evt_callback callback) {
/* no more supported events */
return;
}
return callback(dev, evt, ep);
callback(dev, evt, ep);
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/usbd_stm32f429_otgfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ static void ep_deconfig(uint8_t ep) {
}

static int32_t ep_read(uint8_t ep, void* buf, uint16_t blen) {
uint32_t len, tmp;
uint32_t len, tmp = 0;
volatile uint32_t *fifo = EPFIFO(0);
/* no data in RX FIFO */
if (!(OTG->GINTSTS & USB_OTG_GINTSTS_RXFLVL)) return -1;
Expand Down Expand Up @@ -413,6 +413,7 @@ static void evt_poll(usbd_device *dev, usbd_evt_callback callback) {
case 0x03: /* OUT completed */
case 0x04: /* SETUP completed */
_BST(EPOUT(ep)->DOEPCTL, USB_OTG_DOEPCTL_CNAK | USB_OTG_DOEPCTL_EPENA);
// fall through
default:
/* pop GRXSTSP */
OTG->GRXSTSP;
Expand All @@ -433,7 +434,7 @@ static void evt_poll(usbd_device *dev, usbd_evt_callback callback) {
/* no more supported events */
return;
}
return callback(dev, evt, ep);
callback(dev, evt, ep);
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/usbd_stm32f429_otghs.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ static void ep_deconfig(uint8_t ep) {
}

static int32_t ep_read(uint8_t ep, void* buf, uint16_t blen) {
uint32_t len, tmp;
uint32_t len, tmp = 0;
volatile uint32_t *fifo = EPFIFO(0);
/* no data in RX FIFO */
if (!(OTG->GINTSTS & USB_OTG_GINTSTS_RXFLVL)) return -1;
Expand Down Expand Up @@ -418,6 +418,7 @@ static void evt_poll(usbd_device *dev, usbd_evt_callback callback) {
case 0x03: /* OUT completed */
case 0x04: /* SETUP completed */
_BST(EPOUT(ep)->DOEPCTL, USB_OTG_DOEPCTL_CNAK | USB_OTG_DOEPCTL_EPENA);
// fall through
default:
/* pop GRXSTSP */
OTG->GRXSTSP;
Expand All @@ -438,7 +439,7 @@ static void evt_poll(usbd_device *dev, usbd_evt_callback callback) {
/* no more supported events */
return;
}
return callback(dev, evt, ep);
callback(dev, evt, ep);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/usbd_stm32f446_otgfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static void ep_deconfig(uint8_t ep) {
}

static int32_t ep_read(uint8_t ep, void* buf, uint16_t blen) {
uint32_t len, tmp;
uint32_t len, tmp = 0;
ep &= 0x7F;
volatile uint32_t *fifo = EPFIFO(0);
USB_OTG_OUTEndpointTypeDef* epo = EPOUT(ep);
Expand Down Expand Up @@ -418,7 +418,7 @@ static void evt_poll(usbd_device *dev, usbd_evt_callback callback) {
/* no more supported events */
return;
}
return callback(dev, evt, ep);
callback(dev, evt, ep);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/usbd_stm32f446_otghs.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static void ep_deconfig(uint8_t ep) {
}

static int32_t ep_read(uint8_t ep, void* buf, uint16_t blen) {
uint32_t len, tmp;
uint32_t len, tmp = 0;
ep &= 0x7F;
volatile uint32_t *fifo = EPFIFO(0);
USB_OTG_OUTEndpointTypeDef* epo = EPOUT(ep);
Expand Down Expand Up @@ -418,7 +418,7 @@ static void evt_poll(usbd_device *dev, usbd_evt_callback callback) {
/* no more supported events */
return;
}
return callback(dev, evt, ep);
callback(dev, evt, ep);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/usbd_stm32h743_otgfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static void ep_deconfig(uint8_t ep) {
}

static int32_t ep_read(uint8_t ep, void* buf, uint16_t blen) {
uint32_t len, tmp;
uint32_t len, tmp = 0;
ep &= 0x7F;
volatile uint32_t *fifo = EPFIFO(0);
USB_OTG_OUTEndpointTypeDef* epo = EPOUT(ep);
Expand Down Expand Up @@ -418,7 +418,7 @@ static void evt_poll(usbd_device *dev, usbd_evt_callback callback) {
/* no more supported events */
return;
}
return callback(dev, evt, ep);
callback(dev, evt, ep);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/usbd_stm32l052_devfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static void ep_deconfig(uint8_t ep) {
}

static uint16_t pma_read (uint8_t *buf, uint16_t blen, pma_rec *rx) {
uint16_t tmp;
uint16_t tmp = 0;
uint16_t *pma = (void*)(USB_PMAADDR + rx->addr);
uint16_t rxcnt = rx->cnt & 0x03FF;
rx->cnt &= ~0x3FF;
Expand Down
2 changes: 1 addition & 1 deletion src/usbd_stm32l100_devfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ static void ep_deconfig(uint8_t ep) {
}

static uint16_t pma_read (uint8_t *buf, uint16_t blen, pma_rec *rx) {
uint16_t tmp;
uint16_t tmp = 0;
uint16_t *pma = (void*)(USB_PMAADDR + 2 * rx->addr);
uint16_t rxcnt = rx->cnt & 0x03FF;
rx->cnt &= ~0x3FF;
Expand Down
4 changes: 2 additions & 2 deletions src/usbd_stm32l476_otgfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ static void ep_deconfig(uint8_t ep) {
}

static int32_t ep_read(uint8_t ep, void* buf, uint16_t blen) {
uint32_t len, tmp;
uint32_t len, tmp = 0;
ep &= 0x7F;
volatile uint32_t *fifo = EPFIFO(0);
USB_OTG_OUTEndpointTypeDef* epo = EPOUT(ep);
Expand Down Expand Up @@ -451,7 +451,7 @@ static void evt_poll(usbd_device *dev, usbd_evt_callback callback) {
/* no more supported events */
return;
}
return callback(dev, evt, ep);
callback(dev, evt, ep);
}
}

Expand Down
Loading