cancel
Showing results for 
Search instead for 
Did you mean: 

DAVE™

Karl
New Contributor
Hi,

if I add the component DS_ADC_DEMOD and XMC_ASSERT_ENABLE is defined (in menu
Active Project Properties / Tool Settings / ARM-GCC C Compiler / Preprocessor), then the compilation aborts with the following error:

../Dave/Generated/DS_ADC_DEMOD/ds_adc_demod.h: In function 'DS_ADC_DEMOD_CH_GetResult_AUX':
../Dave/Generated/DS_ADC_DEMOD/ds_adc_demod.h:417:67: error: 'HandlePtr' undeclared (first use in this function)
XMC_ASSERT("Invalid channel pointer", XMC_DSD_CHECK_CHANNEL_PTR(HandlePtr->dsd_ch_ptr[id]));


This bug is independent of the Dave version.

Regards
Karl
0 Likes
1 Reply
Karl
New Contributor
Hi,

I propose the following solution:

1. In the file D_LibraryStore_4.4\resources\4.0.6\app\DS_ADC_DEMOD\0\Templates\ds_adc_demod.h
remove line 417
XMC_ASSERT ("Invalid channel pointer", XMC_DSD_CHECK_CHANNEL_PTR (HandlePtr-> dsd_ch_ptr [id]));
because the used argument in condition is wrong.
Better is a check in the function XMC_DSD_CH_GetResult_AUX () in file D_LibraryStore_4.4\DeviceFeatures\pack\2.2.12\Libraries\XMCLib\XMC4\inc\xmc_dsd.h

2. In the file D_LibraryStore_4.4\DeviceFeatures\pack\2.2.12\Libraries\XMCLib\XMC4\inc\xmc_dsd.h
2.1. In the function
__STATIC_INLINE void XMC_DSD_CH_GetResult(XMC_DSD_CH_t *const channel, int16_t *dsd_Result)
at line 785 inserted
XMC_ASSERT("XMC_DSD_CH_GetResult:Invalid module pointer", XMC_DSD_CHECK_CHANNEL_PTR(channel));
XMC_ASSERT("XMC_DSD_CH_GetResult:NULL Result Pointer", (dsd_Result != (int16_t *)NULL) );


2.2. In the function
__STATIC_INLINE void XMC_DSD_CH_GetResult_AUX(XMC_DSD_CH_t *const channel, int16_t *dsd_Result)
at line 839 inserted
XMC_ASSERT("XMC_DSD_CH_GetResult_AUX:Invalid module pointer", XMC_DSD_CHECK_CHANNEL_PTR(channel));
XMC_ASSERT("XMC_DSD_CH_GetResult_AUX:NULL Result Pointer", (dsd_Result != (int16_t *)NULL) );


Regards,
Karl
0 Likes