Alexandre Salconi-Denis
/
ProjetOctopode
Programme de contrôle de l'octopode 4DOF, Theraphosa-Salconi.
CtrlBridge
- fonction quelquonque pour communiquer avec les module
- fonction quelquonque pour faire des recherche dans les module dispo
- autre fonction pour jouer avec MemRegistre
Version 1.2.0
- Ajout d'un mode de simulation pour tester le code avec seulement un contrôleur stm32
directive.cpp@9:7295385f02b2, 2015-03-19 (annotated)
- Committer:
- salco
- Date:
- Thu Mar 19 19:14:31 2015 +0000
- Revision:
- 9:7295385f02b2
- Parent:
- 4:3c7e853095b9
- Child:
- 11:496453b45e25
Grosse renovation, jai enlever la liste chainer faire home made et j'ai utiliser std::list qui est deja cr?er et va me simplifier un peut les chose. J'ai ajuster les fonction de MemRegistre pour le rende compatible.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
salco | 2:4c5b0f6d0a6b | 1 | |
salco | 2:4c5b0f6d0a6b | 2 | #include "directive.h" |
salco | 2:4c5b0f6d0a6b | 3 | |
salco | 2:4c5b0f6d0a6b | 4 | Directive::Directive():TTask(0)//on veux que cette tache sois exec toute les fois que TTaskGen sexecute. |
salco | 2:4c5b0f6d0a6b | 5 | { |
salco | 3:e0d6e081a9d3 | 6 | c=0; |
salco | 3:e0d6e081a9d3 | 7 | pc = new Serial(SERIAL_TX, SERIAL_RX); |
salco | 3:e0d6e081a9d3 | 8 | ssc32= new Serial(PA_9, PA_10); |
salco | 3:e0d6e081a9d3 | 9 | |
salco | 3:e0d6e081a9d3 | 10 | ctrDesPattes = new Faculter_motrice(/*ssc32*/pc); |
salco | 2:4c5b0f6d0a6b | 11 | } |
salco | 2:4c5b0f6d0a6b | 12 | Directive::~Directive() |
salco | 2:4c5b0f6d0a6b | 13 | { |
salco | 3:e0d6e081a9d3 | 14 | if(pc) |
salco | 3:e0d6e081a9d3 | 15 | delete pc; |
salco | 3:e0d6e081a9d3 | 16 | if(ssc32) |
salco | 3:e0d6e081a9d3 | 17 | delete ssc32; |
salco | 3:e0d6e081a9d3 | 18 | if(ctrDesPattes) |
salco | 3:e0d6e081a9d3 | 19 | delete ctrDesPattes; |
salco | 2:4c5b0f6d0a6b | 20 | } |
salco | 3:e0d6e081a9d3 | 21 | void Directive::task(void)//ALL CODE HERE// |
salco | 2:4c5b0f6d0a6b | 22 | { |
salco | 3:e0d6e081a9d3 | 23 | |
salco | 4:3c7e853095b9 | 24 | wait(1);// a enlever plus tard pour gain de vitesse// |
salco | 3:e0d6e081a9d3 | 25 | //////////////// |
salco | 3:e0d6e081a9d3 | 26 | // Inspection // |
salco | 3:e0d6e081a9d3 | 27 | //////////////// |
salco | 3:e0d6e081a9d3 | 28 | |
salco | 3:e0d6e081a9d3 | 29 | if(pc->readable()) { |
salco | 3:e0d6e081a9d3 | 30 | c=pc->getc();//pc.scanf ("%79s",str); |
salco | 3:e0d6e081a9d3 | 31 | pc->printf("AK %c\n",c);//pc.printf("AK %s\n",str);// pc.printf("This program is %d .\n", i); |
salco | 3:e0d6e081a9d3 | 32 | } |
salco | 3:e0d6e081a9d3 | 33 | |
salco | 3:e0d6e081a9d3 | 34 | ////////////////////////////// |
salco | 3:e0d6e081a9d3 | 35 | // Traitement du Labyrinthe // |
salco | 3:e0d6e081a9d3 | 36 | ////////////////////////////// |
salco | 3:e0d6e081a9d3 | 37 | if (c == 'g') { |
salco | 3:e0d6e081a9d3 | 38 | ctrDesPattes->calibre(); |
salco | 3:e0d6e081a9d3 | 39 | c=0; |
salco | 3:e0d6e081a9d3 | 40 | } |
salco | 3:e0d6e081a9d3 | 41 | if(c == 'h') { |
salco | 3:e0d6e081a9d3 | 42 | pc->printf(" ID seq: %i \n\r",ctrDesPattes->get_idSeq()); |
salco | 3:e0d6e081a9d3 | 43 | c=0; |
salco | 3:e0d6e081a9d3 | 44 | } |
salco | 3:e0d6e081a9d3 | 45 | /////////////// |
salco | 3:e0d6e081a9d3 | 46 | // Mouvement // |
salco | 3:e0d6e081a9d3 | 47 | /////////////// |
salco | 3:e0d6e081a9d3 | 48 | // ctrDesPattes.exec(); |
salco | 3:e0d6e081a9d3 | 49 | //////////////////// |
salco | 3:e0d6e081a9d3 | 50 | // Update memoire // |
salco | 3:e0d6e081a9d3 | 51 | //////////////////// |
salco | 3:e0d6e081a9d3 | 52 | |
salco | 3:e0d6e081a9d3 | 53 | //////////// |
salco | 3:e0d6e081a9d3 | 54 | // Autre? // |
salco | 3:e0d6e081a9d3 | 55 | //////////// |
salco | 3:e0d6e081a9d3 | 56 | |
salco | 3:e0d6e081a9d3 | 57 | |
salco | 3:e0d6e081a9d3 | 58 | |
salco | 2:4c5b0f6d0a6b | 59 | } |