comparison chipsetsw/layer1/p_cfile/l1p_func.c @ 327:294adc9e1d3c

l1p_func.c: Cust_get_agc_from_IL() argument count fix
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 04 Oct 2017 22:46:22 +0000
parents 84ef3a68e832
children 2604e9569e31
comparison
equal deleted inserted replaced
326:84ef3a68e832 327:294adc9e1d3c
73 #if (RF_FAM == 61) 73 #if (RF_FAM == 61)
74 ,UWORD8 afc_mode 74 ,UWORD8 afc_mode
75 ,UWORD8 if_ctl 75 ,UWORD8 if_ctl
76 #endif 76 #endif
77 ); 77 );
78 WORD8 Cust_get_agc_from_IL (UWORD16 radio_freq, UWORD16 agc_index, UWORD8 table_id, UWORD8 lna_off_val); 78 WORD8 Cust_get_agc_from_IL (UWORD16 radio_freq, UWORD16 agc_index, UWORD8 table_id);
79 void l1ps_macs_init (void); 79 void l1ps_macs_init (void);
80 80
81 /*-------------------------------------------------------*/ 81 /*-------------------------------------------------------*/
82 /* initialize_l1pvar() */ 82 /* initialize_l1pvar() */
83 /*-------------------------------------------------------*/ 83 /*-------------------------------------------------------*/
355 { 355 {
356 UWORD16 radio_freq_ctrl; 356 UWORD16 radio_freq_ctrl;
357 UWORD8 lna_off; 357 UWORD8 lna_off;
358 WORD8 agc; 358 WORD8 agc;
359 359
360 #if(L1_FF_MULTIBAND == 1)
361 UWORD16 operative_radio_freq;
362 #endif
363
364 UWORD8 mode = PACKET_TRANSFER; 360 UWORD8 mode = PACKET_TRANSFER;
365 UWORD8 input_level; 361 UWORD8 input_level;
366 #if (RF_FAM == 61) 362 #if (RF_FAM == 61)
367 UWORD16 dco_algo_ctl_pw = 0; 363 UWORD16 dco_algo_ctl_pw = 0;
368 UWORD8 if_ctl = 0; 364 UWORD8 if_ctl = 0;
369 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; 365 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM;
370 #endif 366 #endif
371 367
372 radio_freq_ctrl = l1pa_l1ps_com.cres_freq_list.alist->freq_list[l1pa_l1ps_com.tcr_freq_list.tcr_next_to_ctrl]; 368 radio_freq_ctrl = l1pa_l1ps_com.cres_freq_list.alist->freq_list[l1pa_l1ps_com.tcr_freq_list.tcr_next_to_ctrl];
373 369
374 // Get AGC according to the last known IL. 370 // Get AGC according to the last known IL.
375 #if(L1_FF_MULTIBAND == 0) 371
376
377 input_level = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level; 372 input_level = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level;
378 lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; 373 lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off;
379 agc = Cust_get_agc_from_IL(radio_freq_ctrl, input_level >> 1, PWR_ID, lna_off); 374 agc = Cust_get_agc_from_IL(radio_freq_ctrl, input_level >> 1, PWR_ID);
380
381 #else // L1_FF_MULTIBAND = 1 below
382
383 operative_radio_freq =
384 l1_multiband_radio_freq_convert_into_operative_radio_freq(radio_freq_ctrl);
385 input_level =
386 l1a_l1s_com.last_input_level[operative_radio_freq].input_level;
387 lna_off =
388 l1a_l1s_com.last_input_level[operative_radio_freq].lna_off;
389 agc =
390 Cust_get_agc_from_IL(radio_freq_ctrl, input_level >> 1, PWR_ID, lna_off);
391
392 #endif // #if(L1_FF_MULTIBAND == 0) else
393
394
395 375
396 #if (RF_FAM == 61) // Locosto DCO 376 #if (RF_FAM == 61) // Locosto DCO
397 #if (PWMEAS_IF_MODE_FORCE == 0) 377 #if (PWMEAS_IF_MODE_FORCE == 0)
398 cust_get_if_dco_ctl_algo(&dco_algo_ctl_pw, &if_ctl, (UWORD8) L1_IL_VALID , 378 cust_get_if_dco_ctl_algo(&dco_algo_ctl_pw, &if_ctl, (UWORD8) L1_IL_VALID ,
399 input_level, 379 input_level,
400 l1pa_l1ps_com.p_idle_param.radio_freq, if_threshold); 380 l1pa_l1ps_com.p_idle_param.radio_freq, if_threshold);
401 #else 381 #else
402 if_ctl = IF_120KHZ_DSP; 382 if_ctl = IF_120KHZ_DSP;
406 386
407 l1ddsp_load_dco_ctl_algo_pw(dco_algo_ctl_pw); 387 l1ddsp_load_dco_ctl_algo_pw(dco_algo_ctl_pw);
408 l1s.tcr_prog_done=1; 388 l1s.tcr_prog_done=1;
409 #endif 389 #endif
410 390
411 #if (L1_FF_MULTIBAND == 0)
412
413 // Memorize the IL and LNA used for AGC setting. 391 // Memorize the IL and LNA used for AGC setting.
414 l1pa_l1ps_com.tcr_freq_list.used_il_lna.il = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level; 392 l1pa_l1ps_com.tcr_freq_list.used_il_lna.il = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level;
415 l1pa_l1ps_com.tcr_freq_list.used_il_lna.lna = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; 393 l1pa_l1ps_com.tcr_freq_list.used_il_lna.lna = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off;
416
417 #else // L1_FF_MULTIBAND = 1 below
418
419 // Memorize the IL and LNA used for AGC setting.
420 l1pa_l1ps_com.tcr_freq_list.used_il_lna.il =
421 l1a_l1s_com.last_input_level[operative_radio_freq].input_level;
422 l1pa_l1ps_com.tcr_freq_list.used_il_lna.lna =
423 l1a_l1s_com.last_input_level[operative_radio_freq].lna_off;
424
425 #endif // #if (L1_FF_MULTIBAND == 0) else
426 394
427 // tpu pgm: 1 measurement only. 395 // tpu pgm: 1 measurement only.
428 l1dtpu_meas(radio_freq_ctrl, 396 l1dtpu_meas(radio_freq_ctrl,
429 agc, 397 agc,
430 lna_off, 398 lna_off,
480 /*-------------------------------------------------------*/ 448 /*-------------------------------------------------------*/
481 void l1ps_bcch_meas_ctrl(UWORD8 ts) 449 void l1ps_bcch_meas_ctrl(UWORD8 ts)
482 { 450 {
483 UWORD8 lna_off; 451 UWORD8 lna_off;
484 WORD8 agc; 452 WORD8 agc;
485 #if(L1_FF_MULTIBAND == 1) 453
486 UWORD16 operative_radio_freq = 0;
487 #endif
488
489 UWORD8 mode = PACKET_TRANSFER; 454 UWORD8 mode = PACKET_TRANSFER;
490 UWORD8 input_level; 455 UWORD8 input_level;
491 #if (RF_FAM == 61) 456 #if (RF_FAM == 61)
492 UWORD16 dco_algo_ctl_pw =0; 457 UWORD16 dco_algo_ctl_pw =0;
493 UWORD8 if_ctl=0; 458 UWORD8 if_ctl=0;
494 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM; 459 UWORD8 if_threshold = C_IF_ZERO_LOW_THRESHOLD_GSM;
495 #endif 460 #endif
496 461
497 462
498 if ((l1s.dsp_ctrl_reg & CTRL_ABORT) == 0) 463 if ((l1s.dsp_ctrl_reg & CTRL_ABORT) == 0)
499 { 464 {
500 #define radio_freq_ctrl l1a_l1s_com.Scell_info.radio_freq 465 #define radio_freq_ctrl l1a_l1s_com.Scell_info.radio_freq
501
502 #if(L1_FF_MULTIBAND == 0)
503 466
504 // Get AGC according to the last known IL. 467 // Get AGC according to the last known IL.
505 input_level = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level; 468 input_level = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].input_level;
506 lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; 469 lna_off = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off;
507 agc = Cust_get_agc_from_IL(radio_freq_ctrl, input_level >> 1, PWR_ID, lna_off); 470 agc = Cust_get_agc_from_IL(radio_freq_ctrl, input_level >> 1, PWR_ID);
508 // Memorize the IL and LNA used for AGC setting. 471 // Memorize the IL and LNA used for AGC setting.
509 // Note: the same structure as for TCR meas is used for PC_MEAS_CHAN measurements 472 // Note: the same structure as for TCR meas is used for PC_MEAS_CHAN measurements
510 l1pa_l1ps_com.tcr_freq_list.used_il_lna.il = input_level; 473 l1pa_l1ps_com.tcr_freq_list.used_il_lna.il = input_level;
511 l1pa_l1ps_com.tcr_freq_list.used_il_lna.lna = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off; 474 l1pa_l1ps_com.tcr_freq_list.used_il_lna.lna = l1a_l1s_com.last_input_level[radio_freq_ctrl - l1_config.std.radio_freq_index_offset].lna_off;
512 475
513 #else // L1_FF_MULTIBAND = 1 below
514
515 operative_radio_freq =
516 l1_multiband_radio_freq_convert_into_operative_radio_freq(radio_freq_ctrl);
517
518 // Get AGC according to the last known IL.
519 input_level =
520 l1a_l1s_com.last_input_level[operative_radio_freq].input_level;
521 lna_off =
522 l1a_l1s_com.last_input_level[operative_radio_freq].lna_off;
523 agc =
524 Cust_get_agc_from_IL(radio_freq_ctrl, input_level >> 1, PWR_ID, lna_off);
525
526 // Memorize the IL and LNA used for AGC setting.
527 // Note: the same structure as for TCR meas is used for PC_MEAS_CHAN measurements
528 l1pa_l1ps_com.tcr_freq_list.used_il_lna.il = input_level;
529 l1pa_l1ps_com.tcr_freq_list.used_il_lna.lna =
530 l1a_l1s_com.last_input_level[operative_radio_freq].lna_off;
531
532 #endif // #if(L1_FF_MULTIBAND == 0) else
533
534 476
535 #if (RF_FAM == 61) // Locosto DCO 477 #if (RF_FAM == 61) // Locosto DCO
536 cust_get_if_dco_ctl_algo(&dco_algo_ctl_pw, &if_ctl, (UWORD8) L1_IL_VALID, 478 cust_get_if_dco_ctl_algo(&dco_algo_ctl_pw, &if_ctl, (UWORD8) L1_IL_VALID,
537 input_level, 479 input_level,
538 radio_freq_ctrl,if_threshold); 480 radio_freq_ctrl,if_threshold);