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
db2237db
Commit
db2237db
authored
Nov 06, 2018
by
Achim Morschhauser
Browse files
Update
parent
562ddd93
Changes
5
Hide whitespace changes
Inline
Side-by-side
include/driver_obs_obsdaq.hpp
View file @
db2237db
...
...
@@ -52,7 +52,6 @@ int quartz_freq;
double
M
;
/** Digital filter output rates */
//TODO Make unordered map
double
valid_filter_rates
[
11
];
static
const
int
valid_filter_rates_num
=
11
;
const
char
*
filter_cmds
[
11
];
...
...
src/Driver_Obs_Serial.cpp
View file @
db2237db
...
...
@@ -232,7 +232,6 @@ int Driver_Obs_Serial::set_baud(char* init_chars[], int init_chars_num) {
break
;
}
//printf("VB: %d",valid_baudrates_size);
// This has to be in loop as characters received at false baud rate
...
...
src/driver_obs_obsdaq.cpp
View file @
db2237db
...
...
@@ -114,15 +114,10 @@ driver_obs_obsdaq::driver_obs_obsdaq(std::string port, int baud,
// Set the ObsDAQ baud rate
*/
// Stop the measurement
stop
();
}
*/
// Set baud rate
set_baud
(
baud
);
// Initialize
init
();
...
...
@@ -435,12 +430,15 @@ int driver_obs_obsdaq::auto_calibrate(int channel, int repeat){
send
(
"#PP00000000"
);
usleep
(
1e6
);
/////////////////////////////////////////////////////////////////////////
//
// Calibration
//
/////////////////////////////////////////////////////////////////////////
//
// Repeat calibration step
//
for
(
int
k
=
1
;
k
<=
repeat
;
k
++
){
...
...
@@ -462,13 +460,12 @@ int driver_obs_obsdaq::auto_calibrate(int channel, int repeat){
sprintf
(
cmd
,
"$%1dRO"
,
channel
);
send
(
cmd
);
//TODO Repeat loop instead of just omitting
if
(
receive
(
recv
,
sizeof
(
recv
),
5
)
==
0
)
{
// Parse the offset value and add to average
n32
=
(
uint32_t
)
strtoul
(
&
recv
[
3
],
NULL
,
16
);
num
=
0x800000L
;
offset
+=
(
double
)
(
n32
^
num
)
-
(
double
)
num
;
offset
+=
(
double
)
(
n32
^
num
)
-
(
double
)
num
;
}
// Necessary to avoid time outs
...
...
@@ -478,7 +475,6 @@ int driver_obs_obsdaq::auto_calibrate(int channel, int repeat){
sprintf
(
cmd
,
"$%1dRF"
,
channel
);
send
(
cmd
);
//TODO Repeat loop instead of just omitting
if
(
receive
(
recv
,
sizeof
(
recv
),
5
)
==
0
)
{
// Parse the full-scale value and add to average
...
...
@@ -809,7 +805,7 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
//
// Some checks on data consistency are performed
//
// Check for supplementary channels
if
(
buf
[
1
]
&
(
unsigned
char
)
64
){
reclen
=
14
;
...
...
usr/Serial_Talk.cpp
View file @
db2237db
...
...
@@ -21,7 +21,7 @@ int main(){
std
::
cout
<<
"BAUD: "
;
std
::
cin
>>
baud
;
driver_serial
serial
=
driver_serial
(
"/dev/ttyUSB
1
"
,
term
,
1
,
baud
);
driver_serial
serial
=
driver_serial
(
"/dev/ttyUSB
0
"
,
term
,
1
,
baud
);
while
(
1
){
...
...
usr/parameters.par
View file @
db2237db
# Baudrate for ObsDAQ
BAUD=
384
00 #19200
(Default)
BAUD=
192
00 #19200
# PORT for ObsDAQ
PORT=/dev/ttyUSB0
# Resistance of variometer
...
...
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