/*测试非唤醒源软timer申请和加入链表,LOOP模式,执行一段时间后在回调函数外delete*/
s32 st_softtimer_test_case14(void)
{
	s32 ret=0;
	
	my_softtimer.func = for_softtimer_test_8;
	my_softtimer.para = 123;
	my_softtimer.timeout = 1;
	my_softtimer.wake_type=SOFTTIMER_NOWAKE;
	
	if (bsp_softtimer_create(&my_softtimer))
	{
		bsp_trace(BSP_LOG_LEVEL_ERROR,BSP_MODU_SOFTTIMER,"create error\n");
		return ERROR;
	}
	bsp_softtimer_add(&my_softtimer);
	delay(200);
	ret = bsp_softtimer_delete_sync(&my_softtimer);
	if(OK!=ret)
	{
		bsp_trace(BSP_LOG_LEVEL_ERROR,BSP_MODU_SOFTTIMER,"bsp_softtimer_delete_sync failed\n");
		return ERROR;
	}
	ret = bsp_softtimer_free(&my_softtimer);
	 if (ret !=OK)
	 {
	 	bsp_trace(BSP_LOG_LEVEL_ERROR,BSP_MODU_SOFTTIMER,"st_softtimer_test_case16  free error\n");
		return ERROR;
	 }
	 
	 return OK;
}
s32 edma2_stress_test_stop()
{
    set_test_switch_stat(EDMAC, TEST_STOP);

    while(OK == taskIdVerify(g_edma2_busstress_info.edma_stress_test_task_id))
    {
        taskDelay(100);
    }

    if (NULL != g_edma2_busstress_info.edma_send_sem)
    {
        /*sema_delete(g_edma2_busstress_info.edma_send_sem);*/
        semDelete(g_edma2_busstress_info.edma_send_sem);
    }


    bsp_softtimer_delete_sync(&g_edma2_busstress_info.edma_softtimer_list);
    bsp_softtimer_free(&g_edma2_busstress_info.edma_softtimer_list);

    cacheDmaFree(g_edma2_busstress_info.stDMATaskHandle[0].u32SrcAddr);
    cacheDmaFree(g_edma2_busstress_info.stDMATaskHandle[0].u32DstAddr);
    cacheDmaFree(g_edma2_busstress_info.stDMATaskHandle[1].u32SrcAddr);
    cacheDmaFree(g_edma2_busstress_info.stDMATaskHandle[3].u32DstAddr);
    return OK;
}
int bsp_om_stop_timer(struct softtimer_list *timer)
{
    int ret = BSP_OK;
    if( timer->init_flags == TIMER_INIT_FLAG)
    {
        ret =  bsp_softtimer_delete_sync(timer);

        if(ret < 0)
        {
            bsp_om_debug(BSP_LOG_LEVEL_ERROR, "bsp om stop timer fail \n");
			return ret;
        }
    }

    return BSP_OK;
}
/*在case15或case16运行的情况下运行本测试用例,测试是否可以删除多个定时器*/
s32 st_softtimer_test_case17(void)
{
    int i = 0;
    int ret;
    while(i<31)
    {
		ret = bsp_softtimer_delete_sync(&myown_timer[i]);
	 	if(OK!=ret)
	 	{
			bsp_trace(BSP_LOG_LEVEL_ERROR,BSP_MODU_SOFTTIMER,"bsp_softtimer_delete_sync failed\n");
			return ERROR;
	 	}
	 	ret = bsp_softtimer_free(&myown_timer[i]);
	  	if(OK!=ret)
	 	{
			bsp_trace(BSP_LOG_LEVEL_ERROR,BSP_MODU_SOFTTIMER,"bsp_softtimer_free failed\n");
			return ERROR;
	 	}
	 	i++;
    }
    return OK;
}