changeset 581:bbb1e73782e6

tpudrv12.c: functions for different kinds of bursts
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Fri, 15 Aug 2014 07:14:49 +0000
parents df12004ac8ee
children 81753f5e902e
files gsm-fw/L1/tpudrv/tpudrv12.c
diffstat 1 files changed, 28 insertions(+), 417 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/L1/tpudrv/tpudrv12.c	Fri Aug 15 01:05:44 2014 +0000
+++ b/gsm-fw/L1/tpudrv/tpudrv12.c	Fri Aug 15 07:14:49 2014 +0000
@@ -605,261 +605,41 @@
  *
  * Receive Normal burst
  */
-#if (L1_RF_KBD_FIX == 1)
- #if (L1_MADC_ON == 1)
-void l1dmacro_rx_nb (SYS_UWORD16 radio_freq, UWORD8 adc_active, UWORD8 csf_filter_choice
-										#if(NEW_SNR_THRESHOLD==1)
-											, UWORD8 saic_flag_rx_up
-										#endif
-										)
+void l1dmacro_rx_nb (SYS_UWORD16 radio_freq)
 {
-	l1dmacro_rx_up(adc_active, csf_filter_choice, L1_KBD_DIS_RX_NB
-										#if(NEW_SNR_THRESHOLD==1)
-											, saic_flag_rx_up
-										#endif
-										);
-    l1dmacro_rx_down (STOP_RX_SNB);
-	l1s.total_kbd_on_time = l1s.total_kbd_on_time - L1_KBD_DIS_RX_NB * (-TRF_R3_1 + STOP_RX_SNB - TRF_R7);
-}
-#else
-void l1dmacro_rx_nb (SYS_UWORD16 radio_freq,UWORD8 csf_filter_choice
-										#if(NEW_SNR_THRESHOLD==1)
-											, UWORD8 saic_flag_rx_up
-										#endif
-										)
-{
-  l1dmacro_rx_up(csf_filter_choice, L1_KBD_DIS_RX_NB
-										#if(NEW_SNR_THRESHOLD==1)
-											, saic_flag_rx_up
-										#endif
-										);
-  l1dmacro_rx_down (STOP_RX_SNB);
-  l1s.total_kbd_on_time = l1s.total_kbd_on_time - L1_KBD_DIS_RX_NB * (-TRF_R3_1 + STOP_RX_SNB - TRF_R7);
+	l1dmacro_rx_up();
+	l1dmacro_rx_down(STOP_RX_SNB);
 }
-#endif
-#endif /*(L1_RF_KBD_FIX == 1)*/
-
-#if (L1_RF_KBD_FIX == 0)
- #if (L1_MADC_ON == 1)
-void l1dmacro_rx_nb (SYS_UWORD16 radio_freq, UWORD8 adc_active, UWORD8 csf_filter_choice
-										#if(NEW_SNR_THRESHOLD==1)
-											, UWORD8 saic_flag_rx_up
-										#endif
-										)
-{
-    l1dmacro_rx_up(adc_active, csf_filter_choice
-										#if(NEW_SNR_THRESHOLD==1)
-											, saic_flag_rx_up
-										#endif
-										);
-    l1dmacro_rx_down (STOP_RX_SNB);
-
-}
-#else
-void l1dmacro_rx_nb (SYS_UWORD16 radio_freq,UWORD8 csf_filter_choice
-										#if(NEW_SNR_THRESHOLD==1)
-											, UWORD8 saic_flag_rx_up
-										#endif
-										)
-{
-  l1dmacro_rx_up(csf_filter_choice
-							#if(NEW_SNR_THRESHOLD==1)
-								, saic_flag_rx_up
-							#endif
-										);
-  l1dmacro_rx_down (STOP_RX_SNB);
-
-}
-#endif
-
-#endif/*(L1_RF_KBD_FIX == 0)*/
-
-
 
 /*
  * l1dmacro_rx_sb
  * Receive Synchro burst
-*/
-#if (L1_RF_KBD_FIX == 1)
-#if (L1_MADC_ON == 1)
-void l1dmacro_rx_sb (SYS_UWORD16 radio_freq,UWORD8 adc_active)
-{
-  l1dmacro_rx_up(adc_active, L1_SAIC_HARDWARE_FILTER, L1_KBD_DIS_RX_SB
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
-
-  l1dmacro_rx_down (STOP_RX_SB);
-  l1s.total_kbd_on_time = l1s.total_kbd_on_time - L1_KBD_DIS_RX_SB * (-TRF_R3_1 + STOP_RX_SB - TRF_R7);
-}
-
-#else
+ */
 void l1dmacro_rx_sb (SYS_UWORD16 radio_freq)
 {
-  l1dmacro_rx_up(L1_SAIC_HARDWARE_FILTER, L1_KBD_DIS_RX_SB
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
+  l1dmacro_rx_up();
   l1dmacro_rx_down (STOP_RX_SB);
-  l1s.total_kbd_on_time = l1s.total_kbd_on_time - L1_KBD_DIS_RX_SB * (-TRF_R3_1 + STOP_RX_SB - TRF_R7);
 }
-#endif
-
-#endif/*(L1_RF_KBD_FIX == 1)*/
-
-#if(L1_RF_KBD_FIX == 0)
-#if (L1_MADC_ON == 1)
-void l1dmacro_rx_sb (SYS_UWORD16 radio_freq,UWORD8 adc_active)
-{
-  l1dmacro_rx_up(adc_active, L1_SAIC_HARDWARE_FILTER
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
-  l1dmacro_rx_down (STOP_RX_SB);
-
-}
-
-#else
-void l1dmacro_rx_sb (SYS_UWORD16 radio_freq)
-{
-  l1dmacro_rx_up(L1_SAIC_HARDWARE_FILTER
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
-  l1dmacro_rx_down (STOP_RX_SB);
-
-}
-#endif
-
-#endif/*(L1_RF_KBD_FIX == 0)*/
 
 /*
  * l1dmacro_rx_ms
  *
  * Receive Power Measurement window
  */
- #if(L1_RF_KBD_FIX == 1)
- #if (L1_MADC_ON == 1)
- void l1dmacro_rx_ms (SYS_UWORD16 radio_freq,UWORD8 adc_active)
-{
-  l1dmacro_rx_up(adc_active, L1_SAIC_HARDWARE_FILTER, L1_KBD_DIS_RX_MS
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
-  l1dmacro_rx_down (STOP_RX_PW_1);
-  l1s.total_kbd_on_time = l1s.total_kbd_on_time - L1_KBD_DIS_RX_MS * (-TRF_R3_1 + STOP_RX_PW_1 - TRF_R7);
-}
-
- #else
 void l1dmacro_rx_ms (SYS_UWORD16 radio_freq)
 {
-  l1dmacro_rx_up(L1_SAIC_HARDWARE_FILTER, L1_KBD_DIS_RX_MS
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
+  l1dmacro_rx_up();
   l1dmacro_rx_down (STOP_RX_PW_1);
-  l1s.total_kbd_on_time = l1s.total_kbd_on_time - L1_KBD_DIS_RX_MS * (-TRF_R3_1 + STOP_RX_PW_1 - TRF_R7);
 }
-#endif
-#endif/*(L1_RF_KBD_FIX == 1)*/
-
-#if(L1_RF_KBD_FIX == 0)
-#if (L1_MADC_ON == 1)
- void l1dmacro_rx_ms (SYS_UWORD16 radio_freq,UWORD8 adc_active)
-{
-  l1dmacro_rx_up(adc_active, L1_SAIC_HARDWARE_FILTER
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
-  l1dmacro_rx_down (STOP_RX_PW_1);
-
-}
-
- #else
-void l1dmacro_rx_ms (SYS_UWORD16 radio_freq)
-{
-  l1dmacro_rx_up(L1_SAIC_HARDWARE_FILTER
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
-  l1dmacro_rx_down (STOP_RX_PW_1);
-
-}
-#endif
-
-#endif/*(L1_RF_KBD_FIX == 0)*/
 
 /*
  * l1dmacro_rx_fb
  *
  * Receive Frequency burst
  */
-#if(L1_RF_KBD_FIX == 1)
-#if (L1_MADC_ON == 1)
-void l1dmacro_rx_fb (SYS_UWORD16 radio_freq,UWORD8 adc_active)
-#else
 void l1dmacro_rx_fb (SYS_UWORD16 radio_freq)
-#endif
 {
-#if (L1_MADC_ON == 1)
-  l1dmacro_rx_up(adc_active, L1_SAIC_HARDWARE_FILTER, L1_KBD_DIS_RX_FB
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
-#else
-  l1dmacro_rx_up(L1_SAIC_HARDWARE_FILTER, L1_KBD_DIS_RX_FB
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
-#endif
-  l1s.total_kbd_on_time = 5000;
-  *TP_Ptr++ = TPU_AT(0);
-  *TP_Ptr++ = TPU_AT(0);
-  *TP_Ptr++ = TPU_AT(0);
-  *TP_Ptr++ = TPU_AT(0);
-  *TP_Ptr++ = TPU_AT(0);
-  *TP_Ptr++ = TPU_AT(0);
-  *TP_Ptr++ = TPU_AT(0);
-  *TP_Ptr++ = TPU_AT(0);
-  *TP_Ptr++ = TPU_AT(0);
-  *TP_Ptr++ = TPU_AT(0);
-  *TP_Ptr++ = TPU_AT(0);
-
-  l1dmacro_rx_down (STOP_RX_FB);
-  l1s.total_kbd_on_time = l1s.total_kbd_on_time - L1_KBD_DIS_RX_FB * (STOP_RX_FB - TRF_R7);
-}
-#endif/*(L1_RF_KBD_FIX == 1)*/
-
-#if(L1_RF_KBD_FIX == 0)
-#if (L1_MADC_ON == 1)
-void l1dmacro_rx_fb (SYS_UWORD16 radio_freq,UWORD8 adc_active)
-#else
-void l1dmacro_rx_fb (SYS_UWORD16 radio_freq)
-#endif
-{
-#if (L1_MADC_ON == 1)
-  l1dmacro_rx_up(adc_active, L1_SAIC_HARDWARE_FILTER
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
-#else
-  l1dmacro_rx_up(L1_SAIC_HARDWARE_FILTER
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
-#endif
+  l1dmacro_rx_up();
 
   *TP_Ptr++ = TPU_AT(0);
   *TP_Ptr++ = TPU_AT(0);
@@ -874,238 +654,70 @@
   *TP_Ptr++ = TPU_AT(0);
 
   l1dmacro_rx_down (STOP_RX_FB);
-
 }
 
-#endif/*(L1_RF_KBD_FIX == 0)*/
-
 /*
  * l1dmacro_rx_fb26
  *
  * Receive Frequency burst for TCH.
  */
- #if(L1_RF_KBD_FIX == 1)
- #if (L1_MADC_ON == 1)
- void l1dmacro_rx_fb26 (SYS_UWORD16 radio_freq,UWORD8 adc_active)
-{
-  l1dmacro_rx_up(adc_active, L1_SAIC_HARDWARE_FILTER, L1_KBD_DIS_RX_FB26
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
-  l1s.total_kbd_on_time = 5000;
-  *TP_Ptr++ = TPU_AT(0);
-
-  l1dmacro_rx_down (STOP_RX_FB26);
-  l1s.total_kbd_on_time = l1s.total_kbd_on_time - L1_KBD_DIS_RX_FB26 * (STOP_RX_FB26 - TRF_R7);
-}
-
- #else
 void l1dmacro_rx_fb26 (SYS_UWORD16 radio_freq)
 {
-  l1dmacro_rx_up(L1_SAIC_HARDWARE_FILTER, L1_KBD_DIS_RX_FB26
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
-  l1s.total_kbd_on_time = 5000;
-  *TP_Ptr++ = TPU_AT(0);
-
-  l1dmacro_rx_down (STOP_RX_FB26);
-  l1s.total_kbd_on_time = l1s.total_kbd_on_time - L1_KBD_DIS_RX_FB26 * (STOP_RX_FB26 - TRF_R7);
-}
-#endif
-#endif/*(L1_RF_KBD_FIX == 1)*/
-
-#if(L1_RF_KBD_FIX == 0)
-#if (L1_MADC_ON == 1)
- void l1dmacro_rx_fb26 (SYS_UWORD16 radio_freq,UWORD8 adc_active)
-{
-  l1dmacro_rx_up(adc_active, L1_SAIC_HARDWARE_FILTER
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
+  l1dmacro_rx_up();
 
   *TP_Ptr++ = TPU_AT(0);
 
   l1dmacro_rx_down (STOP_RX_FB26);
-
 }
 
- #else
-void l1dmacro_rx_fb26 (SYS_UWORD16 radio_freq)
-{
-  l1dmacro_rx_up(L1_SAIC_HARDWARE_FILTER
-  	#if(NEW_SNR_THRESHOLD==1)
-	, SAIC_OFF
-	#endif
-	);
-
-  *TP_Ptr++ = TPU_AT(0);
-
-  l1dmacro_rx_down (STOP_RX_FB26);
-
-}
-#endif
-#endif/*(L1_RF_KBD_FIX == 0)*/
-
 /*
  * l1dmacro_tx_nb
  *
  * Transmit Normal burst
  */
-#if(L1_RF_KBD_FIX == 1)
-
- void l1dmacro_tx_nb (SYS_UWORD16 radio_freq, UWORD8 txpwr, UWORD8 adc_active)
-{
-  l1dmacro_tx_up (L1_KBD_DIS_TX_NB);
-  l1dmacro_tx_down (l1_config.params.tx_nb_duration, FALSE, adc_active, L1_KBD_DIS_TX_NB);
-  l1s.total_kbd_on_time = l1s.total_kbd_on_time - L1_KBD_DIS_TX_NB * (-TRF_T3_1 + l1_config.params.tx_nb_duration + TRF_T12);
-}
-
-#endif/*#if(L1_RF_KBD_FIX == 1)*/
-
-#if(L1_RF_KBD_FIX == 0)
- void l1dmacro_tx_nb (SYS_UWORD16 radio_freq, UWORD8 txpwr, UWORD8 adc_active)
+void l1dmacro_tx_nb (SYS_UWORD16 radio_freq, UWORD8 txpwr, UWORD8 adc_active)
 {
   l1dmacro_tx_up ();
   l1dmacro_tx_down (l1_config.params.tx_nb_duration, FALSE, adc_active);
-
 }
 
-#endif/*#if(L1_RF_KBD_FIX == 0)*/
-
 /*
  * l1dmacro_tx_ra
  *
  * Transmit Random Access burst
  */
-#if(L1_RF_KBD_FIX == 1)
-
-void l1dmacro_tx_ra (SYS_UWORD16 radio_freq, UWORD8 txpwr, UWORD8 adc_active)
-{
-  l1dmacro_tx_up (L1_KBD_DIS_TX_RA);
-  l1dmacro_tx_down (l1_config.params.tx_ra_duration, FALSE, adc_active, L1_KBD_DIS_TX_RA);
-  l1s.total_kbd_on_time = l1s.total_kbd_on_time - L1_KBD_DIS_TX_RA * (-TRF_T3_1 + l1_config.params.tx_ra_duration + TRF_T12);
-}
-#endif /*#if(L1_RF_KBD_FIX == 1)*/
-
-#if(L1_RF_KBD_FIX == 0)
 void l1dmacro_tx_ra (SYS_UWORD16 radio_freq, UWORD8 txpwr, UWORD8 adc_active)
 {
   l1dmacro_tx_up ();
   l1dmacro_tx_down (l1_config.params.tx_ra_duration, FALSE, adc_active);
-
 }
-#endif/*#if(L1_RF_KBD_FIX == 0)*/
-
-  /*
-   * l1dmacro_rx_cont
-   *
-   * Receive continuously
-   */
-#if(L1_RF_KBD_FIX == 1)
- #if (L1_MADC_ON == 1)
- void l1dmacro_rx_cont (SYS_UWORD16 radio_freq, UWORD8 txpwr,
-                        UWORD8 adc_active, UWORD8 csf_filter_choice
-										#if(NEW_SNR_THRESHOLD==1)
-											, UWORD8 saic_flag_rx_up
-										#endif
-										)
-{
-  l1dmacro_rx_up (adc_active, csf_filter_choice, KBD_DISABLED
-										#if(NEW_SNR_THRESHOLD==1)
-											, saic_flag_rx_up
-										#endif
-										);
-}
- #else
-void l1dmacro_rx_cont (SYS_UWORD16 radio_freq, UWORD8 txpwr,
-                       UWORD8 csf_filter_choice
-								#if(NEW_SNR_THRESHOLD==1)
-									, UWORD8 saic_flag_rx_up
-								#endif
-								)
-{
-  l1dmacro_rx_up (csf_filter_choice,KBD_DISABLED
-								#if(NEW_SNR_THRESHOLD==1)
-									, saic_flag_rx_up
-								#endif
-								);
-}
-#endif
-#endif/*#if(L1_RF_KBD_FIX == 1)*/
 
-#if(L1_RF_KBD_FIX == 0)
- #if (L1_MADC_ON == 1)
- void l1dmacro_rx_cont (SYS_UWORD16 radio_freq, UWORD8 txpwr,
-                        UWORD8 adc_active, UWORD8 csf_filter_choice
-								#if(NEW_SNR_THRESHOLD==1)
-									, UWORD8 saic_flag_rx_up
-								#endif
-								)
-{
-  l1dmacro_rx_up (adc_active, csf_filter_choice
-								#if(NEW_SNR_THRESHOLD==1)
-									, saic_flag_rx_up
-								#endif
-								);
-}
- #else
-void l1dmacro_rx_cont (SYS_UWORD16 radio_freq, UWORD8 txpwr,
-                       UWORD8 csf_filter_choice
-							#if(NEW_SNR_THRESHOLD==1)
-								, UWORD8 saic_flag_rx_up
-							#endif
-							)
+#if TESTMODE
+/*
+ * l1dmacro_rx_cont
+ *
+ * Receive continuously
+ */
+void l1dmacro_rx_cont (SYS_UWORD16 radio_freq, UWORD8 txpwr)
 {
-  l1dmacro_rx_up (csf_filter_choice
-						#if(NEW_SNR_THRESHOLD==1)
-							, saic_flag_rx_up
-						#endif
-						);
+  l1dmacro_rx_up ();
 }
-#endif
-
-#endif/*#if(L1_RF_KBD_FIX == 0)*/
-
 
-  /*
-   * l1dmacro_tx_cont
-   *
-   * Transmit continuously
-   */
-#if(L1_RF_KBD_FIX == 1)
-void l1dmacro_tx_cont (SYS_UWORD16 radio_freq, UWORD8 txpwr)
-{
-  l1dmacro_tx_up (KBD_DISABLED);
-}
-#endif/*#if(L1_RF_KBD_FIX == 1)*/
-
-#if(L1_RF_KBD_FIX == 0)
+/*
+ * l1dmacro_tx_cont
+ *
+ * Transmit continuously
+ */
 void l1dmacro_tx_cont (SYS_UWORD16 radio_freq, UWORD8 txpwr)
 {
   l1dmacro_tx_up ();
 }
-#endif/*#if(L1_RF_KBD_FIX == 0)*/
 
-  /*
-   * l1d_macro_stop_cont
-   *
-   * Stop continuous Tx or Rx
-   */
-#if(L1_RF_KBD_FIX == 1)
-void l1dmacro_stop_cont (void)
-{
-  if (l1_config.tmode.rf_params.down_up == TMODE_DOWNLINK)
-    l1dmacro_rx_down(STOP_RX_SNB);
-  else
-    l1dmacro_tx_down(l1_config.params.tx_nb_duration, FALSE, 0, KBD_DISABLED);
-}
-#endif/*#if(L1_RF_KBD_FIX == 1)*/
-
-#if(L1_RF_KBD_FIX == 0)
+/*
+ * l1d_macro_stop_cont
+ *
+ * Stop continuous Tx or Rx
+ */
 void l1dmacro_stop_cont (void)
 {
   if (l1_config.tmode.rf_params.down_up == TMODE_DOWNLINK)
@@ -1113,8 +725,7 @@
   else
     l1dmacro_tx_down(l1_config.params.tx_nb_duration, FALSE, 0);
 }
-
-#endif/* */
+#endif	/* TESTMODE */
 
 
 /*------------------------------------------*/