[riot-notifications] [RIOT-OS/RIOT] SAUL: Introduce undefined value (#11446)

Leandro Lanzieri 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
None
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11446

-- 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 --

https://github.com/RIOT-OS/RIOT/pull/11446.patch
https://github.com/RIOT-OS/RIOT/pull/11446.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11446
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190425/9be494b6/attachment.html>


More information about the notifications mailing list