[riot-notifications] [RIOT-OS/RIOT] sx127x: remove MULTIDIO and fix missing interrupt handling (#11798)

José Alamos notifications at github.com
Thu Jul 4 17:43:08 CEST 2019

The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.

### Contribution description
This PR removes the MULTIDIO feature introduced in https://github.com/RIOT-OS/RIOT/pull/9815 and fixes a missing interrupt handling for some boards (sensebox_samd21).

Instead of having a dedicated case for boards that don't include all DIO lines, now the ISR flags are always read in the `netdev->driver->isr` function. Hence, the MULTIDIO feature is not needed anymore.

Since the SenseBox doesn't provide DIO3 the RX_STARTED event was never triggered (but the corresponding ISR flag 0x4 was updated). When the RX_DONE triggered (0x1), the handler was not called because the ISR flags byte was (0x4 | 0x1) = 0x5 and was indeed not handled in the switch-case.
This PR changes this switch-case pattern to `if(isr & EVENT_FLAG) { handle_event(...)}`
Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes

### Testing procedure
Run `tests/pkg_semtech_loramac` and `tests/driver_sx127x` and verify common LoRa and LoRaWAN stuff work (joining a network, changing frequency, etc).

Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output

### Issues/PRs references

Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.

You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * sx127x: remove DIOMULTI
  * boards/sensebox_samd21: remove DIOMULTI from pin configuration
  * sx127x_netdev: remove switch-case from ISR handler

-- File Changes --

    M boards/sensebox_samd21/Makefile.include (2)
    M boards/sensebox_samd21/include/board.h (8)
    M drivers/include/sx127x.h (6)
    M drivers/sx127x/include/sx127x_params.h (16)
    M drivers/sx127x/sx127x.c (30)
    M drivers/sx127x/sx127x_netdev.c (64)

-- 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...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190704/ca22361f/attachment.html>

More information about the notifications mailing list