Skip to content

Commit

Permalink
drivers/jc42: move SAUL config to params.h
Browse files Browse the repository at this point in the history
  • Loading branch information
haukepetersen committed Jan 17, 2017
1 parent 232b8eb commit 1394222
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
18 changes: 14 additions & 4 deletions drivers/jc42/include/jc42_params.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2017 Koen Zandberg <koen@bergzand.net>
* 2017 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
Expand All @@ -14,6 +15,7 @@
* @brief Default configuration for jc42
*
* @author Koen Zandberg <koen@bergzand.net>
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/

#ifndef JC42_PARAMS_H
Expand All @@ -31,7 +33,7 @@ extern "C" {
* @{
*/
#ifndef JC42_PARAM_I2C_DEV
#define JC42_PARAM_I2C_DEV (0)
#define JC42_PARAM_I2C_DEV I2C_DEV(0)
#endif
#ifndef JC42_PARAM_ADDR
#define JC42_PARAM_ADDR (0x18)
Expand All @@ -40,9 +42,9 @@ extern "C" {
#define JC42_PARAM_SPEED I2C_SPEED_FAST
#endif

#define JC42_PARAMS_DEFAULT {.i2c = JC42_PARAM_I2C_DEV, \
.speed = JC42_PARAM_SPEED, \
.addr = JC42_PARAM_ADDR }
#define JC42_PARAMS_DEFAULT { .i2c = JC42_PARAM_I2C_DEV, \
.speed = JC42_PARAM_SPEED, \
.addr = JC42_PARAM_ADDR }
/**@}*/

/**
Expand All @@ -57,6 +59,14 @@ static const jc42_params_t jc42_params[] =
#endif
};

/**
* @brief Configure SAUL registry entries
*/
static const saul_reg_info_t jc42_saul_reg_info[] =
{
{ .name= "jc42" }
};

#ifdef __cplusplus
}
#endif
Expand Down
11 changes: 0 additions & 11 deletions sys/auto_init/saul/auto_init_jc42.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,6 @@ static saul_reg_t saul_entries[JC42_NUMOF];
extern const saul_driver_t jc42_temperature_saul_driver;
/** @} */

/**
* @brief Allocate and configure entries to the SAUL registry
*/
saul_reg_t jc42_saul_reg_info[]=
{
{
.name= "jc42",
.driver = &jc42_temperature_saul_driver
}
};

void auto_init_jc42(void)
{
for (unsigned i = 0; i < JC42_NUMOF; i++) {
Expand Down

0 comments on commit 1394222

Please sign in to comment.