diff gsm-fw/services/etm/etm_task.c @ 166:13af69b6a3dc

ETM core compiles
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 19 Nov 2013 05:07:24 +0000
parents d78219c43fbf
children
line wrap: on
line diff
--- a/gsm-fw/services/etm/etm_task.c	Tue Nov 19 04:23:29 2013 +0000
+++ b/gsm-fw/services/etm/etm_task.c	Tue Nov 19 05:07:24 2013 +0000
@@ -20,23 +20,26 @@
  *********************************************************************************/
 
 
-#include "etm/etm.h"
-#include "etm/etm_api.h"
-#include "etm/etm_messages_i.h"
-#include "etm/etm_trace.h"
-#include "etm/etm_env.h"
+#include "etm.h"
+#include "etm_config.h"
+#include "etm_api.h"
+#include "etm_messages_i.h"
+#include "etm_trace.h"
+#include "etm_env.h"
 
+#if ETM_AUDIO_SUPPORT
 #include "audio/audio_api.h"
+#endif
 
-#include "rv/rv_general.h"
-#include "rvf/rvf_api.h"
-#include "rvt/rvt_gen.h"
-#include "rvf/rvf_target.h" 
-#include "rv/rv_defined_swe.h"
+#include "../../riviera/rv/rv_general.h"
+#include "../../riviera/rvf/rvf_api.h"
+#include "../../riviera/rvt/rvt_gen.h"
+#include "../../riviera/rvf/rvf_target.h" 
+#include "../../riviera/rv/rv_defined_swe.h"
 
 #include <string.h>
 
-#ifdef RVM_LCC_SWE
+#if ETM_LCC_SUPPORT
     #include "lcc/lcc_api.h"
     #include "lcc/lcc_cfg_i.h"
     #include "lcc/lcc.h"
@@ -58,7 +61,7 @@
 {	
     char                swe_name[ETM_NAME_MAX_LEN];
     int                 mid;
-	int                 task_id;
+    int                 task_id;
     T_RVF_ADDR_ID       addr_id;    // Unique mailbox (ID) of the SWE which will
                                     //receive the message
     ETM_CALLBACK_FUNC	rx_callback_func;
@@ -75,7 +78,7 @@
  *****************************************************************************/
 
 extern T_ETM_ENV_CTRL_BLK *etm_env_ctrl_blk;
-#ifdef RVM_LCC_SWE
+#if ETM_LCC_SUPPORT
 extern T_PWR_CTRL_BLOCK *pwr_ctrl;
 #endif
 
@@ -83,10 +86,12 @@
 int etm_forward_packet(int mid, T_RV_HDR *msg);
 void etm_error_packet_send(int mid, int error);
 void etm_receive(unsigned char *inbuf, unsigned short size);
-int etm_ffs_pkt_receive(uint8 *data, int size);
 
+#if ETM_ATP_SUPPORT
 extern int etm_at_atp_message(void *msg);
-#ifdef RVM_LCC_SWE
+#endif
+
+#if ETM_LCC_SUPPORT
 extern int etm_pwr_ul(void *msg);
 extern int etm_pwr_dl(T_ETM_PKT *pkt, uint8 *buf, int insize);
 #endif
@@ -98,10 +103,12 @@
 T_RV_RET etm_task(void)
 {  
     extern int etm_core_init(void);
-    extern int etm_audio_init(void);
-#ifdef RVM_LCC_SWE
-    extern int etm_pwr_init(void);
-#endif
+    #if ETM_AUDIO_SUPPORT
+	extern int etm_audio_init(void);
+    #endif
+    #if ETM_LCC_SUPPORT
+	extern int etm_pwr_init(void);
+    #endif
 
     T_RV_HDR  *msg = NULL;
     T_ETM_PKT *pkt = NULL; 
@@ -114,8 +121,10 @@
     /* Entity registration to ETM */
     /* This should be in the individual SWE init. function*/
     status = etm_core_init();
+#if ETM_AUDIO_SUPPORT
     status = etm_audio_init();
-#ifdef RVM_LCC_SWE
+#endif
+#if ETM_LCC_SUPPORT
     status = etm_pwr_init();
 #endif
 
@@ -285,11 +294,11 @@
     if (mb_status == RVF_RED) {
 		tr_etm(TgTrFatal, "ETM: _malloc: Error to get memory");
         return NULL;
-	}
+    }
     /* The flag is yellow, there will soon be not enough memory anymore. */
-	else if (mb_status == RVF_YELLOW) {
-		tr_etm(TgTrFatal, "ETM: _malloc: Getting short on memory");
-	}
+    else if (mb_status == RVF_YELLOW) {
+	tr_etm(TgTrFatal, "ETM: _malloc: Getting short on memory");
+    }
 
     tr_etm(TgTrEtmLow,"ETM: _malloc: size(%d) at addr(0x%x)", size, addr);
     return addr;