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 fromvoid
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 returnvoid
. -
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
toStd_ReturnType
. -
Ensure it returns appropriate values like
E_OK
orE_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
andADC_FALSE
.
Suggested Resolution:
-
Option 1: Fix the function call
IfAdc_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