logic_analyzer: only set triggers if extra info provided in config
This commit is contained in:
parent
0cb58c169e
commit
1c1c514a39
|
|
@ -3,6 +3,7 @@ cores:
|
|||
my_logic_analyzer:
|
||||
type: logic_analyzer
|
||||
sample_depth: 2048
|
||||
trigger_mode: single_shot
|
||||
|
||||
probes:
|
||||
probe0: 1
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ cores:
|
|||
my_logic_analyzer:
|
||||
type: logic_analyzer
|
||||
sample_depth: 8192
|
||||
trigger_mode: single_shot
|
||||
|
||||
probes:
|
||||
probe0: 1
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ cores:
|
|||
my_logic_analyzer:
|
||||
type: logic_analyzer
|
||||
sample_depth: 256
|
||||
trigger_mode: single_shot
|
||||
|
||||
probes:
|
||||
probe0: 1
|
||||
|
|
|
|||
|
|
@ -115,13 +115,17 @@ class LogicAnalyzerCore(MantaCore):
|
|||
|
||||
# Checks and formatting complete, create LogicAnalyzerCore
|
||||
probes = [Signal(width, name=name) for name, width in config["probes"].items()]
|
||||
|
||||
core = cls(sample_depth, probes)
|
||||
core.set_triggers(
|
||||
trigger_mode=config.get("trigger_mode"),
|
||||
triggers=triggers,
|
||||
trigger_location=config.get("trigger_location"),
|
||||
)
|
||||
|
||||
# If any trigger-related configuration was provided, set the triggers with it
|
||||
keys = ["trigger_mode", "triggers", "trigger_location"]
|
||||
if any([key in config for key in keys]):
|
||||
core.set_triggers(
|
||||
trigger_mode=config.get("trigger_mode"),
|
||||
triggers=triggers,
|
||||
trigger_location=config.get("trigger_location"),
|
||||
)
|
||||
|
||||
return core
|
||||
|
||||
def define_submodules(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue