8 #include "fms_fm102_2011_a.hh"
10 void fms_fm102_2011_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;
69 if (Sum[i] > 63) Sum[i] = 63;
73 fm102.output[t] = Sum[0] | Sum[2] << 6 | BS0 << 24 | BS1 << 25 | BS2 << 26 | HT0 << 27 | HT1 << 28;