| 1 | #include "manip.h" | 
|---|
| 2 | #include "choix_acquisition.h" | 
|---|
| 3 | #include "archeops.h" | 
|---|
| 4 | #include "choix_param.h" | 
|---|
| 5 | #include "structure.h" | 
|---|
| 6 | #include "tm.h" | 
|---|
| 7 | #include "tache.h" | 
|---|
| 8 | #include "carte_acqui.h" | 
|---|
| 9 | #include "carte_pci.h" | 
|---|
| 10 |  | 
|---|
| 11 |  | 
|---|
| 12 |  | 
|---|
| 13 | // interprete la telecommande provenant du programme principal mac | 
|---|
| 14 | // si c'est une commande directe, l'envoie directement sur le bus PCI (s'il est libre) | 
|---|
| 15 | // sinon, appelle la fonction correspondante | 
|---|
| 16 |  | 
|---|
| 17 |  | 
|---|
| 18 | //    si le bus PCI est libre : lit une telecommande et l'ecrit sur le bus PCI | 
|---|
| 19 |  | 
|---|
| 20 |  | 
|---|
| 21 | //***************************************************************************************** | 
|---|
| 22 | //                                                                                      *** | 
|---|
| 23 | #ifdef _diabolo //---------   pour  Diabolo    ------------------------------   *** | 
|---|
| 24 | //                                                                                      *** | 
|---|
| 25 | //***************************************************************************************** | 
|---|
| 26 |  | 
|---|
| 27 |  | 
|---|
| 28 |  | 
|---|
| 29 |  | 
|---|
| 30 | void    decode_telecommande(tmtc* tt) | 
|---|
| 31 | { | 
|---|
| 32 | int q,code,avance; | 
|---|
| 33 | q=tt->tc.pos_ecrit-tt->tc.pos_lit;      if (q<0) q+=longueur_table_tc; | 
|---|
| 34 | if(q) | 
|---|
| 35 | { | 
|---|
| 36 | avance=1; | 
|---|
| 37 | code=(tt->tc.btc[tt->tc.pos_lit].mot[0])&0xff;          // code de telecommande | 
|---|
| 38 | switch(code) | 
|---|
| 39 | { | 
|---|
| 40 | case    tc_horloge      :       avance=ecrit_commande_PCI(tt) ;         break; | 
|---|
| 41 | case    tc_regul        :       tache_regul(tt);                                        break; | 
|---|
| 42 | default :                               avance=ecrit_commande_PCI(tt) ;         break; | 
|---|
| 43 | } | 
|---|
| 44 | if(avance) | 
|---|
| 45 | { | 
|---|
| 46 | tt->tc.pos_lit++; | 
|---|
| 47 | if(tt->tc.pos_lit>=longueur_table_tc) tt->tc.pos_lit=0; | 
|---|
| 48 | } | 
|---|
| 49 |  | 
|---|
| 50 | } | 
|---|
| 51 | } | 
|---|
| 52 |  | 
|---|
| 53 |  | 
|---|
| 54 |  | 
|---|
| 55 | int     ecrit_commande_PCI(tmtc* tt) | 
|---|
| 56 | { | 
|---|
| 57 | int j; | 
|---|
| 58 | if (tt->vi.flag_ecriture_data>3)                                // priorité a la regul | 
|---|
| 59 | { | 
|---|
| 60 | char * mot; | 
|---|
| 61 | mot=tt->tc.btc[tt->tc.pos_lit].mot; | 
|---|
| 62 | for(j=0;j<10;j++) | 
|---|
| 63 | { | 
|---|
| 64 | //                      for(i=0;i<1000;i++); | 
|---|
| 65 | //                      ecrit_carte(tt->tc.btc[tt->tc.pos_lit].mot[j]); | 
|---|
| 66 | if(acquisition_PCI)     ecrit_carte(mot[j]); | 
|---|
| 67 | } | 
|---|
| 68 | tt->vi.flag_ecriture_data=0; | 
|---|
| 69 | return(1); | 
|---|
| 70 | } | 
|---|
| 71 | return(0); | 
|---|
| 72 | } | 
|---|
| 73 |  | 
|---|
| 74 |  | 
|---|
| 75 | //***************************************************************************************** | 
|---|
| 76 | //                                                                                      *** | 
|---|
| 77 | #endif          //--------------------------------------------------------------------  *** | 
|---|
| 78 | //                                                                                      *** | 
|---|
| 79 | //***************************************************************************************** | 
|---|
| 80 |  | 
|---|
| 81 |  | 
|---|