Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
cm-projects
RIOT
Commits
52690178
Commit
52690178
authored
9 years ago
by
Oleg Hahm
Browse files
Options
Downloads
Plain Diff
Merge pull request #5240 from basilfx/feature/si70xx_improvements
drivers: si70xx: result bugfixes
parents
df574d6f
cf5e4c8f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
drivers/si70xx/si70xx.c
+5
-5
5 additions, 5 deletions
drivers/si70xx/si70xx.c
tests/driver_si70xx/Makefile
+2
-2
2 additions, 2 deletions
tests/driver_si70xx/Makefile
tests/driver_si70xx/main.c
+2
-2
2 additions, 2 deletions
tests/driver_si70xx/main.c
with
9 additions
and
9 deletions
drivers/si70xx/si70xx.c
+
5
−
5
View file @
52690178
...
@@ -84,7 +84,7 @@ int si70xx_init(si70xx_t *dev, i2c_t i2c_dev, uint8_t address)
...
@@ -84,7 +84,7 @@ int si70xx_init(si70xx_t *dev, i2c_t i2c_dev, uint8_t address)
uint16_t
si70xx_get_relative_humidity
(
si70xx_t
*
dev
)
uint16_t
si70xx_get_relative_humidity
(
si70xx_t
*
dev
)
{
{
uint32_t
raw
;
uint32_t
raw
;
u
int
16
_t
humidity
;
int
32
_t
humidity
;
/* perform measurement */
/* perform measurement */
raw
=
si70xx_measure
(
dev
,
SI70XX_MEASURE_RH_HOLD
);
raw
=
si70xx_measure
(
dev
,
SI70XX_MEASURE_RH_HOLD
);
...
@@ -99,7 +99,7 @@ uint16_t si70xx_get_relative_humidity(si70xx_t *dev)
...
@@ -99,7 +99,7 @@ uint16_t si70xx_get_relative_humidity(si70xx_t *dev)
return
10000
;
return
10000
;
}
}
else
{
else
{
return
humidity
;
return
(
uint16_t
)
humidity
;
}
}
}
}
...
@@ -129,8 +129,8 @@ void si70xx_get_both(si70xx_t *dev, uint16_t *humidity, int16_t *temperature)
...
@@ -129,8 +129,8 @@ void si70xx_get_both(si70xx_t *dev, uint16_t *humidity, int16_t *temperature)
uint64_t
si70xx_get_serial
(
si70xx_t
*
dev
)
uint64_t
si70xx_get_serial
(
si70xx_t
*
dev
)
{
{
uint8_t
out
[
2
];
uint8_t
out
[
2
];
uint8_t
in_first
[
8
];
uint8_t
in_first
[
8
]
=
{
0
}
;
uint8_t
in_second
[
8
];
uint8_t
in_second
[
8
]
=
{
0
}
;
/* read the lower bytes */
/* read the lower bytes */
out
[
0
]
=
SI70XX_READ_ID_FIRST_A
;
out
[
0
]
=
SI70XX_READ_ID_FIRST_A
;
...
@@ -165,7 +165,7 @@ uint8_t si70xx_get_id(si70xx_t *dev)
...
@@ -165,7 +165,7 @@ uint8_t si70xx_get_id(si70xx_t *dev)
uint8_t
si70xx_get_revision
(
si70xx_t
*
dev
)
uint8_t
si70xx_get_revision
(
si70xx_t
*
dev
)
{
{
uint8_t
out
[
2
];
uint8_t
out
[
2
];
uint8_t
in
;
uint8_t
in
=
0
;
/* read the revision number */
/* read the revision number */
out
[
0
]
=
SI70XX_READ_REVISION_A
;
out
[
0
]
=
SI70XX_READ_REVISION_A
;
...
...
This diff is collapsed.
Click to expand it.
tests/driver_si70xx/Makefile
+
2
−
2
View file @
52690178
...
@@ -9,8 +9,8 @@ USEMODULE += xtimer
...
@@ -9,8 +9,8 @@ USEMODULE += xtimer
# set default device parameters in case they are undefined
# set default device parameters in case they are undefined
TEST_I2C
?=
0
TEST_I2C
?=
0
TEST_I2C_ADDR
?=
128
TEST_I2C_ADDR
?=
0x80
TEST_PIN_EN
?=
57
TEST_PIN_EN
?=
GPIO_PIN
\(
0,0
\)
# export parameters
# export parameters
CFLAGS
+=
-DTEST_I2C
=
$(
TEST_I2C
)
CFLAGS
+=
-DTEST_I2C
=
$(
TEST_I2C
)
...
...
This diff is collapsed.
Click to expand it.
tests/driver_si70xx/main.c
+
2
−
2
View file @
52690178
...
@@ -103,8 +103,8 @@ int main(void)
...
@@ -103,8 +103,8 @@ int main(void)
both
=
!
both
;
both
=
!
both
;
/* display results */
/* display results */
printf
(
"relative humidity: %d.%d
\n
"
,
humidity
/
100
,
humidity
%
100
);
printf
(
"relative humidity: %d.%
02
d
\n
"
,
humidity
/
100
,
humidity
%
100
);
printf
(
"temperature: %d.%d C
\n
"
,
temperature
/
100
,
temperature
%
100
);
printf
(
"temperature: %d.%
02
d C
\n
"
,
temperature
/
100
,
temperature
%
100
);
/* sleep between measurements */
/* sleep between measurements */
xtimer_usleep
(
1000
*
MS_IN_USEC
);
xtimer_usleep
(
1000
*
MS_IN_USEC
);
...
...
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