mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-24 14:03:55 +01:00
sys/auto_init: update tcs37727 auto_init
This commit is contained in:
parent
a48a90f234
commit
a85fbd2c75
@ -81,11 +81,6 @@ enum {
|
||||
TCS37727_NODEV = -2 /**< no TCS37727 device found on the bus */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Export the sensor's SAUL interface
|
||||
*/
|
||||
extern const saul_driver_t tcs37727_saul_driver;
|
||||
|
||||
/**
|
||||
* @brief Initialize the given TCS37727 sensor
|
||||
*
|
||||
|
||||
@ -41,13 +41,25 @@ static tcs37727_t tcs37727_devs[TCS37727_NUM];
|
||||
*/
|
||||
static saul_reg_t saul_entries[TCS37727_NUM];
|
||||
|
||||
/**
|
||||
* @brief Define the number of saul info
|
||||
*/
|
||||
#define TCS37727_INFO_NUM (sizeof(tcs37727_saul_info) / sizeof(tcs37727_saul_info[0]))
|
||||
|
||||
/**
|
||||
* @brief Export the sensor's SAUL interface
|
||||
*/
|
||||
extern const saul_driver_t tcs37727_saul_driver;
|
||||
|
||||
void auto_init_tcs37727(void)
|
||||
{
|
||||
assert(TCS37727_NUM == TCS37727_INFO_NUM);
|
||||
|
||||
for (unsigned i = 0; i < TCS37727_NUM; i++) {
|
||||
LOG_DEBUG("[auto_init_saul] initializing tcs29020 #%u\n", i);
|
||||
|
||||
int res = tcs37727_init(&tcs37727_devs[i], &tcs37727_params[i]);
|
||||
if (res != TCS37727_OK) {
|
||||
if (tcs37727_init(&tcs37727_devs[i],
|
||||
&tcs37727_params[i]) != TCS37727_OK) {
|
||||
LOG_ERROR("[auto_init_saul] error initializing tcs37727 #%u\n", i);
|
||||
continue;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user