Programme carte strategie (disco)
Dependencies: mbed SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac
Strategie/Strategie.h@60:c7632af62d21, 2019-05-23 (annotated)
- Committer:
- kyxstark
- Date:
- Thu May 23 15:53:48 2019 +0000
- Revision:
- 60:c7632af62d21
- Parent:
- 38:76f886a1c8e6
Carte strat plus lib , mais programme
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
antbig | 0:ad97421fb1fb | 1 | #ifndef CRAC_STRATEGIE |
antbig | 0:ad97421fb1fb | 2 | #define CRAC_STRATEGIE |
antbig | 0:ad97421fb1fb | 3 | |
ClementBreteau | 14:c8fc06c4887f | 4 | // codeur droit A maron bleu, B maron |
Sitkah | 38:76f886a1c8e6 | 5 | typedef enum |
Sitkah | 38:76f886a1c8e6 | 6 | { |
Sitkah | 38:76f886a1c8e6 | 7 | RECALAGE_1, |
Sitkah | 38:76f886a1c8e6 | 8 | RECULER_1, |
Sitkah | 38:76f886a1c8e6 | 9 | TOURNER, |
Sitkah | 38:76f886a1c8e6 | 10 | RECALAGE_2, |
Sitkah | 38:76f886a1c8e6 | 11 | RECULER_2, |
Sitkah | 38:76f886a1c8e6 | 12 | GOTOPOS, |
Sitkah | 38:76f886a1c8e6 | 13 | FIN_POS, |
Sitkah | 38:76f886a1c8e6 | 14 | }E_Stratposdebut; |
Sitkah | 38:76f886a1c8e6 | 15 | |
antbig | 0:ad97421fb1fb | 16 | typedef enum |
antbig | 0:ad97421fb1fb | 17 | { |
antbig | 0:ad97421fb1fb | 18 | ETAT_CHECK_CARTE_SCREEN, //Envoie check carte screen |
antbig | 0:ad97421fb1fb | 19 | ETAT_CHECK_CARTE_SCREEN_WAIT_ACK, //Time out de 1s si erreur clignotement des led et fin prog |
antbig | 0:ad97421fb1fb | 20 | ETAT_CHECK_CARTES, //Envoie check toutes les carte |
antbig | 0:ad97421fb1fb | 21 | ETAT_CHECK_CARTES_WAIT_ACK, //Time out de 1s |
antbig | 0:ad97421fb1fb | 22 | ETAT_WAIT_FORCE,//Attente du forçage du lancement |
antbig | 0:ad97421fb1fb | 23 | ETAT_CONFIG, //attente reception du choix du mode( debug ou game) |
antbig | 0:ad97421fb1fb | 24 | |
antbig | 1:116040d14164 | 25 | ETAT_GAME_INIT,//Mise en mémoire du fichier de stratégie |
antbig | 4:88431b537477 | 26 | ETAT_GAME_WAIT_FOR_JACK,//Attente du retrait du jack |
antbig | 4:88431b537477 | 27 | ETAT_GAME_START,//Lancement du timer 90s |
antbig | 0:ad97421fb1fb | 28 | ETAT_GAME_LOAD_NEXT_INSTRUCTION, |
antbig | 0:ad97421fb1fb | 29 | ETAT_GAME_PROCESS_INSTRUCTION, |
antbig | 0:ad97421fb1fb | 30 | ETAT_GAME_WAIT_ACK, |
antbig | 0:ad97421fb1fb | 31 | ETAT_GAME_JUMP_TIME, |
ClementBreteau | 15:c2fc239e85df | 32 | ETAT_GAME_JUMP_CONFIG, |
antbig | 0:ad97421fb1fb | 33 | ETAT_GAME_JUMP_POSITION, |
antbig | 0:ad97421fb1fb | 34 | ETAT_GAME_WAIT_END_INSTRUCTION, |
antbig | 0:ad97421fb1fb | 35 | |
antbig | 5:dcd817534b57 | 36 | ETAT_WARNING_TIMEOUT,//Attente de la trame fin de danger ou du timeout de 2s |
antbig | 5:dcd817534b57 | 37 | ETAT_WARING_END_BALISE_WAIT,//Attente d'une seconde apres la fin d'un End Balise pour etre sur que c'est bon |
antbig | 5:dcd817534b57 | 38 | ETAT_WARNING_END_LAST_INSTRUCTION,//trouver le meilleur moyen de reprendre l'instruction en cours |
antbig | 5:dcd817534b57 | 39 | ETAT_WARNING_SWITCH_STRATEGIE,//Si à la fin du timeout il y a toujours un robot, passer à l'instruction d'erreur |
antbig | 5:dcd817534b57 | 40 | |
Sitkah | 37:fca332b64b42 | 41 | ETAT_EVITEMENT, |
Sitkah | 37:fca332b64b42 | 42 | |
antbig | 0:ad97421fb1fb | 43 | ETAT_END, |
Sitkah | 29:41e02746041d | 44 | ETAT_END_LOOP, |
Sitkah | 29:41e02746041d | 45 | |
antbig | 0:ad97421fb1fb | 46 | } E_stratGameEtat; |
antbig | 0:ad97421fb1fb | 47 | |
Sitkah | 29:41e02746041d | 48 | |
Sitkah | 37:fca332b64b42 | 49 | typedef enum |
Sitkah | 37:fca332b64b42 | 50 | { |
Sitkah | 37:fca332b64b42 | 51 | ETAT_INIT_EVITEMENT, |
Sitkah | 37:fca332b64b42 | 52 | ETAT_ESTIMATION_POSITION, |
Sitkah | 37:fca332b64b42 | 53 | ETAT_ESTIMATION_POSITION_ROTATION_ACK, |
Sitkah | 37:fca332b64b42 | 54 | ETAT_ESTIMATION_POSITION_ROTATION_ACK_END, |
Sitkah | 37:fca332b64b42 | 55 | ETAT_CALCUL_CHEMIN, |
Sitkah | 37:fca332b64b42 | 56 | ETAT_FIN_EVITEMENT |
Sitkah | 37:fca332b64b42 | 57 | } E_Evitement; |
Sitkah | 37:fca332b64b42 | 58 | |
Sitkah | 37:fca332b64b42 | 59 | |
antbig | 0:ad97421fb1fb | 60 | |
antbig | 4:88431b537477 | 61 | /****************************************************************************************/ |
antbig | 4:88431b537477 | 62 | /* FUNCTION NAME: canProcessRx */ |
antbig | 4:88431b537477 | 63 | /* DESCRIPTION : Fonction de traitement des messages CAN */ |
antbig | 4:88431b537477 | 64 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 65 | void canProcessRx(void); |
Sitkah | 29:41e02746041d | 66 | void automate_process(void); |
Sitkah | 29:41e02746041d | 67 | void automate_etat_ihm(void); |
Sitkah | 29:41e02746041d | 68 | void init_lcd(void); |
Sitkah | 30:a1e37af4bbde | 69 | |
Sitkah | 30:a1e37af4bbde | 70 | void affichage_debug(int var); |
Sitkah | 36:6dd30780bd8e | 71 | |
Sitkah | 36:6dd30780bd8e | 72 | short recalageAngulaireCapteur(void); |
Sitkah | 36:6dd30780bd8e | 73 | short recalageDistanceX(void); |
Sitkah | 36:6dd30780bd8e | 74 | short recalageDistanceY(void); |
Sitkah | 36:6dd30780bd8e | 75 | |
Sitkah | 29:41e02746041d | 76 | #endif |