~ubuntu-branches/ubuntu/utopic/xoscope/utopic

« back to all changes in this revision

Viewing changes to proscope.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-08-19 19:20:20 UTC
  • mfrom: (4.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20090819192020-v01rqhdun22wwaxo
* Upload to unstable.
* Add build-dep on libcomedi-dev Closes: #508694
* Bump standards-version to 3.8.3. No other Changes.
* Remove 01-xoscope_pointer_fix.patch as per Gudjon's request
* Rename 02-comedi_compile.patch to 01-comedi_compile.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * @(#)$Id: proscope.c,v 1.10 2005/06/23 21:33:23 baccala Exp $
 
2
 * @(#)$Id: proscope.c,v 2.1 2009/01/15 07:05:59 baccala Exp $
3
3
 *
4
4
 * Copyright (C) 1997 - 2000 Tim Witham <twitham@quiknet.com>
5
5
 *
58
58
  ps.trigger = ps.level = ps.dvm = ps.flags = 0;
59
59
  ps.coupling = "?";
60
60
 
 
61
  ps.probed = 1;
 
62
 
 
63
  ps_signal.width = 128;
 
64
  if (ps_signal.data == NULL) ps_signal.data = malloc(128 * sizeof(short));
 
65
 
61
66
  return init_serial_probescope();
62
67
}
63
68
 
69
74
 
70
75
static int nchans(void)
71
76
{
72
 
  if (!ps.found) open_probescope();
 
77
  if (!ps.found && !ps.probed) open_probescope();
73
78
 
74
79
  return ps.found ? 1 : 0;
75
80
}
88
93
 
89
94
static void reset(void)
90
95
{
 
96
  ps.probed = 0;
91
97
}
92
98
 
93
99
/* get one set of bytes from the ProbeScope, if possible */
178
184
  ps_signal.data[0] = ps_signal.data[1];
179
185
  ps_signal.frame ++;
180
186
  ps_signal.num = 128;
181
 
  ps_signal.width = 128;
 
187
 
182
188
  if (gotdvm) ps.dvm = dvm;
183
189
  if (cls) clear();             /* non-DVM text need changed? */
184
190
  if (flush) flush_serial(psfd);        /* catch up if we're getting behind */
189
195
{
190
196
  static char string[81];
191
197
 
 
198
  if (ps.probed && !ps.found) {
 
199
    switch (i) {
 
200
    case 0:
 
201
      return split_field(serial_error, 0, 16);
 
202
    case 2:
 
203
      return split_field(serial_error, 1, 16);
 
204
    default:
 
205
      return "";
 
206
    }
 
207
  }
 
208
 
 
209
  if (!ps.found) return "";
 
210
 
192
211
  switch(i) {
193
212
 
194
213
  case 0: