in the last days I've been trying to configure the ADC-Component of the processor expert to do an average over 32 samples.
When setting number of conversions to 1 everything works fin. But as soon as I set the number of conversions to another value the conversion routines calculate false values.
As far as i can tell there is a bug in the generated code (or in my configuration for Processor Expert):
The OnMeasurementComplete-method of the ADC-LDD component uses a DWORD to save the result of the conversation:
|dword ResultData;||/* Temporary result data */|
ResultData is passed on as a pointer to the GetMeasuredValues-method.
the GetMeasuredValues converts this pointer to a pointer to AdcLdd1_TResultData (which is a typedefed as a uint16_t).
This causes the processor to write a u16-value into the dereferenced dword-variable, which wreaks havoc in the OnMeasurementComplete-method.
My opinion is that the variable ResultData should be of Type AdcLdd1_TResultData in order to work properly.
When I change the cody by hand everything works fine, but Processor Expert will overwrite my changes when I generate the code again, so that's not an option.
I am using the newest KDS IDE 2.0 release, but the error already existed in KDS IDE 1.0.1.
The Processor I am using is Kinetis MK22FN1M0VLQ12.
Is this a bug in Processor Experts generated code or am In configuring PE wrong?