/* * Title : main.c * Description : Main routine * Author : KAWAMOTO Yasuhisa * URL : http://www.devdrv.co.jp/ * Date : 01/13/2006 */ //----------------------------------------------------------------------------- // Includes //----------------------------------------------------------------------------- #include #include "main.h" //----------------------------------------------------------------------------- // MAIN Routine //----------------------------------------------------------------------------- void main(void) { unsigned char result; init_f330(); EA = 1; #ifdef DEBUG while(DCD); #endif LastDeviceFlag = 1; do { if(LastDeviceFlag == 1) result = OWFirst(); else result = OWNext(); if(result) { if(ROMCode[0] == 0x10) init_ds1820(); else if(ROMCode[0] == 0x22) init_ds1822(); else if(ROMCode[0] == 0x26) init_ds2438(); } }while(!LastDeviceFlag); while(TRUE) { while(DCD); LastDeviceFlag = 1; tmr2_count = 0; RTS = 0; while(!DCD) { while(tmr2_count < ROUNDRATE/TIMER2RATE); tmr2_count = 0; if(LastDeviceFlag == 1) result = OWFirst(); else result = OWNext(); if(result) { if(ROMCode[0] == 0x10) ds1820(); else if(ROMCode[0] == 0x22) ds1822(); else if(ROMCode[0] == 0x26) ds2438(); } } } }