From fd4c71419862251e67591821de6b74e5a583245b Mon Sep 17 00:00:00 2001 From: Kedareswara rao Appana Date: Wed, 15 Oct 2014 15:59:36 +0530 Subject: [PATCH] uart: Clear global counters in the interrupt example If mulitple uart instances present in the h/w design and when try to run periphreal test for those design results failure for the second instance of ip. This patch fixes this issue. Signed-off-by: Kedareswara rao Appana --- .../drivers/uartns550/examples/xuartns550_intr_example.c | 9 +++++++++ XilinxProcessorIPLib/drivers/uartns550/src/xuartns550.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/XilinxProcessorIPLib/drivers/uartns550/examples/xuartns550_intr_example.c b/XilinxProcessorIPLib/drivers/uartns550/examples/xuartns550_intr_example.c index f091f133..c9402e67 100755 --- a/XilinxProcessorIPLib/drivers/uartns550/examples/xuartns550_intr_example.c +++ b/XilinxProcessorIPLib/drivers/uartns550/examples/xuartns550_intr_example.c @@ -51,6 +51,10 @@ * as per coding guidelines. * 2.01a ssb 01/11/01 Updated the example to be used with the SCUGIC in * Zynq. +* 3.2 adk 15/10/14 Clear the global counters.If multiple instance of ip is +* present in the h/w design without clearing these counters +* will result undefined behaviour for the second ip +* instance while running the peripheral tests. * ******************************************************************************/ @@ -315,6 +319,11 @@ int UartNs550IntrExample(INTC *IntcInstancePtr, return XST_FAILURE; } + /* Clear the counters */ + TotalErrorCount = 0; + TotalReceivedCount = 0; + TotalSentCount = 0; + return XST_SUCCESS; } diff --git a/XilinxProcessorIPLib/drivers/uartns550/src/xuartns550.h b/XilinxProcessorIPLib/drivers/uartns550/src/xuartns550.h index 40af195b..75fac518 100755 --- a/XilinxProcessorIPLib/drivers/uartns550/src/xuartns550.h +++ b/XilinxProcessorIPLib/drivers/uartns550/src/xuartns550.h @@ -156,6 +156,8 @@ * 3.1 adk 20/08/14 Fixed CR:816989 Canonical Definition for Multiple * Instances of UARTSNS550 have the same Device Id. * Changes are made in the driver tcl file. +* 3.2 adk 15/10/14 Fixed CR:824444 changes are made in the example file +* xuartns550_intr_example.c * * *****************************************************************************/