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
64da21fa
Unverified
Commit
64da21fa
authored
7 years ago
by
Sebastian Meiling
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #8640 from aabadie/pr/drivers/hts221_fixes
drivers/hts221: minor fixes
parents
21a792dd
6ea16d7d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/include/hts221.h
+3
-3
3 additions, 3 deletions
drivers/include/hts221.h
tests/driver_hts221/main.c
+4
-4
4 additions, 4 deletions
tests/driver_hts221/main.c
with
7 additions
and
7 deletions
drivers/include/hts221.h
+
3
−
3
View file @
64da21fa
...
@@ -94,7 +94,7 @@ int hts221_init(hts221_t *dev, const hts221_params_t *params);
...
@@ -94,7 +94,7 @@ int hts221_init(hts221_t *dev, const hts221_params_t *params);
int
hts221_reboot
(
const
hts221_t
*
dev
);
int
hts221_reboot
(
const
hts221_t
*
dev
);
/**
/**
* @brief Set device to
c
on
tinues
measurement
s
* @brief Set device to on
e shot
measurement
*
*
* @param[in] dev device descriptor of sensor
* @param[in] dev device descriptor of sensor
*
*
...
@@ -103,10 +103,10 @@ int hts221_reboot(const hts221_t *dev);
...
@@ -103,10 +103,10 @@ int hts221_reboot(const hts221_t *dev);
int
hts221_one_shot
(
const
hts221_t
*
dev
);
int
hts221_one_shot
(
const
hts221_t
*
dev
);
/**
/**
* @brief Set device to continu
e
s measurements
* @brief Set device to continu
ou
s measurements
*
*
* @param[in] dev device descriptor of sensor
* @param[in] dev device descriptor of sensor
* @param[in] rate conversion rate for continu
e
s mode
* @param[in] rate conversion rate for continu
ou
s mode
*
*
* @return 0 on success, or error otherwise
* @return 0 on success, or error otherwise
*/
*/
...
...
This diff is collapsed.
Click to expand it.
tests/driver_hts221/main.c
+
4
−
4
View file @
64da21fa
...
@@ -47,17 +47,17 @@ int main(void)
...
@@ -47,17 +47,17 @@ int main(void)
uint16_t
hum
=
0
;
uint16_t
hum
=
0
;
int16_t
temp
=
0
;
int16_t
temp
=
0
;
if
(
hts221_read_humidity
(
&
dev
,
&
hum
)
!=
HTS221_OK
)
{
if
(
hts221_read_humidity
(
&
dev
,
&
hum
)
!=
HTS221_OK
)
{
puts
(
" -- failed to humidity!"
);
puts
(
" -- failed to
read
humidity!"
);
}
}
if
(
hts221_read_temperature
(
&
dev
,
&
temp
)
!=
HTS221_OK
)
{
if
(
hts221_read_temperature
(
&
dev
,
&
temp
)
!=
HTS221_OK
)
{
puts
(
" -- failed to temperature!"
);
puts
(
" -- failed to
read
temperature!"
);
}
}
bool
negative
=
(
temp
<
0
);
bool
negative
=
(
temp
<
0
);
if
(
negative
)
{
if
(
negative
)
{
temp
=
-
temp
;
temp
=
-
temp
;
}
}
printf
(
"H: %u.%u%%, T:%c%u.%u°C
\n
"
,
(
hum
/
10
),
(
hum
%
10
),
printf
(
"H: %u.%u%%, T:%c%u.%u°C
\n
"
,
(
hum
/
10
),
(
hum
%
10
),
(
negative
?
'-'
:
' '
),
(
temp
/
10
),
(
temp
%
10
));
(
negative
?
'-'
:
' '
),
(
temp
/
10
),
(
temp
%
10
));
xtimer_sleep
(
SLEEP_S
);
xtimer_sleep
(
SLEEP_S
);
}
}
return
0
;
return
0
;
...
...
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