RAM 6.0 BUX II Series Guía de usuario Pagina 68

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 189
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 67
VxWorks
BSP Developer’s Guide, 6.0
60
/***********************************************************************
*
* sysLedControl - Turn selected LED(s) on or off.
*
* This routine sets the selected LED on or off.
*
* RETURNS: N/A.
*
* SEE ALSO: sysLedInit(), sysLedOff(), sysLedOn().
*/
void sysLedControl
(
int ledOn,
UINT8 led
)
{
/*
* Check led state.
*/
if (ledOn)
sysLed |= led; /* Set LED on. */
else
sysLed &= ~led; /* Set LED off. */
/*
* Write to LED.
*/
BSCR_LED_REGISTER = sysLed;
}
#endif /* INCLUDE_SYSLED */
If the LED manipulation routines are written before the environment is set up for
C subroutine linkage, the routines must be written in standalone assembly
language. In this case, the above sample code can be used as a starting design for
your assembly code. Later on, during the cleanup phase of your BSP development,
the LED routines can be rewritten in C.
In addition to the basic LED routines, a simple control loop is useful to flash the
LEDs on and off, with a suitable delay between the flashes so that they can be seen
easily.
Once the LED routines are written, your initialization code can include calls to turn
on or off LEDs at specific points during initialization.
3.2.4 Debugging the Initialization Code
The beginning portions of the ROM and RAM initialization sequences differ, but
the sequences are otherwise the same. Details of what each BSP procedure must do
Vista de pagina 67
1 2 ... 63 64 65 66 67 68 69 70 71 72 73 ... 188 189

Comentarios a estos manuales

Sin comentarios