How to pass an argument in a function in altair embed?

Reshmi
Reshmi Altair Community Member

Dear Sir,

We are trying to work to define a function and call it to another function.But shows below errors.

Error 1: "ReadHolding_Reg.c", line 23: error #18: expected a ")"

Error 2:"ReadHolding_Reg.c", line 23: error #142-D: unnamed prototyped parameters not allowed when body is present

Error3:"ReadHolding_Reg.c", line 74: error #141: too many arguments in function call

Below warnings are occured:

1.".\include\ti\f28004x\debug.h", line 86: warning #48-D: incompatible redefinition of macro "ASSERT" (declared at line 228 of "C:\Altair\Embed2023_64\vsdk\include\Vsuser.h")

2."ReadHolding_Reg.c", line 33: warning #225-D: function "crc16" declared implicitly

3."ReadHolding_Reg.c", line 40: warning #161-D: declaration is incompatible with previous "crc16" (declared at line 33)

We tried several methods but still the same error was occured.Here we attached our .VSM file generated c code also..

Thanks & Regards,

Reshmi R&D Team.

Answers

  • sreejithmnair
    sreejithmnair
    Altair Employee

    Hi Reshmi Team,

    Before including any external c program to Embed, need to make sure it's compile clean using any c compiler. You can use online c compiler for quick check.

    Extern function definition should be at Extern Def block, Extern Function block mainly used for function call.

    Attached document for how to include C file into Embed.

    Also Embed provide several variation of CRC ( Blocks →FixedPoint→CRC16). attached one example with that too.

    Sreejith

  • Reshmi
    Reshmi Altair Community Member

    Dear Sir,

    Thank you for your response..We will proceed based on your answer..

    Thanks & Regards,

    Reshmi R&D Team..

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.