AnsweredAssumed Answered

missing prototype and inline function issues in STVD

Question asked by dongdong chen on Feb 27, 2018
Latest reply on Feb 28, 2018 by dongdong chen

Hi!

When I called assert() funtion, it always reported an error as followed. I had included the head file named assert.h.

   #error cpstm8 modbus\rtu\mbrtu.c:168(4) missing prototype
   #error cpstm8 modbus\rtu\mbrtu.c:248(4) missing prototype
   #error cpstm8 modbus\rtu\mbrtu.c:311(4) missing prototype
   #error cpstm8 modbus\rtu\mbrtu.c:369(8) missing prototype

code:

#include <assert.h>

... ...

assert( eSndState == STATE_TX_IDLE );

And when I used inline keyword , I met the errors and warns as follewed:

#warning cpstm8 port\porttimer.c:63(0+6) implicit int type in global declaration
#error cpstm8 port\porttimer.c:63(0+6) missing ;
#warning cpstm8 port\porttimer.c:70(38) implicit int type in global declaration
#error cpstm8 port\porttimer.c:71(17) missing )
#warning cpstm8 port\porttimer.c:71(23) implicit int type in global declaration
#error cpstm8 port\porttimer.c:73(18) missing ;

......

code:

inline void
vMBPortTimersEnable( )
{
/* Enable the timer with the timeout passed to xMBPortTimersInit( ) */
/* Clear TIM2 update flag */
TIM2_ClearFlag(TIM2_FLAG_UPDATE);
/* Enable update interrupt */
TIM2_ITConfig(TIM2_IT_UPDATE, ENABLE);
TIM2_SetCounter(0x00);
/* Enable TIM2 */
TIM2_Cmd(ENABLE);
}

 

It have taken my whole day, but can't solve. Help me! THX       T.T

Outcomes