1 Reply Latest reply on Jan 28, 2019 7:56 PM by ShipingW_81

    Bug in PDL v2.1.0 | adc.c

    mail_3847001

      In Adc_Init: SCIS01 and SCIS02 are 16bit registers. The uint8_t cast disables some channels.

      Best Regards,

      Simon Maurer

       

      --- a/2.1.0/drivers/adc/adc.c    2017-12-22 17:29:24.000000000 +0100

      +++ b/2.1.0/drivers/adc/adc.c   2019-01-25 13:49:19.501977384 +0100

      @@ -467,9 +467,9 @@

           if(NULL != pstcConfig->pstcScanInit)

           {

               // Set Scan Conversion Input Selection Register

      -        pstcAdc->SCIS01 = (uint8_t)(0x0000FFFFul & pstcConfig->pstcScanInit->u32ScanCannelSelect.u32AD_CHn);

      +        pstcAdc->SCIS01 = (uint16_t)(0x0000FFFFul & pstcConfig->pstcScanInit->u32ScanCannelSelect.u32AD_CHn);

       

      -        pstcAdc->SCIS23 = (uint8_t)((0xFFFF0000ul & pstcConfig->pstcScanInit->u32ScanCannelSelect.u32AD_CHn) >> 16u);

      +        pstcAdc->SCIS23 = (uint16_t)((0xFFFF0000ul & pstcConfig->pstcScanInit->u32ScanCannelSelect.u32AD_CHn) >> 16u);

       

       

               // Conversion mode single, repeated