■ ex3-2.c
|
#include <t_services.h> #define PB_DDR (*(volatile unsigned char *)0xFFFFD4) #define PA_DDR (*(volatile unsigned char *)0xFFFFD1) unsigned char Led = 0xFF; PB_DDR = 0xFF; PB_DR &= ~0x1; // PB0点灯 void task2(VP_INT exinf) // LED点滅タスク while(1) PB_DR &= ~0x2; // PB0点灯 |
■ex3-2.cfg
|
#define _MACRO_ONLY INCLUDE("\"ex3-2.h\""); CRE_TSK(TASK1, { TA_HLNG|TA_ACT, (VP_INT)0, task1, HIGH_PRIORITY,
STACK_SIZE, NULL }); #include "../../systask/timer.cfg" |
■ex3-2.h
|
#include <t_services.h> /* 各タスクの優先度の定義*/ #undef CPUEXC1 /* CPU例外ハンドラをサポートしない */ #ifndef TASK_PORTID #ifndef STACK_SIZE #ifndef LOOP_REF /* 関数のプロトタイプ宣言 */ extern void task1(VP_INT exinf); #endif /* _MACRO_ONLY */ |