Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
8f3607b6
Commit
8f3607b6
authored
Apr 07, 2009
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge with mutabor/master
parent
d3160321
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
uniset.spec
conf/uniset.spec
+7
-1
ComediInterface.cc
extentions/IOControl/ComediInterface.cc
+6
-3
No files found.
conf/uniset.spec
View file @
8f3607b6
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
Name: uniset
Name: uniset
Version: 0.96
Version: 0.96
Release: eter
3
Release: eter
5
Summary: UniSet
Summary: UniSet
License: GPL
License: GPL
Group: Development/C++
Group: Development/C++
...
@@ -180,6 +180,12 @@ Libraries needed to develop for uniset extentions
...
@@ -180,6 +180,12 @@ Libraries needed to develop for uniset extentions
%changelog
%changelog
* Mon Apr 06 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-eter4
- new ComediInterface
* Mon Apr 06 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-eter3
- merge with mutabor/master
* Mon Apr 06 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-eter2
* Mon Apr 06 2009 Pavel Vainerman <pv@altlinux.ru> 0.96-eter2
- fixed bugs in uniset-codegen
- fixed bugs in uniset-codegen
...
...
extentions/IOControl/ComediInterface.cc
View file @
8f3607b6
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#include <sstream>
#include <sstream>
#include <cstdlib>
#include <cstdlib>
#include <cstring>
#include <cstring>
#include <alloca.h>
#include "ComediInterface.h"
#include "ComediInterface.h"
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
using
namespace
UniSetTypes
;
using
namespace
UniSetTypes
;
...
@@ -47,7 +46,7 @@ int ComediInterface::getAnalogChannel( int subdev, int channel, int range, int a
...
@@ -47,7 +46,7 @@ int ComediInterface::getAnalogChannel( int subdev, int channel, int range, int a
std
::
vector
<
lsampl_t
>
ComediInterface
::
getAnalogPacket
(
int
subdev
,
int
channel
,
int
range
,
int
aref
)
std
::
vector
<
lsampl_t
>
ComediInterface
::
getAnalogPacket
(
int
subdev
,
int
channel
,
int
range
,
int
aref
)
throw
(
UniSetTypes
::
Exception
)
throw
(
UniSetTypes
::
Exception
)
{
{
lsampl_t
*
data
=
(
lsampl_t
*
)
alloca
(
1024
)
;
/* FIFO size, maximum possible samples */
lsampl_t
*
data
=
new
lsampl_t
[
1024
]
;
/* FIFO size, maximum possible samples */
comedi_insn
insn
;
comedi_insn
insn
;
memset
(
&
insn
,
0
,
sizeof
(
insn
));
memset
(
&
insn
,
0
,
sizeof
(
insn
));
...
@@ -60,18 +59,22 @@ std::vector<lsampl_t> ComediInterface::getAnalogPacket( int subdev, int channel,
...
@@ -60,18 +59,22 @@ std::vector<lsampl_t> ComediInterface::getAnalogPacket( int subdev, int channel,
int
ret
=
comedi_do_insn
(
card
,
&
insn
);
int
ret
=
comedi_do_insn
(
card
,
&
insn
);
if
(
ret
<
0
)
if
(
ret
<
0
)
{
{
delete
data
;
ostringstream
err
;
ostringstream
err
;
err
<<
"(ComediInterface:getAnalogPacket): can`t read data from subdev="
<<
subdev
err
<<
"(ComediInterface:getAnalogPacket): can`t read data from subdev="
<<
subdev
<<
" channel="
<<
channel
<<
" range="
<<
range
<<
" aref="
<<
aref
<<
" channel="
<<
channel
<<
" range="
<<
range
<<
" aref="
<<
aref
<<
" err: "
<<
ret
<<
" ("
<<
strerror
(
ret
)
<<
")"
;
<<
" err: "
<<
ret
<<
" ("
<<
strerror
(
ret
)
<<
")"
;
throw
Exception
(
err
.
str
());
throw
Exception
(
err
.
str
());
return
std
::
vector
<
lsampl_t
>
(
0
);
//
return std::vector<lsampl_t>(0);
}
}
std
::
vector
<
lsampl_t
>
result
(
ret
);
std
::
vector
<
lsampl_t
>
result
(
ret
);
if
(
ret
>
0
)
if
(
ret
>
0
)
memcpy
(
&
result
[
0
],
data
,
ret
*
sizeof
(
lsampl_t
));
memcpy
(
&
result
[
0
],
data
,
ret
*
sizeof
(
lsampl_t
));
delete
data
;
return
result
;
return
result
;
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment