assert_param

HUDA hudaklan na volny.cz
Pátek Duben 1 22:14:31 CEST 2016


Dobrý den,
normálně programuji STM32F0xx v prostředí EmBitz.
Nepoužívám standardní knihovny, ani HAL.
Na netu jsem našel aplikaci "AHRS-master.zip",
kterou se snažím přeložit a mám problém.

Překladač hlásí několik varování, viz příklad níže
pro různé soubory ze standardní knihovny.
Compiling: ..\..\..\STM_Lib\STM32F3xx\src\stm32f30x_gpio.c
..\..\..\STM_Lib\STM32F3xx\src\stm32f30x_exti.c: In function 'EXTI_Init':
..\..\..\STM_Lib\STM32F3xx\src\stm32f30x_exti.c:159:3: warning: implicit  
declaration of function 'assert_param' [-Wimplicit-function-declaration]

    assert_param(IS_EXTI_MODE(EXTI_InitStruct->EXTI_Mode));

A potom chyby pro knihovni soubory vi příklad níže.
Linking executable: bin\Debug\AHRSMaster.elf
Creating Hex-file.
obj\debug\~#\~#\~#\stm_lib\stm32f3xx\src\stm32f30x_exti.o: In function  
`EXTI_Init':
..\..\..\STM_Lib\STM32F3xx\src/stm32f30x_exti.c:159: undefined reference  
to `assert_param'

Přitom v souboru "stm32f30x_conf.h" je nadefinováno makro:
/* Exported macro  
------------------------------------------------------------*/
#ifdef  USE_FULL_ASSERT
/**
   * @brief  The assert_param macro is used for function's parameters check.
   * @param  expr: If expr is false, it calls assert_failed function which  
reports
   *         the name of the source file and the source line number of the  
call
   *         that failed. If expr is true, it returns no value.
   * @retval None
   */
   #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t  
*)__FILE__, __LINE__))
/* Exported functions  
------------------------------------------------------- */
   void assert_failed(uint8_t* file, uint32_t line);
#else
   #define assert_param(expr) ((void)0)
#endif /* USE_FULL_ASSERT */

Soubor "stm32f30x_conf.h" se inkluduje.

Díky za rady.
HUDA


Další informace o konferenci Hw-list