mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #12863 from bergzand/pr/saul/ignore_extra_dims
saul: Ignore extra dimensions in read functions
This commit is contained in:
commit
5c6410b594
@ -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…
Reference in New Issue
Block a user