![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
code avec la sortie d'évitement en plus géré par un ticker, ce code et le code "avec_modifs" buggent en match avec seulement la stratégie agressive.
Dependencies: mbed SerialHalfDuplex SDFileSystem liaison_Bluetooth ident_crac DISCO-F469NI_portrait
Diff: Strategie/Strategie.cpp
- Revision:
- 33:c54841d11156
- Parent:
- 32:7f8e3ee2adac
- Child:
- 35:2a745eeb7922
--- a/Strategie/Strategie.cpp Tue May 11 15:02:31 2021 +0000 +++ b/Strategie/Strategie.cpp Wed May 12 14:40:52 2021 +0000 @@ -1612,145 +1612,19 @@ break; case 151: - unsigned char argu_at_1_bras = arg1, numero_bras_at; - if(argu_at_1_bras<6) - { - SendMsgCan(BRAS_AT_1, &argu_at_1_bras,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - } - else if(argu_at_1_bras>5) - { - switch(argu_at_1_bras) - { - case 10: - numero_bras_at = 0 ; - SendMsgCan(BRAS_AT_2, &numero_bras_at,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - - case 20: - numero_bras_at = 1 ; - SendMsgCan(BRAS_AT_2, &numero_bras_at,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - - case 21: - numero_bras_at = 2 ; - SendMsgCan(BRAS_AT_2, &numero_bras_at,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - - case 210: - numero_bras_at = 1 ; - SendMsgCan(BRAS_AT_3, &numero_bras_at,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - - case 43: - numero_bras_at = 3 ; - SendMsgCan(BRAS_AT_2, &numero_bras_at,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - - case 53: - numero_bras_at = 4 ; - SendMsgCan(BRAS_AT_2, &numero_bras_at,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - - case 54: - numero_bras_at = 5 ; - SendMsgCan(BRAS_AT_2, &numero_bras_at,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - - case 543: - numero_bras_at = 0 ; - SendMsgCan(BRAS_AT_3, &numero_bras_at,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - } - } + unsigned char argu_at_bras = arg1; + if(argu_at_bras == 543) argu_at_bras = 66; + SendMsgCan(BRAS_AT, &argu_at_bras,sizeof(arg1)); + waitingAckFrom = 0; + waitingAckID =0; break; case 152: - unsigned char argu_re_1_bras = arg1, numero_bras_re; - if(argu_re_1_bras<6) - { - SendMsgCan(BRAS_RE_1, &argu_re_1_bras,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - } - else if(argu_re_1_bras>5) - { - switch(argu_re_1_bras) - { - case 10: - numero_bras_re = 0 ; - SendMsgCan(BRAS_RE_2, &numero_bras_re,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - - case 20: - numero_bras_re = 1 ; - SendMsgCan(BRAS_RE_2, &numero_bras_re,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - - case 21: - numero_bras_re = 2 ; - SendMsgCan(BRAS_RE_2, &numero_bras_re,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - - case 210: - numero_bras_re = 1 ; - SendMsgCan(BRAS_RE_3, &numero_bras_re,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - - case 43: - numero_bras_re = 3 ; - SendMsgCan(BRAS_RE_2, &numero_bras_re,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - - case 53: - numero_bras_re = 4 ; - SendMsgCan(BRAS_RE_2, &numero_bras_re,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - - case 54: - numero_bras_re = 5 ; - SendMsgCan(BRAS_RE_2, &numero_bras_re,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - - case 543: - numero_bras_re = 0 ; - SendMsgCan(BRAS_RE_3, &numero_bras_re,sizeof(arg1)); - waitingAckFrom = 0; - waitingAckID =0; - break; - } - } + unsigned char argu_re_bras = arg1; + if(argu_re_bras == 543) argu_re_bras = 66; + SendMsgCan(BRAS_RE, &argu_re_bras,sizeof(arg1)); + waitingAckFrom = 0; + waitingAckID =0; break; case 153: @@ -1768,6 +1642,18 @@ waitingAckID =0; break; + case 157 : + unsigned char argu_manche_haut = arg1; + SendMsgCan(AUTOMATE_MANCHE_HAUT, &argu_manche_haut,sizeof(arg1)); + waitingAckFrom = 0; + waitingAckID =0; + + case 158 : + unsigned char argu_manche_bas = arg1; + SendMsgCan(AUTOMATE_MANCHE_BAS, &argu_manche_bas,sizeof(arg1)); + waitingAckFrom = 0; + waitingAckID =0; + default: retour = 0;//L'action n'existe pas, il faut utiliser le CAN break;