Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Achim Morschhauser
GeomagLogger
Commits
495ec6b4
Commit
495ec6b4
authored
Nov 13, 2018
by
Achim Morschhauser
Browse files
ADC calibrate
#4
checked_send
parent
f9e32a76
Changes
3
Hide whitespace changes
Inline
Side-by-side
Makefile.dynamic
View file @
495ec6b4
...
...
@@ -23,7 +23,7 @@ EXCL=driver_serial_emulate.o
.SECONDARY
:
all
:
$(USR_TARGET:%=$(BIN_DIR)%)
$(LIB_DIR)libLogger.so
all
:
$(LIB_DIR)libLogger.so
$(USR_TARGET:%=$(BIN_DIR)%)
%
:
$(BIN_DIR)%
@
echo
----
DONE
----
...
...
src/data_obs.cpp
View file @
495ec6b4
...
...
@@ -87,6 +87,8 @@ int data_obs::set_time(data_obs* data) {
this
->
min
=
data
->
min
;
this
->
sec
=
data
->
sec
;
this
->
msec
=
data
->
msec
;
return
(
0
);
}
...
...
src/driver_obs_obsdaq.cpp
View file @
495ec6b4
...
...
@@ -1047,7 +1047,8 @@ int driver_obs_obsdaq::init() {
int
driver_obs_obsdaq
::
init_run
(
double
freq
){
// The receive buffer
std
::
string
recv
;
//std::string recv;
char
recv
[
20
]
=
""
;
// A command to send
char
cmd
[
20
];
// Index of the selected frequency
...
...
@@ -1082,7 +1083,8 @@ int driver_obs_obsdaq::init_run(double freq){
// Set range to +10V and set frequency of digital filter
for
(
int
i
=
0
;
i
<
3
;
i
++
){
sprintf
(
cmd
,
"$%1dWS020102%s"
,
i
,
filter_cmds
[
freq_sel
]);
send
(
cmd
);
waitanswer
(
5
);
send
(
cmd
);
waitanswer
(
5
);
}
// Print used and requested frequency
...
...
@@ -1101,11 +1103,13 @@ int driver_obs_obsdaq::init_run(double freq){
for
(
int
i
=
0
;
i
<
3
;
i
++
){
// Get current 24-bit configuration (Manual 12.4.9)
sprintf
(
cmd
,
"$%1dRS"
,
i
);
checked_send
(
cmd
,
"02"
,
2
,
1
,
&
recv
);
send
(
cmd
);
receive
(
recv
,
sizeof
(
recv
),
5
);
//checked_send(cmd,"02",2,1,&recv,1);
std
::
cout
<<
"REC CONFIG: "
<<
recv
<<
std
::
endl
;
// Get the last four bytes ("ccdd") and add channel number
config
=
sn
+
"/"
+
recv
.
substr
(
2
,
4
)
+
"/"
+
std
::
to_string
(
i
);
config
=
sn
+
"/"
+
recv
[
2
,
4
]
+
"/"
+
std
::
to_string
(
i
);
fprintf
(
stderr
,
"----- CONFIG: %s
\n
"
,
config
.
c_str
());
// Check if calibration for the given config
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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