Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of CRAC-Strat_2017_homologation_gros_rob by
Diff: AX12-V2/AX12-V2.cpp
- Revision:
- 12:14729d584500
- Parent:
- 8:0edc7dfb7f7e
- Child:
- 14:c8fc06c4887f
--- a/AX12-V2/AX12-V2.cpp Mon May 02 19:40:59 2016 +0000
+++ b/AX12-V2/AX12-V2.cpp Mon May 09 09:10:17 2016 +0000
@@ -105,7 +105,7 @@
/****************************************************************************************/
void AX12_notifyCANEnd(unsigned char id)
{
- if(waitingAckFrom == SERVO_AX12_DONE) {
+ if(waitingAckFrom == SERVO_AX12_DONE && waitingAckID == id) {
waitingAckFrom = 0;
waitingAckID = 0;
}
@@ -150,7 +150,7 @@
int i=0;
int dataToSendLength = 0;
char dataToSend[100];
-
+ int sendTwice = 0;
for(i=0;i<lastAX12Use;i++)
{
@@ -179,11 +179,13 @@
//printf("need to send %d data\n",dataToSendLength);
if(dataToSendLength > 0)//Il y a des données à envoyer en local
{
- AX12_syncWrite(AX12_Serial1, AX12_REG_GOAL_POSITION, dataToSendLength, dataToSend);
- //wait_ms(10);
- AX12_syncWrite(AX12_Serial2, AX12_REG_GOAL_POSITION, dataToSendLength, dataToSend);
+ for(sendTwice=0;sendTwice<2;sendTwice++)
+ {
+ AX12_syncWrite(AX12_Serial1, AX12_REG_GOAL_POSITION, dataToSendLength, dataToSend);
+ //wait_ms(10);
+ AX12_syncWrite(AX12_Serial2, AX12_REG_GOAL_POSITION, dataToSendLength, dataToSend);
+ }
}
-
}
/****************************************************************************************/
