/*=======================================================================+
|             DEPARTAMENTO MECANICA UNIVERSIDADE AVEIRO                  |
|               Projecto Humanoide (PHUA - MODULROB)                     |
|                                                                        |
| Programadores:                                                         |
|              David Manuel Costa Gameiro          N:20281               |
|              Filipe Carvalho Mostardinha         N:22085               |
|                                                                        |
| Data: Segunda - 25/Maio/2004                                           |
|                                                                        |
| Nome Ficheiro: FuncAux.c                                               |
|                                                                        |
|                            SOURCE FILE                                 |
+=======================================================================*/

#include <delays.h>
#include "FuncAux.h"
#include "Can18xx8.h"



bool TdasJuntasMembro(juntas *ptr, byte NumJuntas,byte *Msg, byte CAN_FLAGS)
{
byte i;
bool sucesso;

for (i = 0; i<NumJuntas; i++)
{

	sucesso = CANSendMessage( ptr->Junta[i], Msg , 2,CAN_FLAGS);

	if (!sucesso)
		return sucesso;//caso exista algum tipo de erro

//esperar algum tempo possivel muito transito e ocorrer algum erro
	Delay10TCYx(2);//espera ou 20 ciclos maquina
	
}
return sucesso;
}


