#include "Dbug12.h" #include #define NUM_TASKS 3 /* A global variable to hold the task enable flags */ unsigned char interrupt_pattern=0; /* A global variable incremented by the idle() function */ long int idle_count=0; void RTI_handler(void) { /* Do NOT modify this function! */ static short int countdown=3; if( countdown == 3 ) interrupt_pattern |= 3; else interrupt_pattern |= (countdown & 1); if(--countdown < 0 ) countdown = 3; RTIFLG = 0x80; } void IRQ_handler(void) { /* Your IRQ button task code goes here. * Your code must set bit 2 (...bit3:bit2:bit1:bit0) of the * global variable interrupt_pattern to '1' * without altering any other bits. */ } void func0(void) { /* your code for task 0 goes here */ } void func1(void) { /* your code for task 1 goes here */ } void func2(void) { /* your code for task 2 goes here */ } void idle(void) { /* your code for the "idle" task goes here */ } void main(void) { /* Declare an array named "func_table" to contain * NUM_TASKS pointers to functions with no return and no arguments. */ /* Assign the pointers in func_table to be the function * addresses func0, func1, and func2 */ /* Do your initializations, enable interrupts, activate ports, etc. * Make the IRQ interrupt edge triggered */ /* Insert your task test code here. * */ _asm("SWI"); } /* end of main() */