// +FHDR------------------------------------------------------------
//                 Copyright (c) 2022 SmartLogic.
//                       ALL RIGHTS RESERVED
// -----------------------------------------------------------------
// Filename      : ape_test_case1.s.c
// Author        : 
// Created On    : 2022-10-26
// Last Modified :
// -----------------------------------------------------------------
// Description:
//
//
// -FHDR------------------------------------------------------------

#include "typedef.h"
#include "osp_task.h"
#include "osp_timer.h"
#include "ucp_printf.h"


void ape0_event_task(uint32_t addr, uint32_t size);
void ape0_event_task_del(uint32_t addr, uint32_t size);

void ape0_test_task_reg(void)
{
    osp_task_info_ex ape0_event_task_info = {50, (int8_t*)"ape0_event_task", 50, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape0_event_task};
    osp_task_info_ex ape0_event_task_info_del = {51, (int8_t*)"ape0_event_task_del", 51, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape0_event_task_del};

    osp_task_create(&ape0_event_task_info);
    osp_task_create(&ape0_event_task_info_del);

    return ;
}

/************************************************************************/
void ape1_event_task(uint32_t addr, uint32_t size);
void ape1_event_task_del(uint32_t addr, uint32_t size);

void ape1_test_task_reg(void)
{
    osp_task_info_ex ape1_event_task_info = {50, (int8_t*)"ape1_event_task", 50, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape1_event_task};
    osp_task_info_ex ape1_event_task_info_del = {51, (int8_t*)"ape1_event_task_del", 51, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape1_event_task_del};

    osp_task_create(&ape1_event_task_info);
    osp_task_create(&ape1_event_task_info_del);

    return ;
}

/************************************************************************/
void ape2_event_task(uint32_t addr, uint32_t size);
void ape2_event_task_del(uint32_t addr, uint32_t size);

void ape2_test_task_reg(void)
{
    osp_task_info_ex ape2_event_task_info = {50, (int8_t*)"ape2_event_task", 50, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape2_event_task};
    osp_task_info_ex ape2_event_task_info_del = {51, (int8_t*)"ape2_event_task_del", 51, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape2_event_task_del};

    osp_task_create(&ape2_event_task_info);
    osp_task_create(&ape2_event_task_info_del);

    return ;
}

/************************************************************************/
void ape3_event_task(uint32_t addr, uint32_t size);
void ape3_event_task_del(uint32_t addr, uint32_t size);

void ape3_test_task_reg(void)
{
    osp_task_info_ex ape3_event_task_info = {50, (int8_t*)"ape3_event_task", 50, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape3_event_task};
    osp_task_info_ex ape3_event_task_info_del = {51, (int8_t*)"ape3_event_task_del", 51, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape3_event_task_del};

    osp_task_create(&ape3_event_task_info);
    osp_task_create(&ape3_event_task_info_del);

    return ;
}

/************************************************************************/
void ape4_event_task(uint32_t addr, uint32_t size);
void ape4_event_task_del(uint32_t addr, uint32_t size);

void ape4_test_task_reg(void)
{
    osp_task_info_ex ape4_event_task_info = {50, (int8_t*)"ape4_event_task", 50, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape4_event_task};
    osp_task_info_ex ape4_event_task_info_del = {51, (int8_t*)"ape4_event_task_del", 51, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape4_event_task_del};

    osp_task_create(&ape4_event_task_info);
    osp_task_create(&ape4_event_task_info_del);

    return ;
}

/************************************************************************/
void ape5_event_task(uint32_t addr, uint32_t size);
void ape5_event_task_del(uint32_t addr, uint32_t size);

void ape5_test_task_reg(void)
{
    osp_task_info_ex ape5_event_task_info = {50, (int8_t*)"ape5_event_task", 50, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape5_event_task};
    osp_task_info_ex ape5_event_task_info_del = {51, (int8_t*)"ape5_event_task_del", 51, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape5_event_task_del};

    osp_task_create(&ape5_event_task_info);
    osp_task_create(&ape5_event_task_info_del);

    return ;
}

/************************************************************************/
void ape6_event_task(uint32_t addr, uint32_t size);
void ape6_event_task_del(uint32_t addr, uint32_t size);

void ape6_test_task_reg(void)
{
    osp_task_info_ex ape6_event_task_info = {50, (int8_t*)"ape6_event_task", 50, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape6_event_task};
    osp_task_info_ex ape6_event_task_info_del = {51, (int8_t*)"ape6_event_task_del", 51, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape6_event_task_del};

    osp_task_create(&ape6_event_task_info);
    osp_task_create(&ape6_event_task_info_del);

    return ;
}

/************************************************************************/
void ape7_event_task(uint32_t addr, uint32_t size);
void ape7_event_task_del(uint32_t addr, uint32_t size);

void ape7_test_task_reg(void)
{
    osp_task_info_ex ape7_event_task_info = {50, (int8_t*)"ape7_event_task", 50, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape7_event_task};
    osp_task_info_ex ape7_event_task_info_del = {51, (int8_t*)"ape7_event_task_del", 51, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape7_event_task_del};

    osp_task_create(&ape7_event_task_info);
    osp_task_create(&ape7_event_task_info_del);

    return ;
}

#if 0
void ape0_test_task_reg(void)
{
    osp_task_info_ex ape0_task_event1 = {40, (int8_t*)"ape0_task_event1", 40, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape0_event1_task};
    osp_task_info_ex ape0_task_event2 = {41, (int8_t*)"ape0_task_event2", 41, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape0_event2_task};
    osp_task_info_ex ape0_task_event3 = {42, (int8_t*)"ape0_task_event3", 42, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape0_event3_task};
    osp_task_info_ex ape0_task_timer1 = {43, (int8_t*)"ape0_task_timer1", 43, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 0,   NULL, (OSP_TASKENTRY_FUNC)ape0_timer1_task};
    osp_task_info_ex ape0_task_timer2 = {44, (int8_t*)"ape0_task_timer2", 44, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 200, NULL, (OSP_TASKENTRY_FUNC)ape0_timer2_task};
    //osp_task_info_ex ape0_task_loop   = {46, (int8_t*)"ape0_task_loop",   46, 2048, OSP_NORMAL_TYPE, 10, 0,   0,   NULL, (OSP_TASKENTRY_FUNC)ape0_loop_task};

    osp_task_create(&ape0_task_event1);
    osp_task_create(&ape0_task_event2);
    osp_task_create(&ape0_task_event3);
    osp_task_create(&ape0_task_timer1);
    osp_task_create(&ape0_task_timer2);
    //osp_task_create(&ape0_task_loop);

    osp_timer_sync(1);
    return;
}

/************************************************************************/
void ape1_event1_task(uint32_t addr, uint32_t size);
void ape1_event2_task(uint32_t addr, uint32_t size);
void ape1_event3_task(uint32_t addr, uint32_t size);
void ape1_timer1_task(void);
void ape1_timer2_task(void);

/* 任务优先级：event1 > event2 > event3 > timer1 > timer2 */
void ape1_test_task_reg(void)
{
    osp_task_info_ex ape1_task_event1 = {40, (int8_t*)"ape1_task_event1", 40, 1024, 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, 1024, 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, 1024, 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(1);
    return;
}

/************************************************************************/
void ape2_event1_task(uint32_t addr, uint32_t size);
void ape2_event2_task(uint32_t addr, uint32_t size);
void ape2_event3_task(uint32_t addr, uint32_t size);
void ape2_timer1_task(void);
void ape2_timer2_task(void);

/* 任务优先级：event1 > event2 > event3 > timer1 > timer2 */
void ape2_test_task_reg(void)
{
    osp_task_info_ex ape2_task_event1 = {40, (int8_t*)"ape2_task_event1", 40, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape2_event1_task};
    osp_task_info_ex ape2_task_event2 = {41, (int8_t*)"ape2_task_event2", 41, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape2_event2_task};
    osp_task_info_ex ape2_task_event3 = {42, (int8_t*)"ape2_task_event3", 42, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape2_event3_task};
    osp_task_info_ex ape2_task_timer1 = {43, (int8_t*)"ape2_task_timer1", 43, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 0,   NULL, (OSP_TASKENTRY_FUNC)ape2_timer1_task};
    osp_task_info_ex ape2_task_timer2 = {44, (int8_t*)"ape2_task_timer2", 44, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 200, NULL, (OSP_TASKENTRY_FUNC)ape2_timer2_task};

    osp_task_create(&ape2_task_event1);
    osp_task_create(&ape2_task_event2);
    osp_task_create(&ape2_task_event3);
    osp_task_create(&ape2_task_timer1);
    osp_task_create(&ape2_task_timer2);

    osp_timer_sync(1);
    return;
}

/************************************************************************/
void ape3_event1_task(uint32_t addr, uint32_t size);
void ape3_event2_task(uint32_t addr, uint32_t size);
void ape3_event3_task(uint32_t addr, uint32_t size);
void ape3_timer1_task(void);
void ape3_timer2_task(void);

/* 任务优先级：event1 > event2 > event3 > timer1 > timer2 */
void ape3_test_task_reg(void)
{
    osp_task_info_ex ape3_task_event1 = {40, (int8_t*)"ape3_task_event1", 40, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape3_event1_task};
    osp_task_info_ex ape3_task_event2 = {41, (int8_t*)"ape3_task_event2", 41, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape3_event2_task};
    osp_task_info_ex ape3_task_event3 = {42, (int8_t*)"ape3_task_event3", 42, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape3_event3_task};
    osp_task_info_ex ape3_task_timer1 = {43, (int8_t*)"ape3_task_timer1", 43, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 0,   NULL, (OSP_TASKENTRY_FUNC)ape3_timer1_task};
    osp_task_info_ex ape3_task_timer2 = {44, (int8_t*)"ape3_task_timer2", 44, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 200, NULL, (OSP_TASKENTRY_FUNC)ape3_timer2_task};

    osp_task_create(&ape3_task_event1);
    osp_task_create(&ape3_task_event2);
    osp_task_create(&ape3_task_event3);
    osp_task_create(&ape3_task_timer1);
    osp_task_create(&ape3_task_timer2);

    osp_timer_sync(1);
    return;
}

/************************************************************************/
void ape4_event1_task(uint32_t addr, uint32_t size);
void ape4_event2_task(uint32_t addr, uint32_t size);
void ape4_event3_task(uint32_t addr, uint32_t size);
void ape4_timer1_task(void);
void ape4_timer2_task(void);

/* 任务优先级：event1 > event2 > event3 > timer1 > timer2 */
void ape4_test_task_reg(void)
{
    osp_task_info_ex ape4_task_event1 = {40, (int8_t*)"ape4_task_event1", 40, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape4_event1_task};
    osp_task_info_ex ape4_task_event2 = {41, (int8_t*)"ape4_task_event2", 41, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape4_event2_task};
    osp_task_info_ex ape4_task_event3 = {42, (int8_t*)"ape4_task_event3", 42, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape4_event3_task};
    osp_task_info_ex ape4_task_timer1 = {43, (int8_t*)"ape4_task_timer1", 43, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 0,   NULL, (OSP_TASKENTRY_FUNC)ape4_timer1_task};
    osp_task_info_ex ape4_task_timer2 = {44, (int8_t*)"ape4_task_timer2", 44, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 200, NULL, (OSP_TASKENTRY_FUNC)ape4_timer2_task};

    osp_task_create(&ape4_task_event1);
    osp_task_create(&ape4_task_event2);
    osp_task_create(&ape4_task_event3);
    osp_task_create(&ape4_task_timer1);
    osp_task_create(&ape4_task_timer2);

    osp_timer_sync(1);
    return ;
}

/************************************************************************/
void ape5_event1_task(uint32_t addr, uint32_t size);
void ape5_event2_task(uint32_t addr, uint32_t size);
void ape5_event3_task(uint32_t addr, uint32_t size);
void ape5_timer1_task(void);
void ape5_timer2_task(void);

/* 任务优先级：event1 > event2 > event3 > timer1 > timer2 */
void ape5_test_task_reg(void)
{
    osp_task_info_ex ape5_task_event1 = {40, (int8_t*)"ape5_task_event1", 40, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape5_event1_task};
    osp_task_info_ex ape5_task_event2 = {41, (int8_t*)"ape5_task_event2", 41, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape5_event2_task};
    osp_task_info_ex ape5_task_event3 = {42, (int8_t*)"ape5_task_event3", 42, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape5_event3_task};
    osp_task_info_ex ape5_task_timer1 = {43, (int8_t*)"ape5_task_timer1", 43, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 0,   NULL, (OSP_TASKENTRY_FUNC)ape5_timer1_task};
    osp_task_info_ex ape5_task_timer2 = {44, (int8_t*)"ape5_task_timer2", 44, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 200, NULL, (OSP_TASKENTRY_FUNC)ape5_timer2_task};

    osp_task_create(&ape5_task_event1);
    osp_task_create(&ape5_task_event2);
    osp_task_create(&ape5_task_event3);
    osp_task_create(&ape5_task_timer1);
    osp_task_create(&ape5_task_timer2);

    osp_timer_sync(1);
    return ;
}

/************************************************************************/
void ape6_event1_task(uint32_t addr, uint32_t size);
void ape6_event2_task(uint32_t addr, uint32_t size);
void ape6_event3_task(uint32_t addr, uint32_t size);
void ape6_timer1_task(void);
void ape6_timer2_task(void);

/* 任务优先级：event1 > event2 > event3 > timer1 > timer2 */
void ape6_test_task_reg(void)
{
    osp_task_info_ex ape6_task_event1 = {40, (int8_t*)"ape6_task_event1", 40, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape6_event1_task};
    osp_task_info_ex ape6_task_event2 = {41, (int8_t*)"ape6_task_event2", 41, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape6_event2_task};
    osp_task_info_ex ape6_task_event3 = {42, (int8_t*)"ape6_task_event3", 42, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape6_event3_task};
    osp_task_info_ex ape6_task_timer1 = {43, (int8_t*)"ape6_task_timer1", 43, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 0,   NULL, (OSP_TASKENTRY_FUNC)ape6_timer1_task};
    osp_task_info_ex ape6_task_timer2 = {44, (int8_t*)"ape6_task_timer2", 44, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 200, NULL, (OSP_TASKENTRY_FUNC)ape6_timer2_task};

    osp_task_create(&ape6_task_event1);
    osp_task_create(&ape6_task_event2);
    osp_task_create(&ape6_task_event3);
    osp_task_create(&ape6_task_timer1);
    osp_task_create(&ape6_task_timer2);

    osp_timer_sync(1);
    return ;
}

/************************************************************************/
void ape7_event1_task(uint32_t addr, uint32_t size);
void ape7_event2_task(uint32_t addr, uint32_t size);
void ape7_event3_task(uint32_t addr, uint32_t size);
void ape7_timer1_task(void);
void ape7_timer2_task(void);

/* 任务优先级：event1 > event2 > event3 > timer1 > timer2 */
void ape7_test_task_reg(void)
{
    osp_task_info_ex ape7_task_event1 = {40, (int8_t*)"ape7_task_event1", 40, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape7_event1_task};
    osp_task_info_ex ape7_task_event2 = {41, (int8_t*)"ape7_task_event2", 41, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape7_event2_task};
    osp_task_info_ex ape7_task_event3 = {42, (int8_t*)"ape7_task_event3", 42, 1024, OSP_EVENT_TYPE, 0, 0,     0,   NULL, (OSP_TASKENTRY_FUNC)ape7_event3_task};
    osp_task_info_ex ape7_task_timer1 = {43, (int8_t*)"ape7_task_timer1", 43, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 0,   NULL, (OSP_TASKENTRY_FUNC)ape7_timer1_task};
    osp_task_info_ex ape7_task_timer2 = {44, (int8_t*)"ape7_task_timer2", 44, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 200, NULL, (OSP_TASKENTRY_FUNC)ape7_timer2_task};

    osp_task_create(&ape7_task_event1);
    osp_task_create(&ape7_task_event2);
    osp_task_create(&ape7_task_event3);
    osp_task_create(&ape7_task_timer1);
    osp_task_create(&ape7_task_timer2);

    osp_timer_sync(1);
    return ;
}
#endif

