8 #include "fms_fm102_2012_a.hh"
10 void fms_fm102_2012_a(
Board& fm102,
int t){
11 int* channels = (
int*)fm102.channels[t];
14 const int R0 = fm102.registers[0];
15 const int R1 = fm102.registers[1];
16 const int R2 = fm102.registers[2];
30 for (
int i = 0; i < 4; i += 2) {
31 int fm005out = channels[i];
32 int fm006out = channels[i+1];
36 HT0 |= btest(fm005out,30);
37 HT0 |= btest(fm006out,30);
39 HT1 |= btest(fm005out,31);
40 HT1 |= btest(fm006out,31);
45 int SumH = getbits(fm005out,0 ,5);
46 int SumGH = getbits(fm005out,5 ,5);
47 int SumG = getbits(fm005out,10,5);
48 int SumF = getbits(fm005out,15,5);
49 int SumEF = getbits(fm005out,20,5);
50 int SumE = getbits(fm005out,25,5);
52 int SumJ = getbits(fm006out,15,5);
53 int SumIJ = getbits(fm006out,20,5);
54 int SumI = getbits(fm006out,25,5);
56 BS0 |= SumE > R0 || SumEF > R0 || SumF > R0 || SumG > R0 || SumGH > R0 || SumH > R0;
57 BS1 |= SumE > R1 || SumEF > R1 || SumF > R1 || SumG > R1 || SumGH > R1 || SumH > R1;
58 BS2 |= SumE > R2 || SumEF > R2 || SumF > R2 || SumG > R2 || SumGH > R2 || SumH > R2;
59 BS0 |= SumI > R0 || SumIJ > R0 || SumJ > R0;
60 BS1 |= SumI > R1 || SumIJ > R1 || SumJ > R1;
61 BS2 |= SumI > R2 || SumIJ > R2 || SumJ > R2;
65 Sum[i ] = SumE+SumF+SumG+SumH+SumI+SumJ;
66 Sum[i+1] = SumH+SumI+SumJ;
73 int SumS = Sum[1]+Sum[3];
75 if (SumT > 31) SumT = 31;
76 if (SumB > 31) SumB = 31;
77 if (SumS > 31) SumS = 31;
81 fm102.output[t] |= SumT << 0;
82 fm102.output[t] |= SumS << 5;
83 fm102.output[t] |= SumB << 10;
84 fm102.output[t] |= BS0 << 24;
85 fm102.output[t] |= BS1 << 25;
86 fm102.output[t] |= BS2 << 26;
87 fm102.output[t] |= HT0 << 27;
88 fm102.output[t] |= HT1 << 28;