#include "interrupt.h" /*--------------------------------------------- 外部中断0中断服务程序 ----------------------------------------------*/ HotISR EInt0_ISR() HotTask_ISR(HOTISR_IE0_VECTOR, AR1) { HotIsr_return(HOTISR_IE0_VECTOR);//中断隐身到后台处理 }
/*--------------------------------------------- 外部中断1中断服务程序 ----------------------------------------------*/ HotISR EInt1_ISR() HotTask_ISR(HOTISR_IE1_VECTOR, AR1) { HotIsr_return(HOTISR_IE1_VECTOR);//中断隐身到后台处理 }
/*------------------------------------------ 定时器T0中断服务程序 -------------------------------------------*/ HotISR Timer0_ISR() HotTask_ISR(HOTISR_TF0_VECTOR, AR1) { HotIsr_return(HOTISR_TF0_VECTOR);//中断隐身到后台处理 }
/*------------------------------------------ 定时器T1中断服务程序 -------------------------------------------*/ HotISR Timer1_ISR() HotTask_ISR(HOTISR_TF1_VECTOR, AR1) { HotIsr_return(HOTISR_TF1_VECTOR);//中断隐身到后台处理 }
/*---------------------------------------- 串口中断服务程序 -----------------------------------------*/ HotISR SIO_ISR() HotTask_ISR(HOTISR_SIO_VECTOR, AR1) { HotIsr_return(HOTISR_SIO_VECTOR);//中断隐身到后台处理 }
#include "task.h"
/*--------------------------------------------- HotTask51装载任务处理程序 ----------------------------------------------*/ HotTASK TaskInit() HotTask_TASK(HOTTASK0_VECTOR, AR3) { HRESULT __result = S_FALSE;//失败 __result = HotTaskCreate(HotTask_TaskId1,//任务1 Task1,//任务函数1 7//2级 ); if (__result == S_OK) { __result = HotTaskCreate(HotTask_TaskId2,//任务2 Task2,//任务函数2 7//6级 ); if (__result == S_OK) { __result = HotTaskCreate(HotTask_TaskId3,//任务3 Task2,//任务函数2 7//2级 ); } } }
/*-------------------------------------------------------- HotTask51任务Task1处理程序 ---------------------------------------------------------*/ HotTASK Task1() HotTask_TASK(HOTTASK1_VECTOR, AR3) { HotTask_while(HotTask_TaskId1)//HotTask51任务环格式 { HotTaskWait(HotTask_TaskId1, 1); } }
/*-------------------------------------------------------- HotTask51任务Task2处理程序 ---------------------------------------------------------*/ HotTASK Task2() HotTask_TASK(HOTTASK2_VECTOR, AR3) { HotTask_while(HotTask_TaskId2)//HotTask51任务环格式 { // HotTaskTickUnLock(HotTask_TaskId2); } }
/*-------------------------------------------------------- HotTask51任务Task3处理程序 ---------------------------------------------------------*/ HotTASK Task3() HotTask_TASK(HOTTASK3_VECTOR, AR3) { HotTask_while(HotTask_TaskId3)//HotTask51任务环格式 { _nop_(); _nop_(); _nop_(); } }
/*-------------------------------------------------------- HotTask51任务Task4处理程序 ---------------------------------------------------------*/ HotTASK Task4() HotTask_TASK(HOTTASK4_VECTOR, AR3) { HotTask_while(HotTask_TaskId4)//HotTask51任务环格式 { _nop_(); _nop_(); _nop_(); } }
/*-------------------------------------------------------- HotTask51任务Task5处理程序 ---------------------------------------------------------*/ HotTASK Task5() HotTask_TASK(HOTTASK5_VECTOR, AR3) { HotTask_while(HotTask_TaskId5)//HotTask51任务环格式 { } }
/*-------------------------------------------------------- HotTask51任务Task6处理程序 ---------------------------------------------------------*/ HotTASK Task6() HotTask_TASK(HOTTASK6_VECTOR, AR3) { HotTask_while(HotTask_TaskId6)//HotTask51任务环格式 { _nop_(); _nop_(); _nop_(); } }
/*-------------------------------------------------------- HotTask51任务Task7处理程序 ---------------------------------------------------------*/ HotTASK Task7() HotTask_TASK(HOTTASK7_VECTOR, AR3) { HotTask_while(HotTask_TaskId7)//HotTask51任务环格式 { _nop_(); _nop_(); _nop_(); } }
#include "event.h" /*--------------------------------------------- 外部中断0事件处理程序 ----------------------------------------------*/ HotEVENT EInt0_EVT() HotTask_EVT(HOTEVENT_IE0_VECTOR, AR0) { } /*--------------------------------------------- 外部中断1事件处理程序 ----------------------------------------------*/ HotEVENT EInt1_EVT() HotTask_EVT(HOTEVENT_IE1_VECTOR, AR0) { } /*------------------------------------------ 定时器T0事件处理程序 -------------------------------------------*/ HotEVENT Timer0_EVT() HotTask_EVT(HOTEVENT_TF0_VECTOR, AR0) { }
/*------------------------------------------ 定时器T1事件处理程序 -------------------------------------------*/ HotEVENT Timer1_EVT() HotTask_EVT(HOTEVENT_TF1_VECTOR, AR0) { }
/*---------------------------------------- 串口事件处理程序 -----------------------------------------*/ HotEVENT SIO_EVT() HotTask_EVT(HOTEVENT_SIO_VECTOR, AR0) { }
|