Bug in PDL v2.1.0 | adc.c

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
mail_3847001
Level 1
Level 1
First question asked

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

0 Likes
1 Solution
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

It looks reasonable. I will check internally for this issue.

View solution in original post

0 Likes
1 Reply
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

It looks reasonable. I will check internally for this issue.

0 Likes