domingo, 26 de enero de 2014

Secuencia de Encendido de Leds. (Código).

Las líneas de código necesarias se muestran a continuación.

/*===================================================================*/

pointer rojo_ptr, verde_ptr, azul_ptr;


voidTask1_task(uint32_t task_init_data)
{
int counter = 0;
_task_id    rojo;
    rojo = _task_get_id(); //Se obtiene el TasK_ID
    rojo_ptr = _task_get_td(rojo);
    _task_block();

while(1)  
    {
    counter++;
    Red_LED_ClrVal(Red_LED_DeviceData);
    Blue_LED_SetVal(Blue_LED_DeviceData);
    Green_LED_SetVal(Green_LED_DeviceData);
_time_delay_ticks(100);   //suspendelatareapor el numerode ticks especificadopor el argumento
_task_ready(verde_ptr);
    _task_block();          
    }
}

/*===================================================================*/



/*===================================================================*/


voidTask2_task(uint32_t task_init_data)
{
int counter = 0;
_task_id verde;
  verde = _task_get_id();
  verde_ptr = _task_get_td(verde);
  _task_block();
while(1) {    
      counter++;
              Green_LED_ClrVal(Green_LED_DeviceData);
              Blue_LED_SetVal(Blue_LED_DeviceData);
              Red_LED_SetVal(Red_LED_DeviceData);
            _time_delay_ticks(100);       //suspendelatareapor el numerode ticks especificadopor el argumento
            _task_ready(azul_ptr);
              _task_block();

}

}

/*/*===================================================================*/

voidTask3_task(uint32_t task_init_data)
{
int counter = 0;
_task_id azul;
  azul = _task_get_id();
  azul_ptr = _task_get_td(azul);
while(1)
  {          
    counter++;
    Blue_LED_ClrVal(Blue_LED_DeviceData);
    Green_LED_SetVal(Green_LED_DeviceData);
    Red_LED_SetVal(Red_LED_DeviceData);
    _time_delay_ticks(100);
    _task_ready(rojo_ptr);
    _task_block();          
/* Write your code here ... */
}
}


/*/*===================================================================*/

No hay comentarios:

Publicar un comentario