Compare commits
9 commits
90d5d885a3
...
c81bb3cdb8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c81bb3cdb8 | ||
|
|
3459a61c12 | ||
|
|
3a5cc8ddee | ||
|
|
4f451c271c | ||
|
|
99118e896a | ||
|
|
733e4404d9 | ||
|
|
ddabdc7e74 | ||
|
|
377ca611fe | ||
|
|
96d48c909a |
3 changed files with 11 additions and 21 deletions
|
|
@ -633,7 +633,6 @@ def init_irena(scope, name="xRENA", prod=None, options="", long_options=[]):
|
|||
else:
|
||||
_ifc_uart = uartterm.init_uart(scope=scope, prefix="serial_", dname=name, addr=v, isp=False)
|
||||
_ifc_uart._shell_scope = scope
|
||||
_ifc_uart.uart.wait_for_message(b"Altera")
|
||||
if o in "-N --network":
|
||||
import udpterm
|
||||
_ifc = udpterm.init_udp(scope=scope, dname=name, addr=v)
|
||||
|
|
@ -648,7 +647,7 @@ def init_irena(scope, name="xRENA", prod=None, options="", long_options=[]):
|
|||
vvv=vv.split(".")
|
||||
bus = int(vvv[0]) if vvv[0] else None
|
||||
address = int(vvv[1]) if len(vvv)>1 and vvv[1] else None
|
||||
if bus and _ifc_uart:
|
||||
if _ifc_uart:
|
||||
address = _ifc_uart.uart.wait_for_usb()
|
||||
_ifc = usbterm.init_usb(scope=scope, dname=name,
|
||||
prod=prod, bus=bus, address=address)
|
||||
|
|
@ -658,6 +657,8 @@ def init_irena(scope, name="xRENA", prod=None, options="", long_options=[]):
|
|||
|
||||
if not _ifc:
|
||||
import usbterm
|
||||
if _ifc_uart:
|
||||
_ifc_uart.uart.wait_for_usb()
|
||||
_ifc = usbterm.init_usb(scope, dname=name, prod=prod)
|
||||
|
||||
set_prompt(_ifc._prompt)
|
||||
|
|
|
|||
17
dorn.py
Executable file → Normal file
17
dorn.py
Executable file → Normal file
|
|
@ -40,21 +40,6 @@ l2_set6 = (
|
|||
(7, 1125, -1888),
|
||||
)
|
||||
|
||||
l2cal = [
|
||||
[
|
||||
0.99964,
|
||||
None,
|
||||
0.99117,
|
||||
None,
|
||||
None, None, None, None,
|
||||
1.00178,
|
||||
None, None, None,
|
||||
None, None, None, None,
|
||||
],
|
||||
[], [], [],
|
||||
]
|
||||
|
||||
|
||||
def calib_l2(cal, l2_set6):
|
||||
if cal is None:
|
||||
return coeff
|
||||
|
|
@ -102,7 +87,7 @@ def l3banana(
|
|||
p2 = 12737,
|
||||
p3 = -3698 ):
|
||||
for sl in AHEPAM_CONFIG.slices:
|
||||
for ch in range(12):
|
||||
for ch in range(AHEPAM_CONFIG.n_channels):
|
||||
write_l3(sl, ch, p0, p1, p2, p3)
|
||||
|
||||
def c16log2(A):
|
||||
|
|
|
|||
10
uartterm.py
10
uartterm.py
|
|
@ -874,7 +874,6 @@ class irena_uart(irena_ifc):
|
|||
irena_ifc.__init__(self, dname=dname)
|
||||
self._data = uart(self, dev, baudrate)
|
||||
self.uart = self._data
|
||||
self.resp = self._data.resp
|
||||
if isp:
|
||||
self._prompt += "-ISP"
|
||||
self.uart.Init_ISP()
|
||||
|
|
@ -886,14 +885,19 @@ class irena_uart(irena_ifc):
|
|||
def arm_reset(self):
|
||||
self.uart.Reset_ARM()
|
||||
|
||||
def cmd(self, c, timeout=10000):
|
||||
def ucmd(self, c, timeout=10000, raise_e=None):
|
||||
self._data.flush_responses()
|
||||
self._data.serial.write(utf8_encode(c).strip()+b'\n')
|
||||
r = self._data.resp(timeout=timeout/1000.)
|
||||
r = self._data.resp(timeout=timeout/1000)
|
||||
if self.verbosity >= 2:
|
||||
sys.stderr.write("sent: %s recv: %s\n" % (repr(c),repr(r)))
|
||||
return r
|
||||
|
||||
def resp(self, timeout=1000, raise_e=None):
|
||||
return self._data.resp(timeout = timeout/1000,
|
||||
blocking = timeout > 0,
|
||||
verbose = self.verbosity )
|
||||
|
||||
DataThread = None
|
||||
|
||||
class md3_gse(uart):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue