changeset 17:9a8a20d45be7

Timer2 for Nucleus RTOS ticks
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 15 May 2020 04:54:15 +0000
parents 9582c4e40607
children 80c8857ce1c7
files src/cs/drivers/drv_core/inth/niq32.c src/cs/system/main/init.c
diffstat 2 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/cs/drivers/drv_core/inth/niq32.c	Fri May 15 04:43:00 2020 +0000
+++ b/src/cs/drivers/drv_core/inth/niq32.c	Fri May 15 04:54:15 2020 +0000
@@ -489,12 +489,14 @@
 /* Return     :	none						*/
 /* Functionality :    Handle Timer 2 interrupts 			*/
 /*--------------------------------------------------------------*/
- void IQ_TimerHandler2(void)
+void IQ_TimerHandler2(void)
 {
   IQ_TimerCount2++;  
- }
+  /* FC FFS editor */
+  TMT_Timer_Interrupt();
+}
+
 #if(L1_DYN_DSP_DWNLD == 1)
-
 /*-------------------------------------------------------*/
 /* IQ_ApiHandler()                                       */
 /*-------------------------------------------------------*/
--- a/src/cs/system/main/init.c	Fri May 15 04:43:00 2020 +0000
+++ b/src/cs/system/main/init.c	Fri May 15 04:54:15 2020 +0000
@@ -138,6 +138,9 @@
 
 #include "ulpd/ulpd.h"
 
+/* FC FFS editor */
+#include "timer2.h"
+
 #if (PSP_STANDALONE == 0)
  #if (OP_L1_STANDALONE == 0)
   extern void ffs_main_init(void);
@@ -802,6 +805,10 @@
       TM_EnableTimer (1);
       TM_EnableTimer (2);
 
+	/* FC FFS editor */
+	Dtimer2_Init_cntl (1875, 1, 0, 1);
+	Dtimer2_Start (1);
+
     #endif  /* (OP_L1_STANDALONE == 0) */
 
   #endif   /* #if (BOARD == 5) */
@@ -937,4 +944,6 @@
 #if (L1_DYN_DSP_DWNLD == 1)
 	IQ_Unmask(IQ_API);
 #endif
+	/* FC FFS editor */
+	IQ_Unmask(IQ_TIM2);
 }