From: Frank Mori Hess Date: Thu, 17 Jan 2008 17:10:07 +0000 (+0000) Subject: Updated to use comedi_set_clock_source() wrapper. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=64d656994a9e7f80fab62857c63cfd413c1e4f37;p=comedilib.git Updated to use comedi_set_clock_source() wrapper. --- diff --git a/demo/choose_clock.c b/demo/choose_clock.c index 808fd78..7e05727 100644 --- a/demo/choose_clock.c +++ b/demo/choose_clock.c @@ -36,8 +36,6 @@ int main(int argc, char *argv[]) int retval; lsampl_t clock_selection; struct parsed_options options; - comedi_insn insn; - lsampl_t data[3]; init_parsed_options(&options); options.freq = 0.; @@ -61,17 +59,11 @@ int main(int argc, char *argv[]) { printf("Clock period unspecified.\n"); } - memset(&insn, 0, sizeof(comedi_insn)); - insn.insn = INSN_CONFIG; - insn.subdev = options.subdevice; - insn.data = data; - insn.n = sizeof(data) / sizeof(data[0]); - data[0] = INSN_CONFIG_SET_CLOCK_SRC; - data[1] = clock_selection; - data[2] = period_ns; - retval = comedi_do_insn(device, &insn); - if(retval < 0) comedi_perror("comedi_do_insn"); + retval = comedi_set_clock_source(device, options.subdevice, clock_selection, period_ns); + if(retval < 0) comedi_perror("comedi_set_clock_source"); + + comedi_close(device); return retval; }