This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP-MSPM0G3519: Compilation Issue for Adc Module

Part Number: LP-MSPM0G3519


Tool/software:

Hello team,

we are using MCAL : MCAL_MSPM0_00.02.05.00 package

While integrating Adc module, below compilation error is occured

Error 1: Invalid Assignment from void to Std_ReturnType

File: Adc.c
Line: 451
Path: /mcal/Adc/src/Adc.c
Error: assigning to 'Std_ReturnType' (aka 'unsigned char') from incompatible type 'void'

Problem:

  • The function Adc_startGroup(hwUnitObj) is defined to return void.

  • However, its return value is being assigned to a variable of type Std_ReturnType.

Suggested Resolution:

  • If Adc_startGroup() is intended to return a status:

    • Update its return type from void to Std_ReturnType.

    • Ensure it returns appropriate values like E_OK or E_NOT_OK.

  • If the function is not supposed to return a value:

    • Remove the assignment to retVal.

Error 2: Too Many Arguments Passed to Function

File: Adc.c
Line: 881
Path: /mcal/Adc/src/Adc.c
Error: too many arguments to function call, expected single argument 'groupObj', have 2

Problem:

  • The function Adc_stopGroup() is defined to accept only one argument, but it’s being called with two: groupObj and ADC_FALSE.

Suggested Resolution:

  • Option 1: Fix the function call
    If Adc_stopGroup() is only meant to take one parameter, remove the second argument.

  • Option 2: Modify the function definition
    If the second argument (ADC_FALSE) is required:

    • Update the function declaration and definition to accept two parameters.

BR,

Prashant Singh Toma