Compare commits
No commits in common. "de178db0a1e72cde1fe901e0c2037985be49bcc8" and "7258def910219c7ff66676f50733af3b8bc700c8" have entirely different histories.
de178db0a1
...
7258def910
5 changed files with 46 additions and 52 deletions
|
|
@ -132,15 +132,18 @@ function isSETH() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function doSETH() {
|
function doSETH() {
|
||||||
printf "%.0f %d %d %g %g %g %g %g %g\n", TE0+EPOCH, \
|
printf "%.0f %g %g %g %g %d %g %d %g\n", TE0+EPOCH, \
|
||||||
iTRIG0, iTRIG1, ETRIG0, ETRIG1, \
|
EBGO0, EBGO1, EHETB, EHETA, \
|
||||||
EHETB, EHETA, EBGO0, EBGO
|
iTRIG0, ETRIG0, iTRIG1, ETRIG1
|
||||||
|
for (i in cBGO) printf " %g", EE[i]
|
||||||
|
for (i in cBGO) printf " %g", EE[i+24]
|
||||||
|
printf "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
function doSETHBGO() {
|
function doSETHBGO() {
|
||||||
printf "%.0f %d %d %g %g %g %g %g %g", TE0+EPOCH, \
|
printf "%.0f %g %g %g %g %d %g %d %g", TE0+EPOCH, \
|
||||||
iTRIG0, iTRIG1, ETRIG0, ETRIG1, \
|
EBGO0, EBGO1, EHETB, EHETA, \
|
||||||
EHETB, EHETA, EBGO0, EBGO
|
iTRIG0, ETRIG0, iTRIG1, ETRIG1
|
||||||
for (i in cBGO) printf " %g", EE[i]
|
for (i in cBGO) printf " %g", EE[i]
|
||||||
for (i in cBGO) printf " %g", EE[i+24]
|
for (i in cBGO) printf " %g", EE[i+24]
|
||||||
printf "\n"
|
printf "\n"
|
||||||
|
|
|
||||||
36
armlib.py
36
armlib.py
|
|
@ -601,42 +601,6 @@ class irena_ifc(object):
|
||||||
except EOFError:
|
except EOFError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Keep_Alive_Schedule:
|
|
||||||
|
|
||||||
interval = 30
|
|
||||||
ioffset = 1
|
|
||||||
cmd = "e/in 'staying alive'"
|
|
||||||
clock_interval = 900
|
|
||||||
clock_args = {"fudge": True}
|
|
||||||
|
|
||||||
def __init__(self, cmd=None, interval=None):
|
|
||||||
if cmd:
|
|
||||||
self.cmd = cmd
|
|
||||||
if interval:
|
|
||||||
self.interval = interval
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def __call__(self):
|
|
||||||
t0 = time.time()
|
|
||||||
try:
|
|
||||||
while True:
|
|
||||||
sys.stderr.write(" \r")
|
|
||||||
print(_ifc.cmd(self.cmd))
|
|
||||||
sys.stderr.write(f"Pinging every {self.interval:.3g} seconds, type Ctrl-C to end\r")
|
|
||||||
t = time.time()
|
|
||||||
tping = self.interval - t % self.interval + self.ioffset
|
|
||||||
tclock = self.clock_interval - t % self.clock_interval
|
|
||||||
if tclock < tping:
|
|
||||||
time.sleep(tclock)
|
|
||||||
_ifc.set_clock(**self.clock_args)
|
|
||||||
tping -= tclock
|
|
||||||
if tping > 0.1:
|
|
||||||
time.sleep(tping)
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def init_irena(scope, name="xRENA", prod=None, options="", long_options=[]):
|
def init_irena(scope, name="xRENA", prod=None, options="", long_options=[]):
|
||||||
global _ifc, _ifc_uart, _opt
|
global _ifc, _ifc_uart, _opt
|
||||||
_ifc = None
|
_ifc = None
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
@dorn/l3 [0,4,0] -4404
|
@dorn/l3 [0,4,0] -4404
|
||||||
@dorn/l3 [0,4,1] 10830
|
@dorn/l3 [0,4,1] 10830
|
||||||
@dorn/l3 [0,4,2] -23912
|
@dorn/l3 [0,4,2] -23912
|
||||||
@dorn/l3 [0,4,3] 0x7fff (overflow: 45271)
|
@dorn/l3 [0,4,3] 45271
|
||||||
@dorn/fifo/enable/inj 0xdb3
|
@dorn/fifo/enable/inj 0xdb3
|
||||||
@s/for 2: dorn/enable[i]/samples/inj 0
|
@s/for 2: dorn/enable[i]/samples/inj 0
|
||||||
@v $T = 0x101808
|
@v $T = 0x101808
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,42 @@ def CHAOS_NAMES():
|
||||||
{ "any": 0x100, "read": 0x3ffff }, # DL
|
{ "any": 0x100, "read": 0x3ffff }, # DL
|
||||||
]
|
]
|
||||||
|
|
||||||
Keep_Alive = armlib.Keep_Alive_Schedule(
|
class Keep_Alive_Schedule:
|
||||||
|
|
||||||
|
interval = 30
|
||||||
|
ioffset = 1
|
||||||
|
cmd = "e/in 'staying alive'"
|
||||||
|
clock_interval = 900
|
||||||
|
clock_args = {"fudge": True}
|
||||||
|
|
||||||
|
def __init__(self, cmd=None, interval=None):
|
||||||
|
if cmd:
|
||||||
|
self.cmd = cmd
|
||||||
|
if interval:
|
||||||
|
self.interval = interval
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def __call__(self):
|
||||||
|
t0 = time.time()
|
||||||
|
try:
|
||||||
|
while True:
|
||||||
|
sys.stderr.write(" \r")
|
||||||
|
print(cmd(self.cmd))
|
||||||
|
sys.stderr.write(f"Pinging every {self.interval:.3g} seconds, type Ctrl-C to end\r")
|
||||||
|
t = time.time()
|
||||||
|
tping = self.interval - t % self.interval + self.ioffset
|
||||||
|
tclock = self.clock_interval - t % self.clock_interval
|
||||||
|
if tclock < tping:
|
||||||
|
time.sleep(tclock)
|
||||||
|
ifc.set_clock(**self.clock_args)
|
||||||
|
tping -= tclock
|
||||||
|
if tping > 0.1:
|
||||||
|
time.sleep(tping)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
pass
|
||||||
|
|
||||||
|
Keep_Alive = Keep_Alive_Schedule(
|
||||||
cmd = "e/in"
|
cmd = "e/in"
|
||||||
" '%u.%u %u.%u mbar %d %d °C F=%u H=%u',"
|
" '%u.%u %u.%u mbar %d %d °C F=%u H=%u',"
|
||||||
" pre/10, pre%10, pre[1]/10, pre[1]%10,"
|
" pre/10, pre%10, pre[1]/10, pre[1]%10,"
|
||||||
|
|
|
||||||
|
|
@ -66,14 +66,6 @@ def adisable():
|
||||||
cmd("s/cron/none")
|
cmd("s/cron/none")
|
||||||
disable()
|
disable()
|
||||||
|
|
||||||
Keep_alive = armlib.Keep_Alive_Schedule(
|
|
||||||
cmd="e/in"
|
|
||||||
" '%u.%u mbar %d.%d °C F=%u',"
|
|
||||||
" pre/10, pre%10,"
|
|
||||||
" (te-2731)/10, (te-2731)%10,"
|
|
||||||
" F"
|
|
||||||
)
|
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__=="__main__":
|
||||||
ifc,_oo = armlib.init_irena(scope = globals(), name = "AHEPAM", prod = (0xee0c,),
|
ifc,_oo = armlib.init_irena(scope = globals(), name = "AHEPAM", prod = (0xee0c,),
|
||||||
long_options=["seth", "ahbgo"])
|
long_options=["seth", "ahbgo"])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue