Actually listen to the --subdevice option in the insn.py demo.
authorW. Trevor King <wking@drexel.edu>
Mon, 19 Mar 2012 16:41:29 +0000 (12:41 -0400)
committerW. Trevor King <wking@drexel.edu>
Mon, 19 Mar 2012 16:41:29 +0000 (12:41 -0400)
doc/demo/insn.py

index ad77e5de6651f8a73662de83d344484a8c3e7dee..9fc100133a294f8a30254fd8f5d3bb2ad131d2dd 100755 (executable)
@@ -55,7 +55,10 @@ if __name__ == '__main__':
 
     device = _Device(filename=args.filename)
     device.open()
-    subdevice = device.find_subdevice_by_type(_constant.SUBDEVICE_TYPE.ai)
+    if args.subdevice is None:
+        subdevice = device.find_subdevice_by_type(_constant.SUBDEVICE_TYPE.ai)
+    else:
+        subdevice = device.subdevice(args.subdevice)
 
     insns = [subdevice.insn(), subdevice.insn(), subdevice.insn()]
     insns[0].insn = insns[2].insn = _constant.INSN.gtod