|
|
@ -94,6 +94,10 @@ void sync_force_cp(sync_t *q, lte_cp_t cp) {
|
|
|
|
q->detect_cp = false;
|
|
|
|
q->detect_cp = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void sync_sss_en(sync_t *q, bool enabled) {
|
|
|
|
|
|
|
|
q->sss_en = enabled;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int sync_get_cell_id(sync_t *q) {
|
|
|
|
int sync_get_cell_id(sync_t *q) {
|
|
|
|
if (q->N_id_1 >=0 && q->N_id_2 >= 0) {
|
|
|
|
if (q->N_id_1 >=0 && q->N_id_2 >= 0) {
|
|
|
|
return q->N_id_1*3 + q->N_id_2;
|
|
|
|
return q->N_id_1*3 + q->N_id_2;
|
|
|
@ -179,6 +183,8 @@ int sync_run(sync_t *q, cf_t *input) {
|
|
|
|
INFO("PSS peak detected N_id_2=%d, pos=%d peak=%.2f par=%.2f th=%.2f cfo=%.4f\n", N_id_2,
|
|
|
|
INFO("PSS peak detected N_id_2=%d, pos=%d peak=%.2f par=%.2f th=%.2f cfo=%.4f\n", N_id_2,
|
|
|
|
peak_pos[N_id_2], peak_value[N_id_2], q->peak_to_avg, q->threshold, q->cfo);
|
|
|
|
peak_pos[N_id_2], peak_value[N_id_2], q->peak_to_avg, q->threshold, q->cfo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (q->sss_en) {
|
|
|
|
|
|
|
|
|
|
|
|
/* Make sure we have enough room to find SSS sequence */
|
|
|
|
/* Make sure we have enough room to find SSS sequence */
|
|
|
|
sss_idx_n = peak_pos[N_id_2]-2*(128+CP(128,CPNORM_LEN));
|
|
|
|
sss_idx_n = peak_pos[N_id_2]-2*(128+CP(128,CPNORM_LEN));
|
|
|
|
sss_idx_e = peak_pos[N_id_2]-2*(128+CP(128,CPEXT_LEN));
|
|
|
|
sss_idx_e = peak_pos[N_id_2]-2*(128+CP(128,CPEXT_LEN));
|
|
|
@ -233,8 +239,11 @@ int sync_run(sync_t *q, cf_t *input) {
|
|
|
|
q->N_id_1 = N_id_1_n;
|
|
|
|
q->N_id_1 = N_id_1_n;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
q->N_id_2 = N_id_2;
|
|
|
|
q->N_id_2 = N_id_2;
|
|
|
|
|
|
|
|
|
|
|
|
INFO("SSS detected N_id_1=%d, slot_idx=%d, %s CP\n",
|
|
|
|
INFO("SSS detected N_id_1=%d, slot_idx=%d, %s CP\n",
|
|
|
|
q->N_id_1, q->slot_id, CP_ISNORM(q->cp)?"Normal":"Extended");
|
|
|
|
q->N_id_1, q->slot_id, CP_ISNORM(q->cp)?"Normal":"Extended");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return peak_pos[N_id_2];
|
|
|
|
return peak_pos[N_id_2];
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|