Cast the period to an integer in `demo/python/cmd.py`'s command setup.
authorW. Trevor King <wking@drexel.edu>
Tue, 13 Mar 2012 12:58:19 +0000 (08:58 -0400)
committerW. Trevor King <wking@drexel.edu>
Tue, 13 Mar 2012 12:58:19 +0000 (08:58 -0400)
This avoids:

  TypeError: in method 'comedi_get_cmd_generic_timed',
    argument 5 of type 'unsigned int'

demo/python/cmd.py

index 11994b0c93bc1021907bbe40af9a210d825a5e39..46c145101f2b968ed245f574bb76493bf3982389 100755 (executable)
@@ -86,7 +86,8 @@ def dump_cmd(cmd):
 #construct a comedi command
 cmd = c.comedi_cmd_struct()
 
-ret = c.comedi_get_cmd_generic_timed(dev,subdevice,cmd,nchans,1.0e9/freq)
+period = int(1.0e9/freq)  # in nanoseconds
+ret = c.comedi_get_cmd_generic_timed(dev,subdevice,cmd,nchans,period)
 if ret: raise "Error comedi_get_cmd_generic failed"
        
 cmd.chanlist = mylist # adjust for our particular context