Browse Source

drivers, jc42: fix constness in jc42_init

master
smlng 6 years ago
parent
commit
5fa123c8a2
  1. 2
      drivers/include/jc42.h
  2. 2
      drivers/jc42/jc42.c
  3. 4
      sys/auto_init/saul/auto_init_jc42.c

2
drivers/include/jc42.h

@ -81,7 +81,7 @@ extern const saul_driver_t jc42_temperature_saul_driver;
* @return 0 on success
* @return -1 on error
*/
int jc42_init(jc42_t* dev, jc42_params_t* params);
int jc42_init(jc42_t* dev, const jc42_params_t* params);
/**
* @brief Get content of configuration register

2
drivers/jc42/jc42.c

@ -78,7 +78,7 @@ int jc42_get_temperature(const jc42_t* dev, int16_t* temperature)
return JC42_OK;
}
int jc42_init(jc42_t* dev, jc42_params_t* params)
int jc42_init(jc42_t* dev, const jc42_params_t* params)
{
uint16_t config;
dev->i2c = params->i2c;

4
sys/auto_init/saul/auto_init_jc42.c

@ -50,11 +50,9 @@ extern const saul_driver_t jc42_temperature_saul_driver;
void auto_init_jc42(void)
{
for (unsigned i = 0; i < JC42_NUMOF; i++) {
const jc42_params_t *p = &jc42_params[i];
LOG_DEBUG("[auto_init_saul] initializing jc42 #%u\n", i);
if (jc42_init(&jc42_devs[i], (jc42_params_t*) p) < 0) {
if (jc42_init(&jc42_devs[i], &jc42_params[i]) < 0) {
LOG_ERROR("[auto_init_saul] error initializing jc42 #%u\n", i);
continue;
}

Loading…
Cancel
Save