From 7880951f111a095b9383305fba484d676202003b Mon Sep 17 00:00:00 2001
From: kruger <kruger@astron.nl>
Date: Mon, 11 Jan 2021 15:31:31 +0100
Subject: [PATCH] 32 rcus

---
 HWconf.py | 2 +-
 RCU.py    | 4 ++--
 Vars.py   | 2 +-
 pypcc2.py | 6 +++---
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/HWconf.py b/HWconf.py
index 4976163..25c10af 100644
--- a/HWconf.py
+++ b/HWconf.py
@@ -3,7 +3,7 @@ from enum import Enum
 
 #Mid plane address
 MPaddr=namedtuple("MPaddr","nI2C I2C nSwitch Switch"); 
-RCU_MPaddr=MPaddr(1,[1],4,[1,2,3,4])
+RCU_MPaddr=MPaddr(1,[1],32,[1,2,3,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5])
 CLK_MPaddr=MPaddr(1,[1],1,[7])
 
 DevReg=namedtuple("DevReg","Addr Register_R Register_W store"); 
diff --git a/RCU.py b/RCU.py
index 4d2e559..977aab8 100644
--- a/RCU.py
+++ b/RCU.py
@@ -50,7 +50,7 @@ class RCU1():
             RCU0=-1;
             for RCUi in range(self.N):
                  if (Mask[RCUi]): 
-                      mask+=1<<Vars.RCU_MPaddr.Switch[RCUi]
+                      mask|=1<<Vars.RCU_MPaddr.Switch[RCUi]
                       if RCU0<0: RCU0=RCUi;
             if RCU0<0: return; #Mask all zero
             self.SWcallback(mask)
@@ -113,7 +113,7 @@ class RCU1():
     def GetVarValueAll(self,V1,value1):
             mask=0;
             for RCUi in range(self.N):
-                mask+=1<<V1.Vars[0].MPaddr.Switch[RCUi]
+                mask|=1<<V1.Vars[0].MPaddr.Switch[RCUi]
             Step=V1.nVars
             if V1.Vars[0].type==Vars.DevType.I2C:
               for Vari in range(Step):  
diff --git a/Vars.py b/Vars.py
index 28ce0df..6024ac6 100644
--- a/Vars.py
+++ b/Vars.py
@@ -148,7 +148,7 @@ RCU_on=Instrs("RCU_on",12,[
 
 RCU_off=Instrs("RCU_off",1,[
 #   Instr(DevType.Var,RCU_mask,4,[1,1,1,1]),
-   Instr(DevType.Var,RCU_pwrd,4,[0,0,0,0]),
+   Instr(DevType.Var,RCU_pwrd,32,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),
 #   Instr(DevType.Var,RCU_mask,4,[0,0,0,0])
 ])
 
diff --git a/pypcc2.py b/pypcc2.py
index cf7efd7..233bd91 100644
--- a/pypcc2.py
+++ b/pypcc2.py
@@ -42,7 +42,7 @@ logging.info("OPC-UA Server started")
 
 SW1=I2Cswitch1.I2Cswitch1(I2C.I2C1server)
 
-RCU=RCU.RCU1(4,I2C.I2C1server,SW1.SetChannel)
+RCU=RCU.RCU1(32,I2C.I2C1server,SW1.SetChannel)
 
 #Vars.RCU_mask.OPCW.get_data_value().Value.Value=[1,1,0,0]
 #Vars.Ant_mask.OPCW.get_data_value().Value.Value=[1,1,0,0,0,0,0,0,0,0,1,0]
@@ -93,9 +93,9 @@ def TimerThread(Q1,RCU):
          if Q1.qsize()>3: continue;
          cnt=0;
          logging.debug(str(("I2C bytes=",I2C.I2Ccounter," Qlength=",Q1.qsize())))
-         Inst1=Vars.Instr(Vars.DevType.VarUpdate,Vars.RCU_temp,4,[0]*4)
+         Inst1=Vars.Instr(Vars.DevType.VarUpdate,Vars.RCU_temp,32,[0]*32)
          Q1.put(Inst1)
-         Inst1=Vars.Instr(Vars.DevType.VarUpdate,Vars.RCU_ADC_lock,12,[0]*12)
+         Inst1=Vars.Instr(Vars.DevType.VarUpdate,Vars.RCU_ADC_lock,96,[0]*96)
          Q1.put(Inst1)
 
     logging.info("End Timer thread")
-- 
GitLab