Renesas M3T-MR100 用户手册

下载
页码 304
   
- 208 - 
 #include <itron.h> 
 #include <kernel.h> 
 #include "kernel_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(ID_pagein,waiptn,TWF_ANDW, &flgptn);/* wait for 1-page 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 6.2 Program Example 
6.2.2 
Configuration File Preparation 
Create a configuration file which has defined in it the task entry address, stack size, etc. Use of the GUI configurator avail-
able for MR100 helps to create a configuration file easily without having to learn how to write it. 
  shows an example configuration file for a laser beam printer simulation program (filename "lbp.cfg").