Download M3T-MR30 V.3.30 User`s Manual
Transcript
4.2 Development Procedure Example
59
#include <mr30.h>
#include "id.h"
void main() /* main task */
{
printf("LBP start simulation \n");
sta_tsk(ID_idle,1);
/* activate idle task */
sta_tsk(ID_image,1);
/* activate image expansion task */
sta_tsk(ID_printer,1); /* activate printer engine task */
}
void image() /* activate image expansion task */
{
while(1){
wai_flg(&flgptn,ID_pagein,waiptn,TWF_ANDW+TWF_CLR);/* wait for 1page input */
printf(" bit map expansion processing \n");
wup_tsk(ID_printer);
/* wake up printer engine task */
}
}
void printer() /* printer engine task */
{
while(1){
slp_tsk();
printf(" printer engine operation \n");
}
}
void sent_in() /* Centronics interface handler */
{
/* Process input from Centronics interface */
if ( /* 1-page input completed */ )
iset_flg(ID_pagein,setptn);
}
Figure 4.2
Program Example