comparison chipsetsw/layer1/cfile/l1_ctl.c @ 82:ef6cf21cf9d6

l1_ctl.c: passes compilation, but doesn't match old object yet
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Tue, 29 Mar 2016 16:24:09 +0000
parents 6124f48fc1fa
children 43dd68d8d891
comparison
equal deleted inserted replaced
81:6124f48fc1fa 82:ef6cf21cf9d6
653 653
654 }/*end AFC_CLOSE_LOOP*/ 654 }/*end AFC_CLOSE_LOOP*/
655 } /* end else AFC_INIT*/ 655 } /* end else AFC_INIT*/
656 656
657 *frame_count=0; 657 *frame_count=0;
658 //Locosto 658 return(Psi_quant[C_N_del]>>3); /* F16.0 */
659 // return(Psi_quant[C_N_del]>>3); /* F16.0 */
660 return(CONVERT_PSI_QUANT(Psi_quant[C_N_del])); /* F16.0 to 14.2 or 13.3 */
661 659
662 #else 660 #else
663 661
664 } /* end case algo 1 */ 662 } /* end case algo 1 */
665 663
929 break; 927 break;
930 } // switch phase 928 } // switch phase
931 929
932 *frame_count = 0; 930 *frame_count = 0;
933 931
934 //Locosto 932 return (psi_quant >> 3); /* F16.0 */
935 // return (psi_quant >> 3); /* F16.0 */
936 return(CONVERT_PSI_QUANT(psi_quant)); /* F16.0 to 14.2 or 13.3 */
937 } /* end case algo 2 */ 933 } /* end case algo 2 */
938 934
939 /* algo1 + init + estimator/predictor */ 935 /* algo1 + init + estimator/predictor */
940 case ALGO_AFC_KALMAN_PREDICTOR: 936 case ALGO_AFC_KALMAN_PREDICTOR:
941 { 937 {
1272 Psi_quant[C_N_del]=C_min_step; 1268 Psi_quant[C_N_del]=C_min_step;
1273 else Psi_quant[C_N_del]=var_16; /* F13.3 */ 1269 else Psi_quant[C_N_del]=var_16; /* F13.3 */
1274 1270
1275 1271
1276 }/*end AFC_CLOSE_LOOP*/ 1272 }/*end AFC_CLOSE_LOOP*/
1277 } /* end else AFC_INIT*/ 1273 } /* end else AFC_INIT*/
1278 1274
1279 *frame_count = 0; 1275 *frame_count = 0;
1280 //Locosto 1276 return(Psi_quant[C_N_del]>>3); /* F16.0 */
1281 // return(Psi_quant[C_N_del]>>3); /* F16.0 */
1282 return(((CONVERT_PSI_QUANT(Psi_quant[C_N_del]))&0x3FFF)); /* F16.0 to 14.2 or 13.3 */
1283 } /* end case algo 3 */ 1277 } /* end case algo 3 */
1284 #endif 1278 #endif
1285 1279
1286 #if (VCXO_ALGO == 1) 1280 #if (VCXO_ALGO == 1)
1287 default: 1281 default:
2136 delta1_freq = l1ctl_encode_delta1(radio_freq); 2130 delta1_freq = l1ctl_encode_delta1(radio_freq);
2137 delta2_freq = l1ctl_encode_delta2(radio_freq); 2131 delta2_freq = l1ctl_encode_delta2(radio_freq);
2138 2132
2139 lna_value = lna_off * l1ctl_get_lna_att(radio_freq); 2133 lna_value = lna_off * l1ctl_get_lna_att(radio_freq);
2140 2134
2141 last_known_agc = (Cust_get_agc_from_IL(radio_freq, last_known_il >> 1, PWR_ID, lna_off)) << 1; 2135 last_known_agc = (Cust_get_agc_from_IL(radio_freq, last_known_il >> 1, PWR_ID)) << 1;
2142 // F7.1 in order to be compatible with 2136 // F7.1 in order to be compatible with
2143 // pm and IL formats [-20,+140 in F7.1] 2137 // pm and IL formats [-20,+140 in F7.1]
2144 // contain the input_level value we use 2138 // contain the input_level value we use
2145 // in the associated CTL task to build 2139 // in the associated CTL task to build
2146 // the agc used in this CTL. 2140 // the agc used in this CTL.
2413 // that was applied to signal when performing the power 2407 // that was applied to signal when performing the power
2414 // measure. 2408 // measure.
2415 lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq); 2409 lna_value = l1a_l1s_com.Scell_used_IL_dd.lna_off * l1ctl_get_lna_att(radio_freq);
2416 2410
2417 // Compute applied agc for this pm 2411 // Compute applied agc for this pm
2418 last_known_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, MAX_ID,l1a_l1s_com.Scell_used_IL_dd.lna_off )) << 1; 2412 last_known_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, MAX_ID)) << 1;
2419 // F7.1 in order to be compatible 2413 // F7.1 in order to be compatible
2420 // with pm and IL formats 2414 // with pm and IL formats
2421 // contain the input_level value we use 2415 // contain the input_level value we use
2422 // in the associated CTL task to build 2416 // in the associated CTL task to build
2423 // the agc used in this CTL. 2417 // the agc used in this CTL.
2471 IL_info_ptr->input_level = IL_max; 2465 IL_info_ptr->input_level = IL_max;
2472 2466
2473 #if L2_L3_SIMUL 2467 #if L2_L3_SIMUL
2474 #if (DEBUG_TRACE==BUFFER_TRACE_PAGC) 2468 #if (DEBUG_TRACE==BUFFER_TRACE_PAGC)
2475 buffer_trace(4,IL_info_ptr->input_level,last_known_agc, 2469 buffer_trace(4,IL_info_ptr->input_level,last_known_agc,
2476 l1a_l1s_com.Scell_used_IL_dd.input_level,Cust_get_agc_from_IL(radio_freq, IL_max >> 1, MAX_ID, l1a_l1s_com.Scell_used_IL_dd.lna_off)); 2470 l1a_l1s_com.Scell_used_IL_dd.input_level,Cust_get_agc_from_IL(radio_freq, IL_max >> 1, MAX_ID));
2477 #endif 2471 #endif
2478 #endif 2472 #endif
2479 2473
2480 return((UWORD8)current_calibrated_IL); 2474 return((UWORD8)current_calibrated_IL);
2481 } 2475 }
2536 } 2530 }
2537 else 2531 else
2538 #endif 2532 #endif
2539 { 2533 {
2540 #if DPAGC_MAX_FLAG 2534 #if DPAGC_MAX_FLAG
2541 last_known_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, MAX_ID,l1a_l1s_com.Scell_used_IL_dd.lna_off)) << 1; 2535 last_known_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, MAX_ID)) << 1;
2542 // F7.1 in order to be compatible with pm and IL formats 2536 // F7.1 in order to be compatible with pm and IL formats
2543 #else 2537 #else
2544 last_known_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, AV_ID,l1a_l1s_com.Scell_used_IL_dd.lna_off)) << 1; 2538 last_known_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, AV_ID)) << 1;
2545 // F7.1 in order to be compatible with pm and IL formats 2539 // F7.1 in order to be compatible with pm and IL formats
2546 #endif 2540 #endif
2547 // input_level_dd : contain the input_level value we use 2541 // input_level_dd : contain the input_level value we use
2548 // in the associated CTL task to build the agc used in this CTL. 2542 // in the associated CTL task to build the agc used in this CTL.
2549 2543
2665 IL_info_ptr->input_level = (UWORD8)new_IL ; 2659 IL_info_ptr->input_level = (UWORD8)new_IL ;
2666 2660
2667 #if L2_L3_SIMUL 2661 #if L2_L3_SIMUL
2668 #if (DEBUG_TRACE==BUFFER_TRACE_DPAGC) 2662 #if (DEBUG_TRACE==BUFFER_TRACE_DPAGC)
2669 buffer_trace(4,IL_info_ptr->input_level,last_known_agc, 2663 buffer_trace(4,IL_info_ptr->input_level,last_known_agc,
2670 l1a_l1s_com.Scell_used_IL_dd.input_level,Cust_get_agc_from_IL(radio_freq, new_IL >> 1, MAX_ID,l1a_l1s_com.Scell_used_IL_dd.lna_off)); 2664 l1a_l1s_com.Scell_used_IL_dd.input_level,Cust_get_agc_from_IL(radio_freq, new_IL >> 1, MAX_ID));
2671 #endif 2665 #endif
2672 #endif 2666 #endif
2673 2667
2674 return((UWORD8)current_calibrated_IL); 2668 return((UWORD8)current_calibrated_IL);
2675 } 2669 }
2731 } 2725 }
2732 else 2726 else
2733 #endif 2727 #endif
2734 { 2728 {
2735 #if DPAGC_MAX_FLAG 2729 #if DPAGC_MAX_FLAG
2736 last_known_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, MAX_ID,l1a_l1s_com.Scell_used_IL_dd.lna_off)) << 1; 2730 last_known_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, MAX_ID)) << 1;
2737 // F7.1 in order to be compatible with pm and IL formats 2731 // F7.1 in order to be compatible with pm and IL formats
2738 #else 2732 #else
2739 last_known_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, AV_ID,l1a_l1s_com.Scell_used_IL_dd.lna_off)) << 1; 2733 last_known_agc = (Cust_get_agc_from_IL(radio_freq, l1a_l1s_com.Scell_used_IL_dd.input_level >> 1, AV_ID)) << 1;
2740 // F7.1 in order to be compatible with pm and IL formats 2734 // F7.1 in order to be compatible with pm and IL formats
2741 #endif 2735 #endif
2742 // input_level_dd : contain the input_level value we use 2736 // input_level_dd : contain the input_level value we use
2743 // in the associated CTL task to build the agc used in this CTL. 2737 // in the associated CTL task to build the agc used in this CTL.
2744 2738
2873 IL_info_ptr->input_level = (UWORD8)new_IL ; 2867 IL_info_ptr->input_level = (UWORD8)new_IL ;
2874 2868
2875 #if L2_L3_SIMUL 2869 #if L2_L3_SIMUL
2876 #if (DEBUG_TRACE==BUFFER_TRACE_DPAGC) 2870 #if (DEBUG_TRACE==BUFFER_TRACE_DPAGC)
2877 buffer_trace(4,IL_info_ptr->input_level,last_known_agc, 2871 buffer_trace(4,IL_info_ptr->input_level,last_known_agc,
2878 l1a_l1s_com.Scell_used_IL_dd.input_level,Cust_get_agc_from_IL(radio_freq, new_IL >> 1, MAX_ID,l1a_l1s_com.Scell_used_IL_dd.lna_off)); 2872 l1a_l1s_com.Scell_used_IL_dd.input_level,Cust_get_agc_from_IL(radio_freq, new_IL >> 1, MAX_ID));
2879 #endif 2873 #endif
2880 #endif 2874 #endif
2881 2875
2882 return((UWORD8)current_calibrated_IL); 2876 return((UWORD8)current_calibrated_IL);
2883 } 2877 }
2939 /*-------------------------------------------------------*/ 2933 /*-------------------------------------------------------*/
2940 /* Parameters : */ 2934 /* Parameters : */
2941 /* Return : */ 2935 /* Return : */
2942 /* Functionality : */ 2936 /* Functionality : */
2943 /*-------------------------------------------------------*/ 2937 /*-------------------------------------------------------*/
2944 UWORD16 l1ctl_update_TPU_with_toa(void) 2938 void l1ctl_update_TPU_with_toa(void)
2945 { 2939 {
2946 #if (TOA_ALGO != 0) 2940 #if (TOA_ALGO != 0)
2947 WORD16 toa_shift; 2941 WORD16 toa_shift;
2948 2942
2949 #if (TOA_ALGO == 2) 2943 #if (TOA_ALGO == 2)
3003 #else 2997 #else
3004 l1s.toa_shift = ISH_INVALID; // Reset the ISH. 2998 l1s.toa_shift = ISH_INVALID; // Reset the ISH.
3005 #endif 2999 #endif
3006 } 3000 }
3007 #endif 3001 #endif
3008 return 0; //omaps00090550
3009 } 3002 }
3010 3003
3011 3004
3012 /*-------------------------------------------------------*/ 3005 /*-------------------------------------------------------*/
3013 /* l1ctl_saic() */ 3006 /* l1ctl_saic() */