fw/layer1: Fix missing include in prim_pm.c
[osmocom-bb.git] / src / target / firmware / layer1 / prim_pm.c
index b5260cb..134bffd 100644 (file)
 #include <calypso/dsp.h>
 #include <calypso/timer.h>
 #include <comm/sercomm.h>
+#include <asm/system.h>
 
 #include <layer1/sync.h>
 #include <layer1/agc.h>
 #include <layer1/tdma_sched.h>
 #include <layer1/tpu_window.h>
 #include <layer1/l23_api.h>
+#include <layer1/prim.h>
 
 #include <l1ctl_proto.h>
 
@@ -64,7 +66,6 @@ static int l1s_pm_cmd(uint8_t num_meas,
 
        dsp_api.db_w->d_task_md = num_meas; /* number of measurements */
        dsp_api.ndb->d_fb_mode = 0; /* wideband search */
-       dsp_end_scenario();
 
        /* Tell the RF frontend to set the gain appropriately */
        rffe_set_gain(-85, CAL_DSP_TGT_BB_LVL);
@@ -74,7 +75,6 @@ static int l1s_pm_cmd(uint8_t num_meas,
         * num_meas > 1 */
        l1s_rx_win_ctrl(arfcn, L1_RXWIN_PW, 0);
        //l1s_rx_win_ctrl(arfcn, L1_RXWIN_NB);
-       tpu_end_scenario();
 
        return 0;
 }
@@ -134,15 +134,20 @@ static int l1s_pm_resp(uint8_t num_meas, __unused uint8_t p2,
 }
 
 static const struct tdma_sched_item pm_sched_set[] = {
-       SCHED_ITEM(l1s_pm_cmd, 1, 0),           SCHED_END_FRAME(),
+       SCHED_ITEM_DT(l1s_pm_cmd, 0, 1, 0),     SCHED_END_FRAME(),
                                                SCHED_END_FRAME(),
-       SCHED_ITEM(l1s_pm_resp, 1, 0),          SCHED_END_FRAME(),
+       SCHED_ITEM(l1s_pm_resp, -4, 1, 0),      SCHED_END_FRAME(),
        SCHED_END_SET()
 };
 
 /* Schedule a power measurement test */
 void l1s_pm_test(uint8_t base_fn, uint16_t arfcn)
 {
+       unsigned long flags;
+
        printd("l1s_pm_test(%u, %u)\n", base_fn, arfcn);
+
+       local_firq_save(flags);
        tdma_schedule_set(base_fn, pm_sched_set, arfcn);
+       local_irq_restore(flags);
 }