Wrong ADC Macro Names Used in adc.c in PDL 2.1.0 - KBA228999

Version 2

    Author: TakashiM_61         Version: **

     

    Translation - Japanese: PDL 2.1.0のadc.cで使用されている間違ったADCマクロ名 - KBA228999 - Community Translated (JA)

     

    In the ADC device driver contained in PDL 2.1.0, the following macros are used in the adc.c file:

    • FM_ADC0_SCTSL_AVAILABLE
    • FM_ADC0_PRTSL_AVAILABLE

    These macro names are incorrect, and Table 1 lists the corresponding correct macro names.

     

    Table 1. Correct Macro Names in adc.c

    Incorrect Macro Names

    Correct Macro Names

    FM_ADC0_SCTSL_AVAILABLE

    FM_ADC_SCTSL_AVAILABLE

    FM_ADC0_PRTSL_AVAILABLE

    FM_ADC_PRTSL_AVAILABLE

     

    In the following code snippet of adc.c in PDL2.1.0, the lines in red indicate the incorrect macro names and the lines in blue indicate the correct macro names.

     

    @@ -485,7 +485,7 @@ en_result_t Adc_Init( volatile stc_adcn_

                     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_

             // 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_adc

         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

    These correct macros are defined in each MPN header file:

    • <PDL installation directory>\2.1.0\devices\fm0p\<MPN>\common\<MPN>.h
    • <PDL installation directory>\2.1.0\devices\fm4\<MPN>\common\<MPN>.h