source: Sophya/trunk/Poubelle/archediab.old/archediab.sources/c/tache_PCI.c@ 643

Last change on this file since 643 was 637, checked in by ansari, 26 years ago

archediab version 24 initial import

File size: 1.9 KB
Line 
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
30void decode_telecommande(tmtc* tt)
31{
32int q,code,avance;
33q=tt->tc.pos_ecrit-tt->tc.pos_lit; if (q<0) q+=longueur_table_tc;
34if(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
55int ecrit_commande_PCI(tmtc* tt)
56{
57int j;
58if (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(tt->PCI_actif==1) ecrit_carte(mot[j]);
67 }
68 tt->vi.flag_ecriture_data=0;
69 return(1);
70 }
71return(0);
72}
73
74
75//*****************************************************************************************
76// ***
77#endif //-------------------------------------------------------------------- ***
78// ***
79//*****************************************************************************************
80
81
Note: See TracBrowser for help on using the repository browser.