home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s270 / 1.ddi / PCKDD51B.EXE / F_INNER.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-15  |  687 b   |  29 lines

  1. /* File:  f_inner.c */
  2.  
  3. #include <stdio.h>
  4.  
  5. /* external function prototypes (interface specifications) */
  6. extern void    wastetime(void);
  7.  
  8. /* external variables */
  9. extern char        state;    /* 'state' reflects value in ACC (in original demo.asm) */
  10.  
  11. sbit P1_0 = 0x90;    /* P1.0 */
  12.  
  13. void innerloop( char repeat_cnt )
  14. {
  15.     static char    i;
  16.     
  17.     for ( i = 0;  i < repeat_cnt;  i++ ) {
  18.         wastetime();
  19.         if (P1_0)            /* 'CPL P1.0':  */
  20.             P1_0 = 0;            /* if P1.0 on,  clear P1.0 */
  21.         else
  22.             P1_0 = 1;            /* if P1.0 off, set   P1.0 */
  23.         state = 0;
  24.         if ( P1_0 )
  25.             state = (state) ? 0 : 1;    /* 'CPL A' */
  26.         } /* end of:  for 'i' */
  27.  
  28. } /* end of function:  'innerloop( repeat_cnt )' */
  29.