Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giulia Facchi
Skyward Boardcore
Commits
d1d686da
Commit
d1d686da
authored
8 years ago
by
Alain Carlucci
Browse files
Options
Downloads
Patches
Plain Diff
[iNemo] Minor fix
parent
4a08faa5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/shared/sensors/iNemo.h
+8
-10
8 additions, 10 deletions
src/shared/sensors/iNemo.h
with
8 additions
and
10 deletions
src/shared/sensors/iNemo.h
+
8
−
10
View file @
d1d686da
...
@@ -39,7 +39,7 @@ public:
...
@@ -39,7 +39,7 @@ public:
iNEMOLSM9DS0
(
uint8_t
accelFullScale
,
uint8_t
gyroFullScale
,
iNEMOLSM9DS0
(
uint8_t
accelFullScale
,
uint8_t
gyroFullScale
,
uint8_t
compassFullScale
)
uint8_t
compassFullScale
)
{
{
accelFS
=
accelFullScale
&
0x7
;
accelFS
=
accelFullScale
&
0x
0
7
;
gyroFS
=
gyroFullScale
&
0x03
;
gyroFS
=
gyroFullScale
&
0x03
;
compassFS
=
compassFullScale
&
0x03
;
compassFS
=
compassFullScale
&
0x03
;
mLastTemp
=
0.0
f
;
mLastTemp
=
0.0
f
;
...
@@ -48,9 +48,9 @@ public:
...
@@ -48,9 +48,9 @@ public:
bool
init
()
bool
init
()
{
{
uint8_t
whoami_g
=
BusG
::
read
(
RegMap
::
WHO_AM_I_G
);
uint8_t
whoami_g
=
BusG
::
read
(
RegMap
::
WHO_AM_I_G
);
uint8_t
whoami_xm
=
Bus
G
::
read
(
RegMap
::
WHO_AM_I_XM
);
uint8_t
whoami_xm
=
Bus
XM
::
read
(
RegMap
::
WHO_AM_I_XM
);
if
((
whoami_g
!=
whoami_g_value
)
|
(
whoami_xm
!=
whoami_
g
_value
)
)
if
((
whoami_g
!=
whoami_g_value
)
|
|
(
whoami_xm
!=
whoami_
xm
_value
)
)
{
{
last_error
=
ERR_NOT_ME
;
last_error
=
ERR_NOT_ME
;
return
false
;
return
false
;
...
@@ -72,13 +72,12 @@ public:
...
@@ -72,13 +72,12 @@ public:
//FIFO enabled, get data after the first low pass filter
//FIFO enabled, get data after the first low pass filter
BusG
::
write
(
CTRL_REG5_G
,
0x00
);
BusG
::
write
(
CTRL_REG5_G
,
0x00
);
BusG
::
write
(
CTRL_REG0_XM
,
0x00
);
//accelerometer configuration
//accelerometer configuration
//reset internal memory
//reset internal memory
Bus
G
::
write
(
CTRL_REG0_XM
,
0x80
);
Bus
XM
::
write
(
CTRL_REG0_XM
,
0x80
);
//1
6
00Hz data rate, continuous update, xyz enabled
//100Hz data rate, continuous update, xyz enabled
BusXM
::
write
(
CTRL_REG1_XM
,
0x
5
7
);
BusXM
::
write
(
CTRL_REG1_XM
,
0x
6
7
);
//antialias filter 773 Hz, normal mode no test
//antialias filter 773 Hz, normal mode no test
BusXM
::
write
(
CTRL_REG2_XM
,
0x00
|
(
accelFS
<<
3
));
BusXM
::
write
(
CTRL_REG2_XM
,
0x00
|
(
accelFS
<<
3
));
...
@@ -101,7 +100,7 @@ public:
...
@@ -101,7 +100,7 @@ public:
std
::
vector
<
SPIRequest
>
buildDMARequest
()
override
std
::
vector
<
SPIRequest
>
buildDMARequest
()
override
{
{
std
::
vector
<
SPIRequest
>
v
=
{
return
{
SPIRequest
(
DMA_GYRO
,
BusG
::
getCSPin
(),
SPIRequest
(
DMA_GYRO
,
BusG
::
getCSPin
(),
{
OUT_X_L_G
|
0xc0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}),
{
OUT_X_L_G
|
0xc0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}),
SPIRequest
(
DMA_ACC
,
BusXM
::
getCSPin
(),
SPIRequest
(
DMA_ACC
,
BusXM
::
getCSPin
(),
...
@@ -111,8 +110,6 @@ public:
...
@@ -111,8 +110,6 @@ public:
SPIRequest
(
DMA_TEMP
,
BusXM
::
getCSPin
(),
SPIRequest
(
DMA_TEMP
,
BusXM
::
getCSPin
(),
{
OUT_TEMP_L_XM
|
0xc0
,
0
,
0
,
0
}),
{
OUT_TEMP_L_XM
|
0xc0
,
0
,
0
,
0
}),
};
};
return
v
;
}
}
void
onDMAUpdate
(
const
SPIRequest
&
req
)
override
void
onDMAUpdate
(
const
SPIRequest
&
req
)
override
...
@@ -121,6 +118,7 @@ public:
...
@@ -121,6 +118,7 @@ public:
int16_t
data
[
3
];
int16_t
data
[
3
];
memcpy
(
data
,
&
r
[
2
],
r
.
size
()
-
2
);
memcpy
(
data
,
&
r
[
2
],
r
.
size
()
-
2
);
// printf("ID: %d --> ", req.id()); memDump(r.data(), r.size());
switch
(
req
.
id
())
switch
(
req
.
id
())
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment