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
39533eb2
Commit
39533eb2
authored
9 years ago
by
Kaspar Schleiser
Browse files
Options
Downloads
Patches
Plain Diff
drivers: hih6130: switch to xtimer
parent
ada06e9d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile.dep
+1
-1
1 addition, 1 deletion
Makefile.dep
drivers/hih6130/hih6130.c
+3
-5
3 additions, 5 deletions
drivers/hih6130/hih6130.c
tests/driver_hih6130/Makefile
+1
-1
1 addition, 1 deletion
tests/driver_hih6130/Makefile
tests/driver_hih6130/main.c
+2
-2
2 additions, 2 deletions
tests/driver_hih6130/main.c
with
7 additions
and
9 deletions
Makefile.dep
+
1
−
1
View file @
39533eb2
...
...
@@ -330,7 +330,7 @@ ifneq (,$(filter gnrc_netdev2,$(USEMODULE)))
endif
ifneq
(,$(filter hih6130,$(USEMODULE)))
USEMODULE
+=
v
timer
USEMODULE
+=
x
timer
endif
ifneq
(,$(filter encx24j600,$(USEMODULE)))
...
...
This diff is collapsed.
Click to expand it.
drivers/hih6130/hih6130.c
+
3
−
5
View file @
39533eb2
...
...
@@ -24,8 +24,7 @@
#include
"hih6130.h"
#include
"periph/i2c.h"
#include
"timex.h"
#include
"vtimer.h"
#include
"xtimer.h"
#define ENABLE_DEBUG (0)
#include
"debug.h"
...
...
@@ -53,8 +52,7 @@ enum {
};
/** @brief Delay between requesting a measurement and data becoming ready */
static
const
timex_t
measurement_delay
=
{
.
seconds
=
0
,
.
microseconds
=
50
*
MS_IN_USEC
,
};
#define MEASUREMENT_DELAY (50*1000)
/** @brief Trigger a new measurement on the sensor */
static
inline
int
hih6130_measurement_request
(
hih6130_t
*
dev
)
...
...
@@ -121,7 +119,7 @@ int hih6130_get_humidity_temperature_float(hih6130_t *dev,
return
-
1
;
}
v
timer_sleep
(
measurement_delay
);
x
timer_
u
sleep
(
MEASUREMENT_DELAY
);
status
=
hih6130_get_humidity_temperature_raw
(
dev
,
&
hum_raw
,
&
temp_raw
);
...
...
This diff is collapsed.
Click to expand it.
tests/driver_hih6130/Makefile
+
1
−
1
View file @
39533eb2
...
...
@@ -4,7 +4,7 @@ include ../Makefile.tests_common
FEATURES_REQUIRED
=
periph_i2c
USEMODULE
+=
hih6130
USEMODULE
+=
v
timer
USEMODULE
+=
x
timer
ifneq
(,$(TEST_HIH6130_I2C))
CFLAGS
+=
-DTEST_HIH6130_I2C
=
$(
TEST_HIH6130_I2C
)
...
...
This diff is collapsed.
Click to expand it.
tests/driver_hih6130/main.c
+
2
−
2
View file @
39533eb2
...
...
@@ -29,7 +29,7 @@
#include
<stdlib.h>
#include
<math.h>
#include
"
v
timer.h"
#include
"
x
timer.h"
#include
"hih6130.h"
#define SLEEP (100 * 1000U)
...
...
@@ -58,7 +58,7 @@ int main(void)
float
integral
=
0
.
f
;
float
fractional
;
v
timer_usleep
(
SLEEP
);
x
timer_usleep
(
SLEEP
);
status
=
hih6130_get_humidity_temperature_float
(
&
dev
,
&
hum
,
&
temp
);
if
(
status
<
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