home *** CD-ROM | disk | FTP | other *** search
- /* File: f_inner.c */
-
- #include <stdio.h>
-
- /* external function prototypes (interface specifications) */
- extern void wastetime(void);
-
- /* external variables */
- extern char state; /* 'state' reflects value in ACC (in original demo.asm) */
-
- sbit P1_0 = 0x90; /* P1.0 */
-
- void innerloop( char repeat_cnt )
- {
- static char i;
-
- for ( i = 0; i < repeat_cnt; i++ ) {
- wastetime();
- if (P1_0) /* 'CPL P1.0': */
- P1_0 = 0; /* if P1.0 on, clear P1.0 */
- else
- P1_0 = 1; /* if P1.0 off, set P1.0 */
- state = 0;
- if ( P1_0 )
- state = (state) ? 0 : 1; /* 'CPL A' */
- } /* end of: for 'i' */
-
- } /* end of function: 'innerloop( repeat_cnt )' */
-