[riot-notifications] [RIOT-OS/RIOT] shell_commands: gnrc_netif: only include LoRA options when LoRA PHY is present (#12295)

benpicco notifications at github.com
Tue Sep 24 16:28:51 CEST 2019

### Contribution description

If no LoRA module is used, there is no use in compiling in all the config options for LoRA PHYs.

This saves about 1k of `.text`.

It also slims down the switch case in `_print_netopt`.
Right now, adding only one more entry there will cause an error on AVR:

RIOT/sys/shell/commands/sc_gnrc_netif.c:279:(.text._print_netopt+0x32): relocation truncated to fit: R_AVR_7_PCREL against `no symbol'

This is because there are too many cases and local jumps on that platform can only be so far.

### Testing procedure

Compile e.g. `examples/gnrc_networking` for `samr21-xpro`

#### Before:
   text    data     bss     dec     hex filename
  91512     196   18724  110432   1af60 /home/benpicco/dev/RIOT/examples/gnrc_networking/bin/samr21-xpro/gnrc_networking.elf

#### After:
   text    data     bss     dec     hex filename
  90440     196   18724  109360   1ab30 /home/benpicco/dev/RIOT/examples/gnrc_networking/bin/samr21-xpro/gnrc_networking.elf

Examples using the sx127x module should continue to work.

### Issues/PRs references
this adapts the idea from #12171 to existing code.

In that PR, drivers will select a pseudomodule to indicate which PHY options they support

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


-- Commit Summary --

  * shell_commands: gnrc_netif: only include LoRA options when LoRA PHY is present

-- File Changes --

    M drivers/Makefile.dep (1)
    M makefiles/pseudomodules.inc.mk (1)
    M sys/shell/commands/sc_gnrc_netif.c (13)

-- 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/20190924/4888abf0/attachment.htm>

More information about the notifications mailing list