BOOL openBLKDEV(void) 
{ 
	unsigned int delay;
	/* --------------------------------------------------------------
	 *
	 * eventIODeviceOpen - 
	 *
	 * open the LED driver node...
	 * 
	 * --------------------------------------------------------------
	 */

	blkdev_task1 = eventIODeviceOpen(&blkdev_task1,DEVICE_BLOCK_EMPOSII,1);
	ublkdev_task1 = blkdev_task1->uid;

	/* check the UID .................. */

	switch (ublkdev_task1) 
	{
		case DEVICE_IN_USE:
		case DEVICE_UNKNOWN:
			return FALSE;
	} 

	return TRUE; 
}
Example #2
0
BOOL openLED(void) 
{ 
unsigned int delay;
/* --------------------------------------------------------------
 *
 * eventIODeviceOpen - 
 *
 * open the LED driver node...
 * 
 * --------------------------------------------------------------
 */

led_host = eventIODeviceOpen(&led,DEVICE_LED_LDS2000,LED);


  /* check that a device driver is found ... */

  
  if (led_host==0) {
    while (1) 
    {
    delay=0xBEEF0401;
    };
  return FALSE;
  }
  
  	
return TRUE; 
}
BOOL openOrangeLED (void) 
{ 

/* --------------------------------------------------------------
 * eventIODeviceOpen - 
 * open the LED driver node...
 * --------------------------------------------------------------
 */

orange_host = eventIODeviceOpen(&oled,DEVICE_LED_E7T,ORANGE);

  /* check that a device driver is found ... */

  if (orange_host==0) {return FALSE;}

  /* check the UID .................. */

  switch (oled) 
  {
  case DEVICE_IN_USE:
  case DEVICE_UNKNOWN:

	return FALSE;
  } 
  	
return TRUE; 
}
Example #4
0
BOOL openYellowLED (void) 
{ 
/* --------------------------------------------------------------
 *
 * eventIODeviceOpen - 
 *
 * open the LED driver node...
 * 
 * --------------------------------------------------------------
 */

host = eventIODeviceOpen(&led,DEVICE_LED_CM940IAP,YELLOW);

  /* check that a device driver is found ... */

  if (host==0) {return FALSE;}

  /* check the UID .................. */

  switch (led) 
  {
  case DEVICE_IN_USE:
  case DEVICE_UNKNOWN:

	return FALSE;
  } 
  	
return TRUE; 
}
Example #5
0
BOOL openRedLED(void) 
{ 
unsigned int delay;
/* --------------------------------------------------------------
 *
 * eventIODeviceOpen - 
 *
 * open the LED driver node...
 * 
 * --------------------------------------------------------------
 */

red_host = eventIODeviceOpen(&rled,DEVICE_LED_LDS2000,RED);

  /* check that a device driver is found ... */

  /*
  if (red_host==0) {
    while (1) 
    {
    delay=0xBEEF0401;
    };
  return FALSE;
  }
  */

  /* check the UID .................. */

  switch (rled) 
  {
  case DEVICE_IN_USE:
  case DEVICE_UNKNOWN:
  
    /* while (1) 
    {
    delay=0xBEEF0201;
    }; */

	return FALSE;
  } 
  	
return TRUE; 
}
void eventButtonInit(void)
{	
/* -----------------------------------------------------------
 *
 * Bitwise OR incase an existing set of Interrupts have been 
 * set by a debug monitor
 *
 * -----------------------------------------------------------
 

eventButtonUnmaskIrq (10,0);	

 * -----------------------------------------------------------
 *
 * Enable INT0 set as Active high and allows Rising Edge.
 * 
 * -----------------------------------------------------------
 

*(volatile unsigned *)IOPCON 	= IO_ENABLE_INT0; 
*(volatile unsigned *)IOPCON	|= IO_ACTIVE_HIGH_INT0; 
*(volatile unsigned *)IOPCON	|= IO_RISING_EDGE_INT0;	

*/

 *(volatile int*)INTMSK &= ~((1 << INT_GLOBAL) | (1<<10) | (1<<0));

 *(volatile unsigned *)IOPCON   |= IO_ENABLE_INT0;       /* enable int0 */
 *(volatile unsigned *)IOPCON   |= IO_ACTIVE_HIGH_INT0;  /* active high */
 *(volatile unsigned *)IOPCON   |= IO_RISING_EDGE_INT0;  /* RISING EDGE */

/* -----------------------------------------------------------
 *
 * Open LED 1 Device
 * 
 * -----------------------------------------------------------
 */

ledNode = eventIODeviceOpen(&ledUID,DEVICE_LED_E7T,GREEN1);

}