saul: Ignore extra dimensions in read functions
This commit is contained in:
parent
2f74d9d644
commit
cae369bc52
@ -30,8 +30,6 @@ static int read_adc(const void *dev, phydat_t *res)
|
||||
{
|
||||
const saul_adc_params_t *params = *((const saul_adc_params_t **)dev);
|
||||
res->val[0] = adc_sample(params->line, params->res);
|
||||
res->val[1] = 0;
|
||||
res->val[2] = 0;
|
||||
/* Raw ADC reading has no unit */
|
||||
res->unit = UNIT_NONE;
|
||||
res->scale = 0;
|
||||
|
||||
@ -33,8 +33,6 @@ static int read(const void *dev, phydat_t *res)
|
||||
|
||||
res->val[0] = (gpio_read(p->pin)) ? !inverted : inverted;
|
||||
|
||||
res->val[1] = 0;
|
||||
res->val[2] = 0;
|
||||
res->unit = UNIT_BOOL;
|
||||
res->scale = 0;
|
||||
return 1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user