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
902d8946
Commit
902d8946
authored
7 years ago
by
Alexandre Abadie
Browse files
Options
Downloads
Patches
Plain Diff
sys/auto_init: cleanup si70xx auto_init
parent
19cf25c7
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/si70xx/include/si70xx_params.h
+2
-2
2 additions, 2 deletions
drivers/si70xx/include/si70xx_params.h
sys/auto_init/saul/auto_init_si70xx.c
+9
-9
9 additions, 9 deletions
sys/auto_init/saul/auto_init_si70xx.c
with
11 additions
and
11 deletions
drivers/si70xx/include/si70xx_params.h
+
2
−
2
View file @
902d8946
...
@@ -42,7 +42,7 @@ extern "C" {
...
@@ -42,7 +42,7 @@ extern "C" {
#endif
#endif
#ifndef SI70XX_PARAMS
#ifndef SI70XX_PARAMS
#define SI70XX_PARAMS { .i2c_dev = SI70XX_PARAM_I2C_DEV,
\
#define SI70XX_PARAMS { .i2c_dev = SI70XX_PARAM_I2C_DEV, \
.address = SI70XX_PARAM_ADDR }
.address = SI70XX_PARAM_ADDR }
#endif
#endif
#ifndef SI70XX_SAUL_INFO
#ifndef SI70XX_SAUL_INFO
...
@@ -61,7 +61,7 @@ static const si70xx_params_t si70xx_params[] =
...
@@ -61,7 +61,7 @@ static const si70xx_params_t si70xx_params[] =
/**
/**
* @brief Configure SAUL registry entries
* @brief Configure SAUL registry entries
*/
*/
static
const
saul_reg_info_t
si70xx_saul_
reg_
info
[]
=
static
const
saul_reg_info_t
si70xx_saul_info
[]
=
{
{
SI70XX_SAUL_INFO
SI70XX_SAUL_INFO
};
};
...
...
This diff is collapsed.
Click to expand it.
sys/auto_init/saul/auto_init_si70xx.c
+
9
−
9
View file @
902d8946
...
@@ -28,25 +28,25 @@
...
@@ -28,25 +28,25 @@
/**
/**
* @brief Define the number of configured sensors
* @brief Define the number of configured sensors
*/
*/
#define SI70XX_NUM
OF
(sizeof(si70xx_params) / sizeof(si70xx_params[0]))
#define SI70XX_NUM (sizeof(si70xx_params) / sizeof(si70xx_params[0]))
/**
/**
* @brief Allocation of memory for device descriptors
* @brief Allocation of memory for device descriptors
*/
*/
static
si70xx_t
si70xx_devs
[
SI70XX_NUM
OF
];
static
si70xx_t
si70xx_devs
[
SI70XX_NUM
];
/**
/**
* @brief Memory for the SAUL registry entries
* @brief Memory for the SAUL registry entries
*/
*/
static
saul_reg_t
saul_entries
[
SI70XX_NUM
OF
*
2
];
static
saul_reg_t
saul_entries
[
SI70XX_NUM
*
2
];
/**
/**
* @brief Define the number of saul info
* @brief Define the number of saul info
*/
*/
#define SI70XX_INFO_NUM
OF
(sizeof(si70xx_saul_
reg_
info) / sizeof(si70xx_saul_
reg_
info[0]))
#define SI70XX_INFO_NUM (sizeof(si70xx_saul_info) / sizeof(si70xx_saul_info[0]))
/**
/**
* @
brief
Reference the driver structs.
* @
name
Reference the driver structs.
* @{
* @{
*/
*/
extern
const
saul_driver_t
si70xx_temperature_saul_driver
;
extern
const
saul_driver_t
si70xx_temperature_saul_driver
;
...
@@ -55,9 +55,9 @@ extern const saul_driver_t si70xx_relative_humidity_saul_driver;
...
@@ -55,9 +55,9 @@ extern const saul_driver_t si70xx_relative_humidity_saul_driver;
void
auto_init_si70xx
(
void
)
void
auto_init_si70xx
(
void
)
{
{
assert
(
SI70XX_INFO_NUM
OF
==
SI70XX_NUM
OF
);
assert
(
SI70XX_INFO_NUM
==
SI70XX_NUM
);
for
(
unsigned
i
=
0
;
i
<
SI70XX_NUM
OF
;
i
++
)
{
for
(
unsigned
i
=
0
;
i
<
SI70XX_NUM
;
i
++
)
{
LOG_DEBUG
(
"[auto_init_saul] initializing SI70xx #%u
\n
"
,
i
);
LOG_DEBUG
(
"[auto_init_saul] initializing SI70xx #%u
\n
"
,
i
);
if
(
si70xx_init
(
&
si70xx_devs
[
i
],
&
si70xx_params
[
i
])
!=
SI70XX_OK
)
{
if
(
si70xx_init
(
&
si70xx_devs
[
i
],
&
si70xx_params
[
i
])
!=
SI70XX_OK
)
{
...
@@ -67,12 +67,12 @@ void auto_init_si70xx(void)
...
@@ -67,12 +67,12 @@ void auto_init_si70xx(void)
/* temperature */
/* temperature */
saul_entries
[
i
*
2
].
dev
=
&
si70xx_devs
[
i
];
saul_entries
[
i
*
2
].
dev
=
&
si70xx_devs
[
i
];
saul_entries
[
i
*
2
].
name
=
si70xx_saul_
reg_
info
[
i
].
name
;
saul_entries
[
i
*
2
].
name
=
si70xx_saul_info
[
i
].
name
;
saul_entries
[
i
*
2
].
driver
=
&
si70xx_temperature_saul_driver
;
saul_entries
[
i
*
2
].
driver
=
&
si70xx_temperature_saul_driver
;
/* relative humidity */
/* relative humidity */
saul_entries
[(
i
*
2
)
+
1
].
dev
=
&
si70xx_devs
[
i
];
saul_entries
[(
i
*
2
)
+
1
].
dev
=
&
si70xx_devs
[
i
];
saul_entries
[(
i
*
2
)
+
1
].
name
=
si70xx_saul_
reg_
info
[
i
].
name
;
saul_entries
[(
i
*
2
)
+
1
].
name
=
si70xx_saul_info
[
i
].
name
;
saul_entries
[(
i
*
2
)
+
1
].
driver
=
\
saul_entries
[(
i
*
2
)
+
1
].
driver
=
\
&
si70xx_relative_humidity_saul_driver
;
&
si70xx_relative_humidity_saul_driver
;
...
...
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