Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EP_AGORA: Add config logic to enable BLE, cell, and LoRa by default #11566

Conversation

trowbridgec
Copy link

Description

This PR changes the default configuration of the Embedded Planet EP_AGORA target to enable all of the connectivity options by default (cellular, BLE, and LoRa). This will require anyone using the target to disable any unwanted connectivity options in their application, but allows for a cleaner config for the example apps.

Disabling cellular connectivity

Add the following to the mbed_app.json file under target_overrides:

"ep-agora.enable-cell": null

Disabling BLE connectivity

Add the following to the mbed_app.json file under target_overrides:

"target.features_remove"     : ["BLE"],
"target.extra_labels_remove" : ["CORDIO", "CORDIO_LL", "NORDIC_CORDIO"],
"target.extra_labels_add"    : ["SOFTDEVICE_NONE"]

Disabling LoRa connectivity

No changes necessary; LoRa connectivity is added/removed via the mbed-semtech-lora-rf-drivers library.

Pull request type

[ ] Fix
[ ] Refactor
[x] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

@trowbridgec
Copy link
Author

@ARMmbed/team-embeddedplanet @maclobdell

@40Grit
Copy link

40Grit commented Sep 25, 2019

@mark-edgeworth any insight yet on how to rig up the build system to more inteligently select what to build?


#if MBED_CONF_NSAPI_PRESENT

#if EP_AGORA_ENABLE_CELL
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any way to only include this file when needed in the build versus #ifdef'ing out its contents?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@40Grit The reason I put the #if in was so that someone can change the ep-agora.enable-cell setting in their mbed_app.json file and toggle whether the contents of this file gets built. I'm not sure how it effects building/linking exactly though...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understand why it's there.

I'm questioning moreso if there is a way around needing to have the ifdef in the sources via build configuration that just doesn't include the file in the build.

Specifically question is for the tools team. But I'm on my personal account so I cannot @mention them.aa

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ARMmbed/mbed-os-tools

Copy link
Contributor

@0xc0170 0xc0170 Sep 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not , we use this also for HAL files #if DEVICE_I2C for instance to exclude boards do not have i2c for instance (sharing common MCU family).

This should be fine

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a reasonable thing to want, but it looks like the build system doesn't support the generic inclusion or exclusion of a file for compilation based on a configuration parameter. It's something we'll consider as we develop the build system in future. For now the #if defined solution looks like the way to do this.

@ciarmcom ciarmcom requested a review from a team September 25, 2019 17:00
@ciarmcom
Copy link
Member

@trowbridgec, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 30, 2019

@40Grit is there anything left for this PR?

I'll run CI meanwhile

@40Grit
Copy link

40Grit commented Sep 30, 2019

it is good

@mbed-ci
Copy link

mbed-ci commented Sep 30, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts


#if MBED_CONF_NSAPI_PRESENT

#if EP_AGORA_ENABLE_CELL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a reasonable thing to want, but it looks like the build system doesn't support the generic inclusion or exclusion of a file for compilation based on a configuration parameter. It's something we'll consider as we develop the build system in future. For now the #if defined solution looks like the way to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants