[riot-notifications] [RIOT-OS/RIOT] SAUL: Introduce undefined value (#11446)
notifications at github.com
Thu Apr 25 14:58:46 CEST 2019
### Contribution description
This PR add a way for SAUL drivers to define a particular value as 'undefined'. When this value is used on a write operation in any dimension of the phydat_t structure, that dimension will be ignored.
The use-case is updating a subset of the dimensions during a writing operation, on a driver that accepts multiple (e.g. a RGB LED driver).
The PR also changes the saul_reg shell command, to use the proper undefined value of the device (previously it was using 0).
### Testing procedure
- Right now there are no drivers that implement the undefined value. To see it in action you can define this value for an actuator (e.g. saul_gpio) and run the saul example application. You should see that, when a dimension is not defined, it value will be the one defined on the driver structure.
- `tests/unittests/tests-saul_reg` should still work
### Issues/PRs references
You can view, comment on, or merge this pull request online at:
-- Commit Summary --
* drivers/saul: Introduce undefined value
* sys/saul_reg: Add function to get undef value
* sys/shell/cmd/saul_reg: Use undef value
-- File Changes --
M drivers/include/saul.h (13)
M sys/include/saul_reg.h (15)
M sys/shell/commands/sc_saul_reg.c (14)
M tests/unittests/tests-saul_reg/tests-saul_reg.c (8)
-- Patch Links --
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications