
/**********************************************************       

   PSFLASH.C

   Protocol Switch 

   Flash lights on Protocol Switch, LD1 has I/O address, LD2 controlled
   by PIOB_2.

********************************************************** */

/* the following are already defined in scc232.lib
#define PIODB_2 0x91
#define PIOCB_2 0x93
#define LD1 0xD0
*/

main()
{
   int k;

   outport(PIOCB_2, 0xcf);            /* PIO port 2B mode 3, bitwise I/O */
   outport(PIOCB_2, 0x00);            /* all lines are output */
   outport(PIOCB_2, 0x03);            /* disable interrupts */
   
   while(1)
   {
      /* flash LD1 & LD2 on Protocol Switch board  */

      for(k = 0; k < 5000; k++) hitwd();            /* about a 1000 ms delay */
      outport(PIODB_2, 0);                  /* turn on LD2(red) */
      outport(LD1, 0);                      /* turn off LD1(amber) */
      
      for(k = 0; k < 5000; k++) hitwd();
      outport(PIODB_2, 1);                  /* turn off LD2 */
      outport(LD1, 1);                      /* turn on LD1 */
   }
}

/*******************************************End of PSFLASH.C *******/
