Skip to content

Commit 356d8ad

Browse files
haduongquangdecsny
authored andcommitted
s32: drivers: s32ze: adc: patch to fix the issue clear the EOC flag
Clear the EOC flag before Adc_Sar_CheckAndCallEocNotification() is called to avoid the race condition that prevents the next end of conversion callback to be executed, when a conversion is started inside the previous end of conversion completed callback. Signed-off-by: Ha Duong Quang <ha.duongquang@nxp.com>
1 parent 878f64f commit 356d8ad

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

s32/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,6 @@ Patch List for S32Z/E:
6464
for S32Z/E.
6565
- Remove 'static inline' keywords from 'Netc_Eth_Ip_MSIX_Rx' function so that it can be
6666
used as an extern function outside of the file declaration.
67+
- Clear the EOC flag before Adc_Sar_CheckAndCallEocNotification() is called to avoid the
68+
race condition that prevents the next end of conversion callback to be executed, when
69+
a conversion is started inside the previous end of conversion completed callback.

s32/drivers/s32ze/Adc/src/Adc_Sar_Ip.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,6 +1716,12 @@ static inline void Adc_CheckAndCallAllChannelNotification(const uint32 Instance)
17161716
EocFlag = (*IMRAddr);
17171717
EocFlag &= (*ISRAddr);
17181718
EocFlag &= (ADC_ISR_EOC_MASK | ADC_ISR_JEOC_MASK);
1719+
1720+
/* Clear EOC Flag */
1721+
if (EocFlag != 0)
1722+
{
1723+
*ISRAddr = EocFlag;
1724+
}
17191725
#endif /* (STD_ON == ADC_SAR_IP_EOC_ENABLED) */
17201726

17211727
for (VectAdr = 0U; VectAdr < Adc_Sar_Ip_au8AdcGroupCount[Instance]; VectAdr++)
@@ -1736,13 +1742,6 @@ static inline void Adc_CheckAndCallAllChannelNotification(const uint32 Instance)
17361742
}
17371743
}
17381744

1739-
/* CPR_RTD_00664 */
1740-
#if (STD_ON == ADC_SAR_IP_EOC_ENABLED)
1741-
if (TRUE == CeocfrFlag)
1742-
{
1743-
*ISRAddr = EocFlag;
1744-
}
1745-
#endif /* (STD_ON == ADC_SAR_IP_EOC_ENABLED) */
17461745
#if (STD_ON == ADC_SAR_IP_WDG_ENABLED)
17471746
if (WtisrMask != 0U)
17481747
{

0 commit comments

Comments
 (0)