if (tsl256x_probe_sensor(conf) != 1) {
return -ENODEV;
}
+ msleep(1);
ret = i2c_write(conf->bus_num, cmd_buf, CONF_BUF_SIZE, NULL);
if (ret != CONF_BUF_SIZE) {
conf->probe_ok = 0;
int veml6070_probe_sensor(struct veml6070_sensor_config* conf)
{
char cmd_buf = (conf->addr | I2C_READ_BIT);
+ uint8_t dropped;
/* Did we already probe the sensor ? */
if (conf->probe_ok != 1) {
- conf->probe_ok = i2c_read(conf->bus_num, &cmd_buf, 1, NULL, NULL, 0);
+ conf->probe_ok = i2c_read(conf->bus_num, &cmd_buf, 1, NULL, &dropped, 1);
}
return conf->probe_ok;
}
char cmd_buf =0;
uint8_t data = 0;
- if (veml6070_probe_sensor(conf) != 1) {
- return -ENODEV;
- }
+ if (conf->probe_ok != 1) {
+ if (veml6070_probe_sensor(conf) != 1) {
+ return -ENODEV;
+ }
+ msleep(1);
+ }
if (uv_raw == NULL) {
return -EINVAL;
}