// +FHDR------------------------------------------------------------
//                 Copyright (c) 2022 SmartLogic.
//                       ALL RIGHTS RESERVED
// -----------------------------------------------------------------
// Filename      : case20_ape1_task.s.c
// Author        : 
// Created On    : 2023-01-05
// Last Modified :
// -----------------------------------------------------------------
// Description:
//
//
// -FHDR------------------------------------------------------------
#include "ucp_utility.h"
#include "ucp_tick.h"
#include "ucp_printf.h"
#include "phy_para.h"
#include "osp_msg.h"
#include "ucp_testcase.h"
#include "msg_transfer_layer.h"
#include "ucp_port.h"
#include "ape_mtimer.h"
#include "osp_task.h"
#include "osp_timer.h"

/***************************************************************/
/*                   事件任务相关打点                                  */
static uint32_t g_u32_case22_ape1_event1_rev_num      = 0; // 30 0xB7E00278
static uint32_t g_u32_case22_ape1_event1_rev_ok       = 0; // 31 0xB7E0027C
static uint32_t g_u32_case22_ape1_event1_addr_err     = 0; // 32 0xB7E00280
static uint32_t g_u32_case22_ape1_event1_tick         = 0;
static uint32_t g_u32_case22_ape1_event1_tick_err     = 0; // 33 0xB7E00284
static uint32_t g_u32_case22_ape1_event1_sfn_slot_err = 0; // 35 0xB7E0028C
static uint32_t g_u32_case22_ape1_event1_alloc1_err   = 0; // 40 0xB7E002A0
static uint32_t g_u32_case22_ape1_event1_send1_err    = 0; // 41 0xB7E002A4
static uint32_t g_u32_case22_ape1_event1_alloc2_err   = 0; // 42 0xB7E002A8
static uint32_t g_u32_case22_ape1_event1_send2_err    = 0; // 43 0xB7E002AC
static uint32_t g_u32_case22_ape1_event1_send_ok      = 0; // 44 0xB7E002B0
static uint32_t g_u32_case22_ape1_recv_msg_tick_err   = 0; // DBG_DDR_MSG_IDX(20) 0xB7E04050(ape0)/0xB7E04350(ape1)

static uint32_t g_u32_case22_ape1_event2_num          = 0; // 45 0xB7E002B4
static uint32_t g_u32_case22_ape1_event3_num          = 0; // 46 0xB7E002B8

/* 收到ARM侧发来的消息（通过RFM转发） */
void ape1_event1_task(uint32_t addr, uint32_t size)
{
    uint32_t ape_id   = get_core_id();
    uint32_t msg_addr = 0;
    uint32_t que_num  = 0;
    uint32_t value    = 0;
    uint16_t scs      = LTE_SCS_ID;//15KHz
    uint16_t sfn      = 0;
    uint16_t slot     = 0;
    uint16_t sfn_l    = 0;
    uint16_t slot_l   = 0;
    uint32_t u32_clock_offset = 0;
    uint32_t u32_clock_tick   = 0;
    uint32_t tick_from_ape_tx = 0;
    uint32_t tick_from_arm_rx = 0;
    uint32_t tick_from_arm_tx = 0;
    uint32_t tick_from_rfm_rx = 0;
    uint32_t tick_from_rfm_tx = 0;
    uint32_t tick_from_ape_rx = 0;
    uint32_t offset_loopback  = 0;
    char     *paddr   = NULL;
    int       ret     = 0;

    g_u32_case22_ape1_event1_rev_num++;
    if (0 == addr)
    {
        g_u32_case22_ape1_event1_addr_err++;
        debug_write(DBG_DDR_COMMON_IDX(ape_id, 32), g_u32_case22_ape1_event1_addr_err);
        return ;
    }

    msg_addr = do_read(addr);
    que_num  = do_read(addr+4);

    value = *(uint32_t*)msg_addr;
    sfn  = value >> 16;
    slot = value & 0xffff;
    //msg_transfer_free_msg(TEST_QUE_PORT_ID, que_num, 0, (char*)msg_addr);
    g_u32_case22_ape1_event1_rev_ok++;

    debug_write(DBG_DDR_COMMON_IDX(ape_id, 30), g_u32_case22_ape1_event1_rev_num);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 31), g_u32_case22_ape1_event1_rev_ok);

    rdmcycle(&u32_clock_tick);
    tick_from_ape_tx = do_read(msg_addr+4);
    tick_from_arm_rx = do_read(msg_addr+8);
    tick_from_arm_tx = do_read(msg_addr+12);
    tick_from_rfm_rx = do_read(msg_addr+16);
    tick_from_rfm_tx = do_read(msg_addr+20);
    offset_loopback = (tick_from_ape_rx - tick_from_ape_tx + TICK_PP1S_OFFSET)%TICK_PP1S_OFFSET;
    if (offset_loopback >= LOOPBACK_APE_OFFSET)
    {
        if (g_u32_case22_ape1_recv_msg_tick_err < CASE0_APE0_RX_ERR_MAX_NUM)
        {
            debug_write(DBG_DDR_MSG_IDX(que_num, (CASE0_APE0_RX_ERR_MAX_NUM*g_u32_case22_ape1_recv_msg_tick_err + 21)), offset_loopback);
            debug_write(DBG_DDR_MSG_IDX(que_num, (CASE0_APE0_RX_ERR_MAX_NUM*g_u32_case22_ape1_recv_msg_tick_err + 22)), tick_from_ape_tx);
            debug_write(DBG_DDR_MSG_IDX(que_num, (CASE0_APE0_RX_ERR_MAX_NUM*g_u32_case22_ape1_recv_msg_tick_err + 23)), tick_from_arm_rx);
            debug_write(DBG_DDR_MSG_IDX(que_num, (CASE0_APE0_RX_ERR_MAX_NUM*g_u32_case22_ape1_recv_msg_tick_err + 24)), tick_from_arm_tx);
            debug_write(DBG_DDR_MSG_IDX(que_num, (CASE0_APE0_RX_ERR_MAX_NUM*g_u32_case22_ape1_recv_msg_tick_err + 25)), tick_from_rfm_rx);
            debug_write(DBG_DDR_MSG_IDX(que_num, (CASE0_APE0_RX_ERR_MAX_NUM*g_u32_case22_ape1_recv_msg_tick_err + 26)), tick_from_rfm_tx);
            debug_write(DBG_DDR_MSG_IDX(que_num, (CASE0_APE0_RX_ERR_MAX_NUM*g_u32_case22_ape1_recv_msg_tick_err + 27)), tick_from_ape_rx);
        }
        g_u32_case22_ape1_recv_msg_tick_err++;
        debug_write(DBG_DDR_MSG_IDX(que_num, 20), g_u32_case22_ape1_recv_msg_tick_err);
    }

    if (0 == g_u32_case22_ape1_event1_tick)
    {
        g_u32_case22_ape1_event1_tick = u32_clock_tick;
    }
    else
    {
        if (u32_clock_tick > g_u32_case22_ape1_event1_tick)
        {
            u32_clock_offset = u32_clock_tick - g_u32_case22_ape1_event1_tick;
            if ((u32_clock_offset > TIMER_OFFSET_MAX_15K) || (u32_clock_offset < TIMER_OFFSET_MIN_15K))
            {
                g_u32_case22_ape1_event1_tick_err++;
                debug_write(DBG_DDR_COMMON_IDX(ape_id, 33), g_u32_case22_ape1_event1_tick_err);
                debug_write(DBG_DDR_COMMON_IDX(ape_id, 34), u32_clock_offset);
            }
        }
        g_u32_case22_ape1_event1_tick = u32_clock_tick;
    }

    sfn_l  = get_tx_nr_sfn(scs);
    slot_l = get_tx_nr_slot(scs);
    if ((sfn != sfn_l) || (slot != slot_l))
    {
        g_u32_case22_ape1_event1_sfn_slot_err++;
        debug_write(DBG_DDR_COMMON_IDX(ape_id, 35), g_u32_case22_ape1_event1_sfn_slot_err);
        debug_write(DBG_DDR_COMMON_IDX(ape_id, 36), sfn);
        debug_write(DBG_DDR_COMMON_IDX(ape_id, 37), sfn_l);
        debug_write(DBG_DDR_COMMON_IDX(ape_id, 38), slot);
        debug_write(DBG_DDR_COMMON_IDX(ape_id, 39), slot_l);
    }

    /* 给本核event3发消息 */
    paddr = osp_alloc_msg(TEST_MSG_SIZE);
    if (NULL == paddr)
    {
        g_u32_case22_ape1_event1_alloc1_err++;
        debug_write(DBG_DDR_COMMON_IDX(ape_id, 40), g_u32_case22_ape1_event1_alloc1_err);
        return ;
    }

    do_write(paddr, g_u32_case22_ape1_event1_rev_num);
    do_write((paddr+4), 0xA001B002);

    ret = osp_send_msg((uint32_t)(paddr),
                        TEST_MSG_SIZE,
                        UCP4008_KERNEL_INNER,
                        ape_id,   // src que id
                        ape_id,   // dst que id
                        40,       // src task id
                        42);      // dst task id

    if (0 != ret)
    {
        g_u32_case22_ape1_event1_send1_err++;
        debug_write(DBG_DDR_COMMON_IDX(ape_id, 41), g_u32_case22_ape1_event1_send1_err);
        //return ;
    }

    /* 给其核event2发消息 */
    paddr = osp_alloc_msg(TEST_MSG_SIZE);
    if (NULL == paddr)
    {
        g_u32_case22_ape1_event1_alloc2_err++;
        debug_write(DBG_DDR_COMMON_IDX(ape_id, 42), g_u32_case22_ape1_event1_alloc2_err);
        return ;
    }

    do_write(paddr, g_u32_case22_ape1_event1_rev_num);
    do_write((paddr+4), 0xA001B002);

    ret = osp_send_msg((uint32_t)(paddr),
                        TEST_MSG_SIZE,
                        UCP4008_KERNEL_INTER,
                        ape_id,   // src que id
                        ape_id+1, // dst que id
                        40,       // src task id
                        41);      // dst task id

    if (0 != ret)
    {
        g_u32_case22_ape1_event1_send2_err++;
        debug_write(DBG_DDR_COMMON_IDX(ape_id, 43), g_u32_case22_ape1_event1_send2_err);
        return ;
    }

    /* 给ape3 event1发消息 */
    paddr = osp_alloc_msg(TEST_MSG_SIZE);
    if (NULL == paddr)
    {
        //g_u32_case21_ape1_event1_alloc2_err++;
        //debug_write(DBG_DDR_COMMON_IDX(ape_id, 42), g_u32_case21_ape1_event1_alloc2_err);
        return ;
    }

    do_write(paddr, g_u32_case22_ape1_event1_rev_num);
    do_write((paddr+4), 0xA001B002);

    ret = osp_send_msg((uint32_t)(paddr),
                        TEST_MSG_SIZE,
                        UCP4008_KERNEL_INTER,
                        ape_id,   // src que id
                        3,        // ape3
                        40,       // src task id
                        40);      // dst task id

    if (0 != ret)
    {
        //g_u32_case21_ape1_event1_send2_err++;
        //debug_write(DBG_DDR_COMMON_IDX(ape_id, 43), g_u32_case21_ape1_event1_send2_err);
        return ;
    }
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 44), ++g_u32_case22_ape1_event1_send_ok);
    return ;
}

/* 收到他核event1发来的消息 */
void ape1_event2_task(uint32_t addr, uint32_t size)
{
    uint32_t ape_id = get_core_id();
    g_u32_case22_ape1_event2_num++;

    debug_write(DBG_DDR_COMMON_IDX(ape_id, 45), g_u32_case22_ape1_event2_num);
    return ;
}

/* 收到本核event1发来的消息 */
void ape1_event3_task(uint32_t addr, uint32_t size)
{
    uint32_t ape_id = get_core_id();
    g_u32_case22_ape1_event3_num++;

    debug_write(DBG_DDR_COMMON_IDX(ape_id, 46), g_u32_case22_ape1_event3_num);
    return ;
}

/***************************************************************/
/*                  定时时任务相关打点                                  */
static uint32_t g_u32_case22_ape1_timer1_slot_no_continuous = 0; // 50 0xB7E002C8
static uint32_t g_u32_case22_ape1_timer1_sfn_no_continuous  = 0; // 51 0xB7E002CC
static uint32_t g_u32_case22_ape1_timer1_slot_indication    = 0; // 52 0xB7E002D0
static uint32_t g_u32_case22_ape1_timer1_update_sfn_slot    = 0; // 53 0xB7E002D4
static uint32_t g_u32_case22_ape1_timer1_process_cnt        = 0; // 54 0xB7E002D8
static uint32_t g_u32_case22_ape1_timer1_process_tick       = 0; // 55 0xB7E002DC
static uint32_t g_u32_case22_ape1_timer1_process_tick_err   = 0; // 56 0xB7E002E0
static uint32_t g_u32_case22_ape1_timer2_process_cnt        = 0; // 57 0xB7E002E4
static uint32_t g_u32_case22_ape1_timer2_process_tick       = 0; // 58 0xB7E002E8
static uint32_t g_u32_case22_ape1_timer2_process_tick_err   = 0; // 59 0xB7E002EC
static uint32_t g_u32_case22_ape1_timer2_tx_slot_max        = 0; // 64 0xB7E00300
static uint32_t g_u32_case22_ape1_timer2_tx_slot_min        = 0x32000;//65 0xB7E00304
static uint32_t g_u32_case22_ape1_timer2_tx_slot_cur        = 0; // 66 0xB7E00308
static uint32_t g_u32_case22_ape1_timer2_rx_slot_max        = 0; // 67 0xB7E0030C
static uint32_t g_u32_case22_ape1_timer2_rx_slot_min        = 0x32000; // 68 0xB7E00310
static uint32_t g_u32_case22_ape1_timer2_rx_slot_cur        = 0; // 69 0xB7E00314

static uint16_t gPreviousSlot = 0;
static uint16_t gCurrentSlot  = 0;
static uint8_t  gSlotFlagInit = 1;
static uint8_t  gSfnFlagInit  = 1;
static uint16_t gPreviousSfn  = 0;
static uint16_t gCurrentSfn   = 0;

static inline void check_continuous_slot(uint16_t slot)
{
    uint16_t delta = 0;
    uint32_t ape_id = get_core_id();

    if (gSlotFlagInit == 1)
    {
        gSlotFlagInit = 0;
        gCurrentSlot = slot;
    }
    else
    {
        gPreviousSlot = gCurrentSlot;
        gCurrentSlot = slot;
        delta = (SFN_SLOT_NUM_15K + gCurrentSlot - gPreviousSlot) % SFN_SLOT_NUM_15K;
        if (delta != 1)
        {
            debug_write(DBG_DDR_COMMON_IDX(ape_id, 50), ++g_u32_case22_ape1_timer1_slot_no_continuous);
        }
    }
    return;
}

static inline void check_continuous_sfn(uint16_t sfn)
{
    uint16_t delta = 0;
    uint32_t ape_id = get_core_id();

    if (gSfnFlagInit == 1)
    {
        gSfnFlagInit = 0;
        gCurrentSfn = sfn;
    }
    else
    {
        gPreviousSfn = gCurrentSfn;
        gCurrentSfn = sfn;
        delta = (1024 + gCurrentSfn - gPreviousSfn) % 1024;
        if (delta != 1) {
            debug_write(DBG_DDR_COMMON_IDX(ape_id, 51), ++g_u32_case22_ape1_timer1_sfn_no_continuous);
        }
    }
    return;
}

uint32_t gu32_ape1_send_cnt = 0;            //(61) 0xb7e002f4
static inline void send_slot_indication(void)
{
    uint16_t scs = LTE_SCS_ID;
    uint16_t sfn = get_tx_nr_sfn(scs);
    uint16_t slot = get_tx_nr_slot(scs);
    uint32_t value = (sfn << 16) + slot;
    uint32_t ape_id = get_core_id();

    uint32_t size = 8;
    char* buf;
    uint32_t availableSize,offset;

    uint16_t cu_flag = C_PLANE;//U_PLANE;
    HandleId_t handler;
    handler.port_id = get_ucp_port_id();
    handler.inst_id = 0;
    handler.type_id = CU_SPLIT;
    int32_t ret = msg_transfer_send_start(handler.value);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 60), handler.value);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 61), ++gu32_ape1_send_cnt);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 62), slot);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 63), 0xffff);

    ret = msg_transfer_alloc_msg(handler.value, cu_flag, size, &buf, &availableSize, &offset);
    if (SUCCESS != ret)
    {
        UCP_PRINT_ERROR("send_slot_indication C_PLANE ret[0x%08x]", ret);
        return;
    }
    uint32_t clockBegin;
    rdmcycle(&clockBegin);
    do_write(buf, value);
    do_write(buf+4, clockBegin);
    ret = msg_transfer_send_msg(handler.value, cu_flag, (uint8_t *)buf, offset, size);

    ret = msg_transfer_send_end(handler.value);

    debug_write(DBG_DDR_COMMON_IDX(ape_id, 52), ++g_u32_case22_ape1_timer1_slot_indication);

    return;
}

static inline void update_sfn_slot(void)
{
    uint32_t clockBegin;
    rdmcycle(&clockBegin);

    uint16_t scs = LTE_SCS_ID;//15KHz
    uint16_t sfn = get_tx_nr_sfn(scs);
    uint16_t slot = get_tx_nr_slot(scs);
    uint32_t ape_id = get_core_id();

    debug_write(DBG_DDR_COMMON_IDX(ape_id, 53), ++g_u32_case22_ape1_timer1_update_sfn_slot);
    UCP_PRINT_ERROR("ape[0x%x]:enter[%d], sfn[%d], slot[%d].", ape_id, g_u32_case22_ape1_timer1_update_sfn_slot, sfn, slot);

    check_continuous_slot(slot);

    if (slot == 0) {
        check_continuous_sfn(sfn);
    }

    return;
}


/* 定时点任务 */
void ape1_timer1_task(void)
{
    uint32_t ape_id = get_core_id();
    uint32_t clockTick   = 0;
    uint32_t clockOffset = 0;
    rdmcycle(&clockTick);

    debug_write(DBG_DDR_COMMON_IDX(ape_id, 54), ++g_u32_case22_ape1_timer1_process_cnt);

    update_sfn_slot();

    send_slot_indication();

    if (0 == g_u32_case22_ape1_timer1_process_tick)
    {
        g_u32_case22_ape1_timer1_process_tick = clockTick;
    }
    else
    {
        if (clockTick > g_u32_case22_ape1_timer1_process_tick)
        {
            clockOffset = clockTick - g_u32_case22_ape1_timer1_process_tick;
            if ((clockOffset > TIMER_OFFSET_MAX_15K) || (clockOffset < TIMER_OFFSET_MIN_15K))
            {
                g_u32_case22_ape1_timer1_process_tick_err++;
                debug_write(DBG_DDR_COMMON_IDX(ape_id, 55), clockOffset);
            }
        }
        g_u32_case22_ape1_timer1_process_tick = clockTick;
    }
    //debug_write(DBG_DDR_COMMON_IDX(ape_id, 55), g_u32_case20_ape1_timer1_process_tick);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 56), g_u32_case22_ape1_timer1_process_tick_err);
    return;
}

void ape1_timer2_task(void)
{
    uint32_t ape_id = get_core_id();
    uint32_t clockTick   = 0;
    uint32_t clockOffset = 0;
    rdmcycle(&clockTick);

    g_u32_case22_ape1_timer2_tx_slot_cur = get_tx_nr_slot_cycle();
    g_u32_case22_ape1_timer2_rx_slot_cur = get_rx_nr_slot_cycle();

    g_u32_case22_ape1_timer2_tx_slot_max = get_max(g_u32_case22_ape1_timer2_tx_slot_cur, g_u32_case22_ape1_timer2_tx_slot_max);
    g_u32_case22_ape1_timer2_tx_slot_min = get_min(g_u32_case22_ape1_timer2_tx_slot_cur, g_u32_case22_ape1_timer2_tx_slot_min);

    g_u32_case22_ape1_timer2_rx_slot_max = get_max(g_u32_case22_ape1_timer2_rx_slot_cur, g_u32_case22_ape1_timer2_rx_slot_max);
    g_u32_case22_ape1_timer2_rx_slot_min = get_min(g_u32_case22_ape1_timer2_rx_slot_cur, g_u32_case22_ape1_timer2_rx_slot_min);

    g_u32_case22_ape1_timer2_process_cnt++;
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 57), g_u32_case22_ape1_timer2_process_cnt);

    if (0 == g_u32_case22_ape1_timer2_process_tick)
    {
        g_u32_case22_ape1_timer2_process_tick = clockTick;
    }
    else
    {
        if (clockTick > g_u32_case22_ape1_timer2_process_tick)
        {
            clockOffset = clockTick - g_u32_case22_ape1_timer2_process_tick;
            if ((clockOffset > TIMER_OFFSET_MAX_15K) || (clockOffset < TIMER_OFFSET_MIN_15K))
            {
                g_u32_case22_ape1_timer2_process_tick_err++;
            }
        }
        g_u32_case22_ape1_timer2_process_tick = clockTick;
    }
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 58), g_u32_case22_ape1_timer2_process_tick);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 59), g_u32_case22_ape1_timer2_process_tick_err);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 64), g_u32_case22_ape1_timer2_tx_slot_max);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 65), g_u32_case22_ape1_timer2_tx_slot_min);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 66), g_u32_case22_ape1_timer2_tx_slot_cur);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 67), g_u32_case22_ape1_timer2_rx_slot_max);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 68), g_u32_case22_ape1_timer2_rx_slot_min);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 69), g_u32_case22_ape1_timer2_rx_slot_cur);

    return ;
}

/*************************************************************************/
/* 收到消息后创建任务 */
void ape1_event_task(uint32_t addr, uint32_t size)
{
    uint32_t ape_id = get_core_id();
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 29), 0x01010101);

    osp_task_info_ex ape1_task_event1 = {40, (int8_t*)"ape1_task_event1", 40, 2048, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape1_event1_task};
    osp_task_info_ex ape1_task_event2 = {41, (int8_t*)"ape1_task_event2", 41, 2048, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape1_event2_task};
    osp_task_info_ex ape1_task_event3 = {42, (int8_t*)"ape1_task_event3", 42, 2048, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape1_event3_task};
    osp_task_info_ex ape1_task_timer1 = {43, (int8_t*)"ape1_task_timer1", 43, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 0,   NULL, (OSP_TASKENTRY_FUNC)ape1_timer1_task};
    osp_task_info_ex ape1_task_timer2 = {44, (int8_t*)"ape1_task_timer2", 44, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 200, NULL, (OSP_TASKENTRY_FUNC)ape1_timer2_task};

    osp_task_create(&ape1_task_event1);
    osp_task_create(&ape1_task_event2);
    osp_task_create(&ape1_task_event3);
    osp_task_create(&ape1_task_timer1);
    osp_task_create(&ape1_task_timer2);

    osp_timer_sync(LTE_SCS_ID);

    debug_write(DBG_DDR_COMMON_IDX(ape_id, 29), 0x03030303);
    return;
}

/* 收到消息后删除任务 */
void ape1_event_task_del(uint32_t addr, uint32_t size)
{
    uint32_t ape_id = get_core_id();
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 29), 0x05050505);

    //osp_del_task_all(LTE_SCS_ID);

    debug_write(DBG_DDR_COMMON_IDX(ape_id, 29), 0x06060606);
    return;
}

