3 Replies Latest reply on Nov 24, 2019 11:41 PM by YuxianL_01

    Bug in PDL v2.1.0 | adc.c

    ThUl_4287856

      Hi,

      I think I found a bug in the PDL v2.1.0 in adc.c. There are 2 macro names used that are not defined: FM_ADC0_SCTSL_AVAILABLE and FM_ADC0_PRTSL_AVAILABLE. The correct names, as defined in the s6exxxxx.h files, should be FM_ADC_SCTSL_AVAILABLE and FM_ADC_PRTSL_AVAILABLE respectively (without the "0" after "ADC"). There are 3 lines where one or both macros appear (see diff below).

       

      --- a/PDL/2.1.0/drivers/adc/adc.c

      +++ b/PDL/2.1.0/drivers/adc/adc.c

      @@ -485,7 +485,7 @@ en_result_t Adc_Init( volatile stc_adcn_t* pstcAdc,

                       return ErrorInvalidParameter;

               }

       

      -      #if defined(FM_ADC0_SCTSL_AVAILABLE)

      +      #if defined(FM_ADC_SCTSL_AVAILABLE)

               // Scan Conversion Timer Start Enable and Timer Source

               if (TRUE == pstcConfig->pstcScanInit->bScanTimerStartEnable)

               {

      @@ -516,7 +516,7 @@ en_result_t Adc_Init( volatile stc_adcn_t* pstcAdc,

               // Priority external Trigger Start Enable

               stcPCCR.PEEN = (TRUE == pstcConfig->pstcPrioInit->bPrioExtTrigStartEnable) ? 1u : 0u;

       

      -      #if defined(FM_ADC0_PRTSL_AVAILABLE)

      +      #if defined(FM_ADC_PRTSL_AVAILABLE)

               // Priority Conversion Timer Start Enable and Timer Source

               if (TRUE == pstcConfig->pstcPrioInit->bPrioTimerStartEnable)

               {

      @@ -729,7 +729,7 @@ en_result_t Adc_DeInit( volatile stc_adcn_t* pstcAdc, boolean_t bTouchNvic )

           pstcAdc->WCMRCOT = 0u;

           pstcAdc->WCMRCIF = 0u;

      #endif  

      -#if defined(FM_ADC0_SCTSL_AVAILABLE) && defined(FM_ADC0_PRTSL_AVAILABLE)

      +#if defined(FM_ADC_SCTSL_AVAILABLE) && defined(FM_ADC_PRTSL_AVAILABLE)

           pstcAdc->SCTSL   = 0u;

           pstcAdc->PRTSL   = 0u;

      #endif

       

       

      Best regards,

      Thomas