Skip to content

Set default stdio-baud-rate for all targets #934

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mbed/mbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def hide_progress(max_width=80):
def create_default_mbed_app():
# Default data content
if not os.path.exists(mbed_app_file_name):
data = {'target_overrides':{'K64F':{'platform.stdio-baud-rate': 9600}}}
data = {'target_overrides':{'*':{'platform.stdio-baud-rate': 9600}}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this is needed as the default is defined here https://github.com/ARMmbed/mbed-os/blob/7a085b472b8b0b31755732fe79d9fc54a1c20c20/platform/mbed_lib.json#L24

It would also override other target specific definitions with this app config. However, I'm not sure what the K64F is here at all, perhaps as an example?

Is there a problem you are trying to solve?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The tools should be platform agnostic.
At the moment, if you just run mbed new test and see the mbed_app.json generated inside the project, you'll see:

"target_overrides": {
        "K64F": {
            "platform.stdio-baud-rate": 9600
        }

This is for no good reason creating a configuration for the K64F but many other times I just want to use other platforms.
This PR is just replacing K64F to * to be agnostic and apply the same default-configuration to all platforms.

Copy link
Collaborator

Choose a reason for hiding this comment

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

As it stand the K64F is a strange additional but I'd rather see it removed than making it apply to all platforms.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, shall we remove the whole line?

with open(mbed_app_file_name, "w") as mbed_app_file:
json.dump(data, mbed_app_file, indent=4)

Expand Down