diff --git a/platform/mcu/CMSIS/Device/ST/STM32F4xx/Source/system_stm32f4xx.c b/platform/mcu/CMSIS/Device/ST/STM32F4xx/Source/system_stm32f4xx.c index 3b207400..652b490a 100644 --- a/platform/mcu/CMSIS/Device/ST/STM32F4xx/Source/system_stm32f4xx.c +++ b/platform/mcu/CMSIS/Device/ST/STM32F4xx/Source/system_stm32f4xx.c @@ -335,9 +335,7 @@ static void SetSysClock(void) RCC->CFGR |= RCC_CFGR_SW_PLL; /* Wait till the main PLL is used as system clock source */ - while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS ) != RCC_CFGR_SWS_PLL); - { - } + while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS ) != RCC_CFGR_SWS_PLL) { } } else { /* If HSE fails to start-up, the application will have wrong clock diff --git a/platform/mcu/STM32F4xx/boot/libc_integration.c b/platform/mcu/STM32F4xx/boot/libc_integration.c index d062daab..3b525ef9 100644 --- a/platform/mcu/STM32F4xx/boot/libc_integration.c +++ b/platform/mcu/STM32F4xx/boot/libc_integration.c @@ -32,6 +32,8 @@ void pthread_mutex_lock() {} void pthread_mutex_destroy() {} int pthread_setcancelstate(int state, int *oldstate) { + (void) state; + (void) oldstate; return 0; } @@ -60,6 +62,11 @@ extern "C" { */ int __register_exitproc(int type, void (*fn)(void), void *arg, void *d) { + (void) type; + (void) fn; + (void) arg; + (void) d; + return 0; } @@ -68,7 +75,11 @@ int __register_exitproc(int type, void (*fn)(void), void *arg, void *d) * \param code the exit code, for example with exit(1), code==1 * \param d __dso_handle, see __register_exitproc */ -void __call_exitprocs(int code, void *d) {} +void __call_exitprocs(int code, void *d) +{ + (void) code; + (void) d; +} /** * \internal @@ -90,7 +101,8 @@ void *__dso_handle=(void*) &__dso_handle; */ void _exit(int status) { - for(;;) ; + (void) status; + for(;;) ; } /** @@ -99,6 +111,8 @@ void _exit(int status) */ void *_sbrk_r(struct _reent *ptr, ptrdiff_t incr) { + (void) ptr; + //This is the absolute start of the heap extern char _end asm("_end"); //defined in the linker script //This is the absolute end of the heap @@ -157,6 +171,11 @@ struct _reent *__getreent() */ int _open_r(struct _reent *ptr, const char *name, int flags, int mode) { + (void) ptr; + (void) name; + (void) flags; + (void) mode; + return -1; } @@ -166,6 +185,9 @@ int _open_r(struct _reent *ptr, const char *name, int flags, int mode) */ int _close_r(struct _reent *ptr, int fd) { + (void) ptr; + (void) fd; + return -1; } @@ -197,7 +219,7 @@ int _read_r(struct _reent *ptr, int fd, void *buf, size_t cnt) for(;;) { ssize_t r = vcom_readBlock(buf, cnt); - if((r < 0) || (r == cnt)) return r; + if((r < 0) || (r == (ssize_t)(cnt))) return r; } } else @@ -218,11 +240,20 @@ int _read(int fd, void *buf, size_t cnt) */ off_t _lseek_r(struct _reent *ptr, int fd, off_t pos, int whence) { + (void) ptr; + (void) fd; + (void) pos; + (void) whence; + return -1; } off_t _lseek(int fd, off_t pos, int whence) { + (void) fd; + (void) pos; + (void) whence; + return -1; } @@ -232,11 +263,18 @@ off_t _lseek(int fd, off_t pos, int whence) */ int _fstat_r(struct _reent *ptr, int fd, struct stat *pstat) { + (void) ptr; + (void) fd; + (void) pstat; + return -1; } int _fstat(int fd, struct stat *pstat) { + (void) fd; + (void) pstat; + return -1; } @@ -246,6 +284,10 @@ int _fstat(int fd, struct stat *pstat) */ int _stat_r(struct _reent *ptr, const char *file, struct stat *pstat) { + (void) ptr; + (void) file; + (void) pstat; + return -1; } @@ -257,16 +299,23 @@ int _stat_r(struct _reent *ptr, const char *file, struct stat *pstat) */ int _isatty_r(struct _reent *ptr, int fd) { + (void) ptr; + (void) fd; + return 1; } int isatty(int fd) { + (void) fd; + return 1; } int _isatty(int fd) { + (void) fd; + return 1; } @@ -276,6 +325,9 @@ int _isatty(int fd) */ int mkdir(const char *path, mode_t mode) { + (void) path; + (void) mode; + return -1; } @@ -285,6 +337,10 @@ int mkdir(const char *path, mode_t mode) */ int _link_r(struct _reent *ptr, const char *f_old, const char *f_new) { + (void) ptr; + (void) f_old; + (void) f_new; + return -1; } @@ -294,6 +350,9 @@ int _link_r(struct _reent *ptr, const char *f_old, const char *f_new) */ int _unlink_r(struct _reent *ptr, const char *file) { + (void) ptr; + (void) file; + return -1; } @@ -303,6 +362,9 @@ int _unlink_r(struct _reent *ptr, const char *file) */ clock_t _times_r(struct _reent *ptr, struct tms *tim) { + (void) ptr; + (void) tim; + return -1; } @@ -317,6 +379,9 @@ clock_t _times_r(struct _reent *ptr, struct tms *tim) */ int _kill_r(struct _reent* ptr, int pid, int sig) { + (void) ptr; + (void) sig; + if(pid == 0) _exit(1); else @@ -325,7 +390,7 @@ int _kill_r(struct _reent* ptr, int pid, int sig) int _kill(int pid, int sig) { - _kill_r(0, pid, sig); + return _kill_r(0, pid, sig); } /** @@ -334,6 +399,7 @@ int _kill(int pid, int sig) */ int _getpid_r(struct _reent* ptr) { + (void) ptr; return 0; } @@ -348,11 +414,16 @@ int _getpid() */ int _wait_r(struct _reent *ptr, int *status) { + (void) ptr; + (void) status; + return -1; } int _fork_r(struct _reent *ptr) { + (void) ptr; + return -1; } diff --git a/platform/mcu/STM32F4xx/drivers/usb/usb_bsp.c b/platform/mcu/STM32F4xx/drivers/usb/usb_bsp.c index 00782ffe..33133c14 100644 --- a/platform/mcu/STM32F4xx/drivers/usb/usb_bsp.c +++ b/platform/mcu/STM32F4xx/drivers/usb/usb_bsp.c @@ -44,6 +44,8 @@ extern uint32_t USBD_OTG_ISR_Handler(USB_OTG_CORE_HANDLE *pdev); void USB_OTG_BSP_Init(USB_OTG_CORE_HANDLE *pdev) { + (void) pdev; + gpio_setMode(GPIOA, 11, ALTERNATE); gpio_setAlternateFunction(GPIOA, 11, 10); gpio_setOutputSpeed(GPIOA, 11, HIGH); // 100MHz output speed @@ -64,6 +66,8 @@ void USB_OTG_BSP_Init(USB_OTG_CORE_HANDLE *pdev) */ void USB_OTG_BSP_EnableInterrupt(USB_OTG_CORE_HANDLE *pdev) { + (void) pdev; + NVIC_ClearPendingIRQ(OTG_FS_IRQn); NVIC_SetPriority(OTG_FS_IRQn, 14); NVIC_EnableIRQ(OTG_FS_IRQn); diff --git a/platform/mcu/STM32F4xx/drivers/usb/usbd_core.c b/platform/mcu/STM32F4xx/drivers/usb/usbd_core.c index c09028ee..c540d194 100644 --- a/platform/mcu/STM32F4xx/drivers/usb/usbd_core.c +++ b/platform/mcu/STM32F4xx/drivers/usb/usbd_core.c @@ -166,7 +166,7 @@ void USBD_Init(USB_OTG_CORE_HANDLE *pdev, USBD_Status USBD_DeInit(USB_OTG_CORE_HANDLE *pdev) { /* Software Init */ - + (void) pdev; return USBD_OK; } diff --git a/platform/mcu/STM32F4xx/drivers/usb/usbd_desc.c b/platform/mcu/STM32F4xx/drivers/usb/usbd_desc.c index 47284da9..3918f911 100644 --- a/platform/mcu/STM32F4xx/drivers/usb/usbd_desc.c +++ b/platform/mcu/STM32F4xx/drivers/usb/usbd_desc.c @@ -122,6 +122,7 @@ __ALIGN_BEGIN uint8_t USBD_LangIDDesc[USB_SIZ_STRING_LANGID] __ALIGN_END = */ uint8_t * USBD_USR_DeviceDescriptor( uint8_t speed , uint16_t *length) { + (void) speed; *length = sizeof(USBD_DeviceDesc); return USBD_DeviceDesc; } @@ -135,6 +136,7 @@ uint8_t * USBD_USR_DeviceDescriptor( uint8_t speed , uint16_t *length) */ uint8_t * USBD_USR_LangIDStrDescriptor( uint8_t speed , uint16_t *length) { + (void) speed; *length = sizeof(USBD_LangIDDesc); return USBD_LangIDDesc; } @@ -149,7 +151,8 @@ uint8_t * USBD_USR_LangIDStrDescriptor( uint8_t speed , uint16_t *length) */ uint8_t * USBD_USR_ProductStrDescriptor( uint8_t speed , uint16_t *length) { - USBD_GetString (USBD_PRODUCT_FS_STRING, USBD_StrDesc, length); + (void) speed; + USBD_GetString ((uint8_t *)(USBD_PRODUCT_FS_STRING), (uint8_t *)(USBD_StrDesc), length); return USBD_StrDesc; } @@ -162,7 +165,8 @@ uint8_t * USBD_USR_ProductStrDescriptor( uint8_t speed , uint16_t *length) */ uint8_t * USBD_USR_ManufacturerStrDescriptor( uint8_t speed , uint16_t *length) { - USBD_GetString (USBD_MANUFACTURER_STRING, USBD_StrDesc, length); + (void) speed; + USBD_GetString ((uint8_t *)(USBD_MANUFACTURER_STRING), (uint8_t *)(USBD_StrDesc), length); return USBD_StrDesc; } @@ -175,7 +179,8 @@ uint8_t * USBD_USR_ManufacturerStrDescriptor( uint8_t speed , uint16_t *length) */ uint8_t * USBD_USR_SerialStrDescriptor( uint8_t speed , uint16_t *length) { - USBD_GetString (USBD_SERIALNUMBER_FS_STRING, USBD_StrDesc, length); + (void) speed; + USBD_GetString ((uint8_t *)(USBD_SERIALNUMBER_FS_STRING), (uint8_t *)(USBD_StrDesc), length); return USBD_StrDesc; } @@ -188,7 +193,8 @@ uint8_t * USBD_USR_SerialStrDescriptor( uint8_t speed , uint16_t *length) */ uint8_t * USBD_USR_ConfigStrDescriptor( uint8_t speed , uint16_t *length) { - USBD_GetString (USBD_CONFIGURATION_FS_STRING, USBD_StrDesc, length); + (void) speed; + USBD_GetString ((uint8_t *)(USBD_CONFIGURATION_FS_STRING), (uint8_t *)(USBD_StrDesc), length); return USBD_StrDesc; } @@ -202,7 +208,8 @@ uint8_t * USBD_USR_ConfigStrDescriptor( uint8_t speed , uint16_t *length) */ uint8_t * USBD_USR_InterfaceStrDescriptor( uint8_t speed , uint16_t *length) { - USBD_GetString (USBD_INTERFACE_FS_STRING, USBD_StrDesc, length); + (void) speed; + USBD_GetString ((uint8_t *)(USBD_INTERFACE_FS_STRING), (uint8_t *)(USBD_StrDesc), length); return USBD_StrDesc; } diff --git a/platform/mcu/STM32F4xx/drivers/usb/usbd_req.c b/platform/mcu/STM32F4xx/drivers/usb/usbd_req.c index f2ed4f45..39c6570a 100644 --- a/platform/mcu/STM32F4xx/drivers/usb/usbd_req.c +++ b/platform/mcu/STM32F4xx/drivers/usb/usbd_req.c @@ -800,7 +800,8 @@ void USBD_ParseSetupRequest( USB_OTG_CORE_HANDLE *pdev, void USBD_CtlError( USB_OTG_CORE_HANDLE *pdev, USB_SETUP_REQ *req) { - + (void) req; + DCD_EP_Stall(pdev , 0x80); DCD_EP_Stall(pdev , 0); USB_OTG_EP0_OutStart(pdev); @@ -819,7 +820,7 @@ void USBD_GetString(uint8_t *desc, uint8_t *unicode, uint16_t *len) { uint8_t idx = 0; - if (desc != NULL) + if (desc != NULL) { *len = USBD_GetLen(desc) * 2 + 2; unicode[idx++] = *len; diff --git a/platform/mcu/STM32F4xx/drivers/usb/usbd_usr.c b/platform/mcu/STM32F4xx/drivers/usb/usbd_usr.c index 0c4598ec..1f204ac0 100644 --- a/platform/mcu/STM32F4xx/drivers/usb/usbd_usr.c +++ b/platform/mcu/STM32F4xx/drivers/usb/usbd_usr.c @@ -46,7 +46,10 @@ USBD_Usr_cb_TypeDef USR_cb = void USBD_USR_Init(void) { } -void USBD_USR_DeviceReset(uint8_t speed ) { } +void USBD_USR_DeviceReset(uint8_t speed ) +{ + (void) speed; +} void USBD_USR_DeviceConfigured (void) { } diff --git a/platform/mcu/STM32F4xx/drivers/usb_vcom.c b/platform/mcu/STM32F4xx/drivers/usb_vcom.c index bdfa6e46..e2f59d87 100644 --- a/platform/mcu/STM32F4xx/drivers/usb_vcom.c +++ b/platform/mcu/STM32F4xx/drivers/usb_vcom.c @@ -242,6 +242,7 @@ ssize_t vcom_readBlock(void* buf, size_t len) static uint8_t usbd_cdc_Init (void *pdev, uint8_t cfgidx) { + (void) cfgidx; uint8_t *pbuf; /* Open EP IN */ @@ -265,6 +266,8 @@ static uint8_t usbd_cdc_Init (void *pdev, uint8_t cfgidx) static uint8_t usbd_cdc_DeInit (void *pdev, uint8_t cfgidx) { + (void) cfgidx; + /* Open EP IN */ DCD_EP_Close(pdev, CDC_IN_EP); @@ -363,6 +366,8 @@ static uint8_t usbd_cdc_Setup (void *pdev, USB_SETUP_REQ *req) static uint8_t usbd_cdc_EP0_RxReady (void *pdev) { + (void) pdev; + if (cdcCmd != NO_CMD) { VCP_Ctrl(cdcCmd, CmdBuff, cdcLen); @@ -374,6 +379,9 @@ static uint8_t usbd_cdc_EP0_RxReady (void *pdev) static uint8_t usbd_cdc_DataIn (void *pdev, uint8_t epnum) { + (void) pdev; + (void) epnum; + return USBD_OK; } @@ -402,17 +410,22 @@ static uint8_t usbd_cdc_DataOut (void *pdev, uint8_t epnum) static uint8_t usbd_cdc_SOF (void *pdev) { + (void) pdev; return USBD_OK; } static uint8_t *USBD_cdc_GetCfgDesc (uint8_t speed, uint16_t *length) { + (void) speed; + (void) length; + *length = sizeof (usbd_cdc_CfgDesc); return usbd_cdc_CfgDesc; } static uint16_t VCP_Ctrl (uint32_t Cmd, uint8_t* Buf, uint32_t Len) { + (void) Len; /* NOTE:commands not needed for this driver: * SEND_ENCAPSULATED_COMMAND