diff nuc-fw/bsp/niq32.c @ 113:3b2e941043d8

nuc-fw/bsp: niq32.c compiles
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 20 Oct 2013 21:12:41 +0000
parents 4179acab05f7
children 789a9a95533f
line wrap: on
line diff
--- a/nuc-fw/bsp/niq32.c	Sun Oct 20 08:43:41 2013 +0000
+++ b/nuc-fw/bsp/niq32.c	Sun Oct 20 21:12:41 2013 +0000
@@ -24,12 +24,18 @@
 
 *******************************************************************************/
 
-#include "l1sw.cfg"
+#include "../include/config.h"
+#include "../include/sys_types.h"
 
-#include "chipset.cfg"
-#include "board.cfg"
-#include "rf.cfg"
-#include "swconfig.cfg"
+#include "inth.h"
+#include "mem.h"
+#include "iq.h"
+#include "ulpd.h"
+#include "armio.h"
+
+#if 0
+
+/* original maze of includes */
 
 #if(OP_L1_STANDALONE == 0)
   #include "debug.cfg"
@@ -96,16 +102,19 @@
   #endif
 #endif
 
+/* end of original include maze */
+#endif
+
 /* External declaration */
 extern void GAUGING_Handler(void);
 extern void TMT_Timer_Interrupt(void);
-#if (OP_L1_STANDALONE == 1)
+#if 0 //(OP_L1_STANDALONE == 1)
   extern void TM_Timer1Handler(void);
 #endif
 extern void kpd_key_handler(void);
 extern void TP_FrameIntHandler(void);
 
-#if (OP_L1_STANDALONE == 0)
+#if 1 //(OP_L1_STANDALONE == 0)
   #if (defined RVM_MPM_SWE)
    extern void MPM_InterruptHandler(void);
   #endif
@@ -123,8 +132,6 @@
   extern void RTC_ItAlarmHandle(void);
 #endif
 
-
-
 /* Global variables */
 unsigned IQ_TimerCount1;   /* Used to check if timer is incrementing */
 unsigned IQ_TimerCount2;   /* Used to check if timer is incrementing */
@@ -133,8 +140,12 @@
 unsigned IQ_FrameCount;    /* Used to check if Frame IT TPU*/
 unsigned IQ_GsmTimerCount; /* Used to check if GSM Timer IT */
 
+/* FreeCalypso: the following interrupt handlers remain to be integrated */
+#define	SER_uart_modem_handler	IQ_Dummy
+#define	SER_uart_irda_handler	IQ_Dummy
+#define	SIM_IntHandler		IQ_Dummy
+#define	SIM_CD_IntHandler	IQ_Dummy
 
-#if (CHIPSET != 12)
 /*--------------------------------------------------------------*/
 /*  	irqHandlers                                             */
 /*--------------------------------------------------------------*/
@@ -152,7 +163,7 @@
    IQ_Dummy,               /* AIRQ 3 */   
    IQ_FrameHandler,        /* TPU Frame It AIRQ 4 */
    IQ_Dummy,               /* AIRQ 5 */
-#if (OP_L1_STANDALONE == 0)
+#if 1 //(OP_L1_STANDALONE == 0)
    SIM_IntHandler,         /* AIRQ 6 */
 #else
    IQ_Dummy,               /* AIRQ 6 */
@@ -162,7 +173,7 @@
 #elif ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11))
    SER_uart_modem_handler, /* AIRQ 7 */
 #endif
-#if ((BOARD == 8) || (BOARD == 9) || (BOARD == 40) || (BOARD == 41))
+#if 1 //((BOARD == 8) || (BOARD == 9) || (BOARD == 40) || (BOARD == 41))
 // CC test 0316
    IQ_KeypadGPIOHandler,   /* AIRQ 8 */
 // end
@@ -201,7 +212,7 @@
    IQ_Dummy,               /* Not mapped interrupt */
    IQ_Dummy                /* GEA interrupt */
 #elif ((CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 10) || (CHIPSET == 11))
-#if (L1_DYN_DSP_DWNLD == 1)
+#if 0 //(L1_DYN_DSP_DWNLD == 1)
     IQ_ApiHandler,         /* LEAD */ 
 #else
    IQ_Dummy,               /* LEAD */
@@ -259,7 +270,7 @@
     IQ_Dummy,          /* AIRQ 13 Spi Tx Rx interrupt */
     IQ_Dummy,          /* DMA interrupt */
     IQ_Dummy,          /* LEAD */
-  #if (OP_L1_STANDALONE == 0)
+  #if 1 //(OP_L1_STANDALONE == 0)
       SIM_CD_IntHandler, /* SIM card-detect fast interrupt */
   #else
       IQ_Dummy,          /* SIM card-detect fast interrupt */
@@ -288,7 +299,6 @@
   #endif
 };   
 #endif
-#endif /* (CHIPSET != 12)*/
 
 /*--------------------------------------------------------------*/
 /*  IQ_Gauging_Handler				                */
@@ -299,10 +309,13 @@
 /*--------------------------------------------------------------*/
 void IQ_Gauging_Handler(void)
 {
+#if 0
+// FreeCalypso: code not integrated yet
    GAUGING_Handler();
 #if (OP_L1_STANDALONE == 0)
    RTC_GaugingHandler();
 #endif
+#endif
 } 
 
 
@@ -325,6 +338,8 @@
 
   // The external IRQ is mapped on the ABB interrupt.
   // The associated HISR ABB_Hisr is activated on reception on the external IRQ.
+#if 0
+// FreeCalypso: code not integrated yet
   if(Activate_ABB_HISR())
   {
    #if (CHIPSET == 12)
@@ -334,9 +349,9 @@
      IQ_Unmask(IQ_EXT);
    #endif
   }
+#endif
 }
 
-#if (CHIPSET != 12)
 /*--------------------------------------------------------------*/
 /*  IQ_Dummy							*/
 /*--------------------------------------------------------------*/
@@ -348,7 +363,6 @@
 {
     IQ_DummyCount++;
 }   
-#endif
 
 /*--------------------------------------------------------------*/
 /*  IQ_RTCHandler						*/
@@ -360,7 +374,7 @@
 
 void IQ_Rtc_Handler(void)
 {
-#if (OP_L1_STANDALONE == 0)
+#if 0 //(OP_L1_STANDALONE == 0)
   RTC_ItTimerHandle();
 #endif
 }
@@ -376,7 +390,7 @@
 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12))
 void IQ_RtcA_Handler(void)
 {
-  #if (OP_L1_STANDALONE == 0)
+  #if 0 //(OP_L1_STANDALONE == 0)
     /* INTH_DISABLEONEIT(IQ_RTC_ALARM); *//* RTC ALARM IT  */
     if ( (* (SYS_WORD8 *) RTC_STATUS_REG) & RTC_ALARM )
       RTC_ItAlarmHandle();
@@ -386,7 +400,7 @@
   void IQ_GsmTim_Handler(void)
   {
 
-    if ( (* (SYS_UWORD16 *) ULDP_GSM_TIMER_IT_REG) & ULPD_IT_TIMER_GSM  )
+    if ( (* (SYS_UWORD16 *) ULPD_GSM_TIMER_IT_REG) & ULPD_IT_TIMER_GSM  )
     {
       // it is GSM Timer it.....
       IQ_GsmTimerCount++;
@@ -396,7 +410,7 @@
 void IQ_RtcA_GsmTim_Handler(void)
 {
   #if (OP_L1_STANDALONE == 0)
-   if ( (* (SYS_UWORD16 *) ULDP_GSM_TIMER_IT_REG) & ULPD_IT_TIMER_GSM  )
+   if ( (* (SYS_UWORD16 *) ULPD_GSM_TIMER_IT_REG) & ULPD_IT_TIMER_GSM  )
    {
      // it is GSM Timer it.....
      IQ_GsmTimerCount++;
@@ -411,17 +425,6 @@
 }
 #endif
 
-#if (BOARD == 34)
-/*
- * IQ_IcrHandler32
- *
- */
-  void IQ_IcrHandler32(void)
-  {
-    CSMI_InterruptHandler();  
-  }
-#endif
-
 /*--------------------------------------------------------------*/
 /*  IQ_TimerHandler						*/
 /*--------------------------------------------------------------*/
@@ -433,7 +436,7 @@
 {
    IQ_TimerCount++;
    TMT_Timer_Interrupt();
-   #if (defined RVM_DAR_SWE) && (defined _GSM)
+   #if 0 //(defined RVM_DAR_SWE) && (defined _GSM)
      dar_watchdog_reset();
    #endif
 }
@@ -449,7 +452,10 @@
 {
    IQ_FrameCount++;
    TMT_Timer_Interrupt();
+#if 0
+// FreeCalypso: that L1 or whatever code hasn't been integrated yet
    TP_FrameIntHandler();
+#endif
    #if (OP_L1_STANDALONE == 0)
      #if (TI_PROFILER == 1)
        // TDMA treatment for profiling buffer
@@ -484,8 +490,8 @@
 {
   IQ_TimerCount2++;  
  }
-#if(L1_DYN_DSP_DWNLD == 1)
 
+#if 0 //(L1_DYN_DSP_DWNLD == 1)
 /*-------------------------------------------------------*/
 /* IQ_ApiHandler()                                       */
 /*-------------------------------------------------------*/
@@ -500,7 +506,6 @@
 #endif
 
 
-#if (CHIPSET !=12)
 /*--------------------------------------------------------------*/
 /*  IQ_IRQ_isr							*/
 /*--------------------------------------------------------------*/
@@ -528,9 +533,6 @@
   #endif
     * (SYS_UWORD16 *) INTH_CTRL_REG |= (1 << INTH_FIQ);	/* valid next FIQ */
 }   
-#endif /* chipset != 12 ) */
-
-#if ((BOARD == 8) || (BOARD == 9) || (BOARD == 40) || (BOARD == 41))
 
 /*--------------------------------------------------------------*/
 /*  IQ_KeypadGPIOHandler                                        */
@@ -541,14 +543,14 @@
 /*--------------------------------------------------------------*/
 // CC test 0316
 //#include "rvm/rvm_use_id_list.h"
-//#include "rvf/rvf_api.h"
-//static char debug_buffer[50];
+//#include "rvf/rvf_api.h"
+//static char debug_buffer[50];
 // end
 
 void IQ_KeypadGPIOHandler(void)
 {
 
- #if (OP_L1_STANDALONE == 0)
+ #if 0 //(OP_L1_STANDALONE == 0)
     /*
      * GPIO interrupt must be checked before the keypad interrupt. The GPIO
      * status bit is reset when the register is read.
@@ -559,7 +561,7 @@
 // CC test 0315
 {	       
         AI_MaskIT (ARMIO_MASKIT_GPIO);
-//sprintf(debug_buffer, "GPIO_Interrupt");
+//sprintf(debug_buffer, "GPIO_Interrupt");
 //rvf_send_trace(debug_buffer, 40, NULL_PARAM, RV_TRACE_LEVEL_ERROR, RVT_USE_ID);
         AI_UnmaskIT(ARMIO_MASKIT_GPIO);       //0x0002  
 // end
@@ -575,10 +577,10 @@
     #endif
 */    
 }
-    if (AI_CheckITSource (ARMIO_KEYPDAD_INT))
+    if (AI_CheckITSource (ARMIO_KEYPAD_INT))
     {
-// CC test 0316
-//sprintf(debug_buffer, "Key_Interrupt");
+// CC test 0316
+//sprintf(debug_buffer, "Key_Interrupt");
 //rvf_send_trace(debug_buffer, 40, NULL_PARAM, RV_TRACE_LEVEL_ERROR, RVT_USE_ID);
 // end
       kpd_key_handler ();
@@ -586,25 +588,3 @@
 
  #endif
 }   
-
-#elif ((BOARD == 34) || (BOARD == 42) || (BOARD == 43) || (BOARD == 45))
-
-/*--------------------------------------------------------------*/
-/*  IQ_KeypadHandler							*/
-/*--------------------------------------------------------------*/
-/* Parameters :none						*/
-/* Return     :	none						*/
-/* Functionality :   Handle keypad interrupts  			*/
-/*--------------------------------------------------------------*/
-void IQ_KeypadHandler(void)
-{
- #if (OP_L1_STANDALONE == 0)
-   #if (BOARD == 34)
-     IQ_Mask (IQ_ARMIO);
-   #else
-     kpd_key_handler ();
-   #endif
- #endif
-}   
-	
-#endif