diff gsm-fw/services/dar/dar_msg_ft.c @ 309:a7087f91c752

DAR: all C modules compile without RVM_DAR_SWE
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 17 Mar 2014 04:51:36 +0000
parents 4dccc9d3305f
children 083f262b7bbe
line wrap: on
line diff
--- a/gsm-fw/services/dar/dar_msg_ft.c	Sun Mar 16 20:46:10 2014 +0000
+++ b/gsm-fw/services/dar/dar_msg_ft.c	Mon Mar 17 04:51:36 2014 +0000
@@ -17,25 +17,23 @@
 /* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved*/
 /****************************************************************************/
 
-#include "rv/rv_defined_swe.h"
+#include "../../riviera/rv/rv_defined_swe.h"
 #ifdef RVM_DAR_SWE
    #ifndef _WINDOWS
-      #include "config/swconfig.cfg"
-      #include "config/sys.cfg"
-      #include "config/chipset.cfg"
+      #include "../../include/config.h"
    #endif
 
    #include <string.h>
-   #include "rvm/rvm_gen.h"
-   #include "dar/dar_api.h"
-   #include "dar/dar_macro_i.h"
-   #include "dar/dar_messages_i.h"
-   #include "dar/dar_const_i.h"
-   #include "dar/dar_diagnose_i.h"
-   #include "dar/dar_error_hdlr_i.h"
-   
+   #include "../../riviera/rvm/rvm_gen.h"
+   #include "dar_api.h"
+   #include "dar_macro_i.h"
+   #include "dar_messages_i.h"
+   #include "dar_const_i.h"
+   #include "dar_diagnose_i.h"
+   #include "dar_error_hdlr_i.h"
+
    #ifndef _WINDOWS
-      #include "timer/timer.h"
+      #include "../../bsp/timer.h"
    #endif
 
    /**** Global variable ****/
@@ -58,16 +56,16 @@
 
    extern void exception(void);
 
-   /********************************************************************************/
-   /* Function         dar_filter_request                                          */
-   /*                                                                              */
-   /* Description      This function checks if the use_id group_nb exists:         */
-   /*                      - if the group_nb exists, it adds the warning and debug */
-   /*                        masks in the dar_array_filter                         */
-   /*                      - otherwise, this function add the new group_nb and the */
-   /*                        masks in the dar_array_filter                         */
-   /*                                                                              */
-   /********************************************************************************/
+   /***************************************************************************/
+   /* Function         dar_filter_request                                     */
+   /*                                                                         */
+   /* Description      This function checks if the use_id group_nb exists:    */
+   /*                      - if the group_nb exists, it adds the warning and  */
+   /*                        debug masks in the dar_array_filter	      */
+   /*                      - otherwise, this function add the new group_nb and*/
+   /*                        the masks in the dar_array_filter                */
+   /*                                                                         */
+   /***************************************************************************/
 
    T_RV_RET dar_filter_request (T_DAR_FILTER_START *msg_p)
    {
@@ -92,7 +90,7 @@
             {  /* The DAR entity wants to process Warning messages */
                /* add the mask_warning in the dar_filter array */
                dar_gbl_var_p ->dar_filter_array[index].mask_warning |= 
-                                                           msg_p->use_msg_parameter.mask;
+                                                 msg_p->use_msg_parameter.mask;
                dar_gbl_var_p ->dar_filter_array[index].mask_debug    = 0x00;
 
             break;
@@ -100,24 +98,24 @@
 
             case DAR_DEBUG:
             {
-               /* The DAR entity wants to process Debug messages                   */
-               /* As the Warning messages are more important than debug messages,  */
-               /* it processes warning message too                                 */
-  
+               /* The DAR entity wants to process Debug messages */
+               /* As the Warning messages are more important than debug */
+               /* messages, it processes warning message too */
+
                /* add the mask_debug in the dar_filter array */
                dar_gbl_var_p ->dar_filter_array[index].mask_debug |= 
-                                                            msg_p->use_msg_parameter.mask;
+                                                 msg_p->use_msg_parameter.mask;
 
                /* add the mask_warning in the dar_filter array  */
                dar_gbl_var_p ->dar_filter_array[index].mask_warning |= 
-                                                            msg_p->use_msg_parameter.mask;
+                                                 msg_p->use_msg_parameter.mask;
             break;
             }
-          
+
             case DAR_NO_DIAGNOSE:
             {
-               /* The DAR entity doesn't want to process Diagnose messages         */
-  
+               /* The DAR entity doesn't want to process Diagnose messages */
+
                /* delete the mask_debug in the dar_filter array */
                dar_gbl_var_p ->dar_filter_array[index].mask_debug = 0x00;
 
@@ -137,11 +135,13 @@
 
       else
       {
-         /* if the group doesn't exist and if there is enough space in the dar_filter_array */
+         /* if the group doesn't exist and if there is enough space in the
+	    dar_filter_array */
          if ( dar_add_group(&index)== RV_OK)
          {
             /* ... add the group in the dar_array_filter */
-            dar_gbl_var_p ->dar_filter_array[index].group_nb |= msg_p->use_msg_parameter.group_nb;
+            dar_gbl_var_p ->dar_filter_array[index].group_nb |=
+				msg_p->use_msg_parameter.group_nb;
             /* Check the Dar level  */
             switch(msg_p->use_msg_parameter.level) 
             {
@@ -149,23 +149,23 @@
                {   /* The DAR entity wants to process Warning messages */
                    /* add the mask_warning in the dar_filter array */
                   dar_gbl_var_p ->dar_filter_array[index].mask_warning |= 
-                                                           msg_p->use_msg_parameter.mask;
+                                                 msg_p->use_msg_parameter.mask;
                   break;
                }
 
                case DAR_DEBUG:
                {
-                  /* The DAR entity wants to process Debug messages                   */
-                  /* As the Warning messages are more important than debug messages,  */
-                  /* it processes warning message too                                 */
-  
+                  /* The DAR entity wants to process Debug messages */
+                  /* As the Warning messages are more important than debug */
+                  /* messages, it processes warning message too */
+
                   /* add the mask_debug in the dar_filter array */
                   dar_gbl_var_p ->dar_filter_array[index].mask_debug |= 
-                                                            msg_p->use_msg_parameter.mask;
+                                                 msg_p->use_msg_parameter.mask;
 
                   /* add the mask_warning in the dar_filter array  */
                   dar_gbl_var_p ->dar_filter_array[index].mask_warning |= 
-                                                            msg_p->use_msg_parameter.mask;
+                                                 msg_p->use_msg_parameter.mask;
                break;
                }
 
@@ -188,30 +188,31 @@
    }/* dar_filter_request   */
 
 
-   /********************************************************************************/
-   /*                                                                              */
-   /*    Function Name:   dar_write_data_in_buffer                                 */
-   /*                                                                              */
-   /*    Purpose:  This function is called to store diagnose data in RAM buffer    */
-   /*                                                                              */
-   /*              note: In order to separate the different string, the data are   */
-   /*              ----  stored  as follows:                                       */
-   /*                                                                              */
-   /*    Input Parameters:                                                         */
-   /*        Pointer to the message to store                                       */
-   /*        Data Format,                                                          */
-   /*        Data level,                                                           */
-   /*        Data Use Id,                                                          */
-   /*                                                                              */
-   /*    Output Parameters:                                                        */
-   /*         Validation of the diagnose execution.                                */
-   /*                                                                              */
-   /*                                                                              */
-   /*                                                                              */
-   /*    Revision History:                                                         */
-   /*        None.                                                                 */
-   /*                                                                              */
-   /********************************************************************************/
+   /***************************************************************************/
+   /*                                                                         */
+   /*    Function Name:   dar_write_data_in_buffer                            */
+   /*                                                                         */
+   /*    Purpose:  This function is called to store diagnose data in RAM      */
+   /*              buffer.                                                    */
+   /*									      */
+   /*              note: In order to separate the different string, the data  */
+   /*              are stored  as follows:                                    */
+   /*                                                                         */
+   /*    Input Parameters:                                                    */
+   /*        Pointer to the message to store                                  */
+   /*        Data Format,                                                     */
+   /*        Data level,                                                      */
+   /*        Data Use Id,                                                     */
+   /*                                                                         */
+   /*    Output Parameters:                                                   */
+   /*         Validation of the diagnose execution.                           */
+   /*                                                                         */
+   /*                                                                         */
+   /*                                                                         */
+   /*    Revision History:                                                    */
+   /*        None.                                                            */
+   /*                                                                         */
+   /***************************************************************************/
    T_RV_RET dar_write_data_in_buffer( T_DAR_WRITE_START *msg_p)
    {
       /* Local variables */
@@ -224,26 +225,27 @@
       /***   Circular buffer to store data ***/
       /* Add 0xFF to separate 2 strings */
       dar_write_buffer[dar_current_index] = 0xF; 
-      DAR_PLUS_PLUS(dar_current_index); /* to detected if it is the end of the buffer */
+      DAR_PLUS_PLUS(dar_current_index); /* increment with wraparound */
       dar_write_buffer[dar_current_index] = 0xF; 
-      DAR_PLUS_PLUS(dar_current_index); /* to detected if it is the end of the buffer */
+      DAR_PLUS_PLUS(dar_current_index); /* increment with wraparound */
 
 
       /* The group_nb is 16 bit length, and the buffer is an UINT8 length */
       /* So the group_nb must be stocked by dividing it in 2 parts */
-      dar_write_buffer[dar_current_index] = (msg_p->data_write.use_id.group_nb)>>8;
-                                         /*add the 8 first bits of the Use id group*/
+      dar_write_buffer[dar_current_index] =
+				   (msg_p->data_write.use_id.group_nb)>>8;
+                                   /*add the 8 first bits of the Use id group*/
       DAR_PLUS_PLUS(dar_current_index);
       dar_write_buffer[dar_current_index] = msg_p->data_write.use_id.group_nb;
-                                         /*add the 8 last bits of the Use id group*/
+                                   /*add the 8 last bits of the Use id group*/
       DAR_PLUS_PLUS(dar_current_index);
       /* The mask is 16 bit length, and the buffer is an UINT8 length */
       /* So the mask must be stocked by dividing it in 2 parts */
       dar_write_buffer[dar_current_index] = (msg_p->data_write.use_id.mask)>>8;
-                                         /* add the 8 first bits of the Use id mask */
+                                   /* add the 8 first bits of the Use id mask */
       DAR_PLUS_PLUS(dar_current_index);
       dar_write_buffer[dar_current_index] = msg_p->data_write.use_id.mask;
-                                         /* add the 8 last bits of the Use id mask */
+                                   /* add the 8 last bits of the Use id mask */
       DAR_PLUS_PLUS(dar_current_index);
 
       /* Add the dar_level data */
@@ -269,22 +271,22 @@
 
    } /* dar_send_write_data */
 
-   /********************************************************************************/
-   /* Function         dar_empty_mb_and_save_data                                  */
-   /*                                                                              */
-   /* Description      This function is used to empty the mailbox and save data in */
-   /*                  the RAM buffer                                              */
-   /*                                                                              */
-   /*    Input Parameters:                                                         */
-   /*        Pointer to the message to store                                       */
-   /*                                                       											  */                                                      
-   /*    Output Parameters:                                                        */
-   /*        Validation of the function execution.								                  */
-   /*                                                                              */
-   /*    Note:                                                                     */
-   /*        None                                                                  */
-   /*                                                                              */
-   /********************************************************************************/                                                                               
+   /***************************************************************************/
+   /* Function         dar_empty_mb_and_save_data                             */
+   /*                                                                         */
+   /* Description      This function is used to empty the mailbox and save    */
+   /*                  data in the RAM buffer.                                */
+   /*                                                                         */
+   /*    Input Parameters:                                                    */
+   /*        Pointer to the message to store                                  */
+   /*									      */
+   /*    Output Parameters:                                                   */
+   /*        Validation of the function execution.			      */
+   /*                                                                         */
+   /*    Note:                                                                */
+   /*        None                                                             */
+   /*                                                                         */
+   /***************************************************************************/
    T_RV_RET dar_empty_mb_and_save_data(  T_DAR_INFO *buffer_p)
    {
       /* Declare local variables */
@@ -312,13 +314,13 @@
       /**** Store data in RAM buffer ****/            
       /* Diagnose string length */
       length = (UINT16) strlen(buffer_p);
-      
+
       /**   Circular buffer to store data **/
       /* Add 0xFF to separate 2 strings */
       dar_write_buffer[dar_current_index] = 0xF; 
-      DAR_PLUS_PLUS(dar_current_index); /* to detected if it is the end of the buffer */
+      DAR_PLUS_PLUS(dar_current_index); /* increment with wraparound */
       dar_write_buffer[dar_current_index] = 0xF; 
-      DAR_PLUS_PLUS(dar_current_index); /* to detected if it is the end of the buffer */
+      DAR_PLUS_PLUS(dar_current_index); /* increment with wraparound */
 
       /* Add the dar_level data */
       dar_write_buffer[dar_current_index] = DAR_EXCEPTION;
@@ -343,25 +345,25 @@
 
 
 
-/********************************************************************************/
-/*                                                                              */
-/*              ------------------------------------------------                */
-/*             |       WARNING       -      IMPORTANT           |               */
-/*              ------------------------------------------------                */
-/*                                                                              */
-/*                                                                              */
-/*    Function Name:   dar_lib                                                  */
-/*                                                                              */
-/*    Purpose:  This function is only used in order to have a function in the   */ 
-/*               dar_lib when the DAR is NOT_COMPILED                           */
-/*                                                                              */
-/*    Input Parameters:                                                         */
-/*         None                                                                 */
-/*                                                                              */
-/*    Output Parameters:                                                        */
-/*         NONE                                                                 */
-/*                                                                              */
-/********************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/*              ------------------------------------------------              */
+/*             |       WARNING       -      IMPORTANT           |             */
+/*              ------------------------------------------------              */
+/*                                                                            */
+/*                                                                            */
+/*    Function Name:   dar_lib                                                */
+/*                                                                            */
+/*    Purpose:  This function is only used in order to have a function in the */
+/*               dar_lib when the DAR is NOT_COMPILED                         */
+/*                                                                            */
+/*    Input Parameters:                                                       */
+/*         None                                                               */
+/*                                                                            */
+/*    Output Parameters:                                                      */
+/*         NONE                                                               */
+/*                                                                            */
+/******************************************************************************/
 void dar_lib(void)
 {
 }