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


#define TEST_PORT_ID    (0)
typedef struct SPU_SW_MSG_INFO1
{
    uint32_t u32DataLen;
    uint32_t u32PktType;
    uint32_t u32CoreId;    
    uint32_t u32MsgType;
}spu1_info_t;

uint32_t g_u32_case14_ape5_enter   = 0;
uint32_t g_u32_case14_ape5_sfn     = 0;
uint32_t g_u32_case14_ape5_slot    = 0;

void ape5_log_send_task()
{
    uint32_t ape_id = get_core_id();
    char  abuf2[256]   = {0};
    spu1_info_t sttest;
    
    sttest.u32DataLen  = 0xaabbccdd;
    sttest.u32PktType  = 0x01020304;
    sttest.u32CoreId   = 0x05060708;
    sttest.u32MsgType  = 0x090a0b0c;

    sprintf(abuf2,"ape[0x%x]:enter[%d], sfn[%d], slot[%d].\n", ape_id, g_u32_case14_ape5_enter++, g_u32_case14_ape5_sfn++, g_u32_case14_ape5_slot++);

    delay_us(50);

    SPU_VPRINTF_LOG(LOG_ERROR, "ape[0x%x]:enter[%d], sfn[%d], slot[%d].\n", ape_id, g_u32_case14_ape5_enter, g_u32_case14_ape5_sfn, g_u32_case14_ape5_slot);
    //osp_sendLog(0, abuf2, strlen(abuf2), 0);
    //osp_sendLog_print(0, (char *)&sttest, sizeof(spu1_info_t), 0);

    debug_write(DBG_DDR_COMMON_IDX(ape_id, 70), g_u32_case14_ape5_enter);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 71), g_u32_case14_ape5_sfn);
    debug_write(DBG_DDR_COMMON_IDX(ape_id, 72), g_u32_case14_ape5_slot);

    return;
}
