carte esclave petit robot
Dependencies: mbed Herkulex_Library_2019 actions_Gr ident_crac actions_Pr
Diff: main.cpp
- Revision:
- 27:9627700d989f
- Parent:
- 26:33c7ff467bd9
- Child:
- 30:d034f469359e
--- a/main.cpp Wed May 22 20:24:42 2019 +0000 +++ b/main.cpp Wed May 22 20:56:42 2019 +0000 @@ -1,4 +1,4 @@ -#include "mbed.h" + #include "main.h" #define SIZE_FIFO 50 @@ -15,10 +15,6 @@ void canProcessRx(void); -#ifdef ROBOT_BIG -int rotation_couroies = 0; -#endif - /*********************************************************************************************/ /* FUNCTION NAME: canRx_ISR */ /* DESCRIPTION : lit les messages sur le can et les stocke dans la FIFO */ @@ -89,10 +85,10 @@ #endif #ifdef ROBOT_BIG - automate_ventouse_presentoir_avant(); + /*automate_ventouse_presentoir_avant(); automate_ventouse_goldenium_avant(); automate_ventouse_relache_avant(); - automate_ventouse_accelerateur_avant(); + automate_ventouse_accelerateur_avant();*/ fifo_couleur(); ascenseur(); @@ -168,6 +164,30 @@ SendAck(ACKNOWLEDGE_TELEMETRE,RECEPTION_RECALAGE); break; + + +//--------------------------------------------------------------------------ACK carte pompe---------------------------------------------- + + + case HACHEUR_STATUT_VENTOUSES: + status_pompe = msgRxBuffer[FIFO_lecture].data[1]; + //can.write(CANMessage(0x529, &status_pompe,1)); + break; + + case HACHEUR_GET_ATOM_ACK: + status_pompe |= (0x01 << msgRxBuffer[FIFO_lecture].data[0]); + //can.write(CANMessage(0x529, &status_pompe,1)); + break; + + case HACHEUR_RELEASE_ATOM_ACK : + status_pompe &= ~(0x01 << msgRxBuffer[FIFO_lecture].data[0]); + break; + +//------------------------------------------------------------------------------------------------------------------------------------------- + + + +#ifdef ROBOT_SMALL case PRESENTOIR_AVANT: fpresentoir_avant=1; break; @@ -194,29 +214,6 @@ case AVANT_RELACHE: favant_relache=1; break; - -//--------------------------------------------------------------------------ACK carte pompe---------------------------------------------- - - - case HACHEUR_STATUT_VENTOUSES: - status_pompe = msgRxBuffer[FIFO_lecture].data[1]; - //can.write(CANMessage(0x529, &status_pompe,1)); - break; - - case HACHEUR_GET_ATOM_ACK: - status_pompe |= (0x01 << msgRxBuffer[FIFO_lecture].data[0]); - //can.write(CANMessage(0x529, &status_pompe,1)); - break; - - case HACHEUR_RELEASE_ATOM_ACK : - status_pompe &= ~(0x01 << msgRxBuffer[FIFO_lecture].data[0]); - break; - -//------------------------------------------------------------------------------------------------------------------------------------------- - - - -#ifdef ROBOT_SMALL //-------------------------------------------------------------------------Actions petit robot---------------------------------------------- case GABARIT_PETIT_ROBOT: SendAck(ACKNOWLEDGE_HERKULEX, ACK_ACTION);