Various changes and bigfixes for problems detected by CppCheck

This commit is contained in:
Gregory Nutt 2013-05-09 14:23:34 -06:00
parent 9a25b51c8f
commit 316456652f
4 changed files with 13 additions and 15 deletions

View File

@ -256,7 +256,8 @@
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -274,7 +275,7 @@ extern "C" {
*
************************************************************************************/
EXTERN void stm32_boardinitialize(void);
void stm32_boardinitialize(void);
/************************************************************************************
* Name: stm32_ledinit, stm32_setled, and stm32_setleds
@ -287,9 +288,9 @@ EXTERN void stm32_boardinitialize(void);
************************************************************************************/
#ifndef CONFIG_ARCH_LEDS
EXTERN void stm32_ledinit(void);
EXTERN void stm32_setled(int led, bool ledon);
EXTERN void stm32_setleds(uint8_t ledset);
void stm32_ledinit(void);
void stm32_setled(int led, bool ledon);
void stm32_setleds(uint8_t ledset);
#endif
/************************************************************************************
@ -316,10 +317,10 @@ EXTERN void stm32_setleds(uint8_t ledset);
************************************************************************************/
#ifdef CONFIG_ARCH_BUTTONS
EXTERN void up_buttoninit(void);
EXTERN uint8_t up_buttons(void);
void up_buttoninit(void);
uint8_t up_buttons(void);
#ifdef CONFIG_ARCH_IRQBUTTONS
EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#endif
#endif
@ -327,6 +328,5 @@ EXTERN xcpt_t up_irqbutton(int id, xcpt_t irqhandler);
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __CONFIG_MIKROE_STM32F4_INCLUDE_BOARD_H */

View File

@ -124,7 +124,6 @@
*
* PE10, PMPRD -- Low to read from the LCD
* PE11, PMPWR -- Low to write to the LCD
*
*/
#define GPIO_LCD_RST (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
@ -226,7 +225,7 @@ void weak_function stm32_usbinitialize(void);
****************************************************************************************************/
#if defined(CONFIG_STM32_OTGFS) && defined(CONFIG_USBHOST)
#error "The Mikroe-STM32F4 board does not support HOST OTG, only device!"
# error "The Mikroe-STM32F4 board does not support HOST OTG, only device!"
#endif
/****************************************************************************************************

View File

@ -124,7 +124,7 @@ void stm32_board_clockconfig(void)
/* Wait until the PLL is ready */
while ((getreg32(STM32_RCC_CR) & RCC_CR_PLLRDY) == 0)
;
;
/* Enable FLASH prefetch, instruction cache, data cache, and 5 wait states */
@ -145,7 +145,6 @@ void stm32_board_clockconfig(void)
/* Wait until the PLL source is used as the system clock source */
while ((getreg32(STM32_RCC_CFGR) & RCC_CFGR_SWS_MASK) != RCC_CFGR_SWS_PLL)
;
;
#endif
}

View File

@ -53,7 +53,7 @@
#include "stm32_can.h"
#include "stm3210e-internal.h"
#if defined(CONFIG_CAN) && (defined(CONFIG_STM32_CAN1)
#if defined(CONFIG_CAN) && defined(CONFIG_STM32_CAN1)
/************************************************************************************
* Pre-processor Definitions