/*------------------------------------------------------------------------------ MAIN.C: Main C function and program loop. Copyright 1995 KEIL Software, Inc. ------------------------------------------------------------------------------*/ #include #include #include "tdp.h" /*------------------------------------------------------------------------------ void main (void); This is the main C function. ------------------------------------------------------------------------------*/ void main (void) { unsigned i; /*------------------------------------------------ Do nothing for a few microseconds to let the power system stabalize. ------------------------------------------------*/ for (i = 0; i < 1000; i++); /* wait for 1000 counts */ /*------------------------------------------------ Initialize the timer tick ISR. Initialize the serial I/O ISR. ------------------------------------------------*/ timer0_initialize (); com_initialize (); /*------------------------------------------------ ------------------------------------------------*/ timer0_wait (TIMER0_TICKS_PER_SEC / 10); clock_init (); com_puts ("TDP V1.0\r\n"); /*------------------------------------------------ ------------------------------------------------*/ while (1) { const char *cmd; cmdb_init (); cmdb_prompt (); for (cmd = NULL; cmd == NULL; cmd = cmdb_scan ()) { clock_update (); } cmd_proc (cmd); } } /*------------------------------------------------------------------------------ ------------------------------------------------------------------------------*/