-
Notifications
You must be signed in to change notification settings - Fork 53
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
Update to new crates; simplify advanced options #159
Conversation
This reverts commit 574e57b.
Still in draft as I need to address all build failures. |
Also pulled-in the article of @georgik from here. There's a slight difference between the project layout described in the article (Rust lib crate source code is separate from the ESP IDF component C source code) versus what is generated by the template (Rust and C source code mixed in a single, hybrid, ESP-IDF-component-but-also-a-rust-lib-crate thing) which might have to be addressed too. |
Not directly related to the current changes but i want to bring it up while we make changes here. I think a nice addition would be to create two sdkconfig.defaults. I think the option to have two different sdkconfig for release and debug is a good usecase, but the option is in my opinion not visible enough. A good difference between the two would be to set different CONFIG_LOG_MAXIMUM_LEVEL in each. In my simple wifi only test app i shaved 100k flash usage just in strings from this settings. The idea of adding this is merely to promote more, that this options exist. |
Can you show an example how you achieved that? In fact, we might be better off with a single file, and then a bunch of useful options either enabled there, or disabled via a comment. |
I think creating a well configured project and files in it, is a different goal than make the generation process less complex for the user. I am on board if you say that there might be two many options for the user, but that doesn't mean that the setup should not generate "labor intensive" things that the user might want to do. Also we explicitly have a fast path for most users - using the "non-advanced" branch. I mean we labeled them "advanced" options for a reason. Just cutting things and let the user handle the task themself is not an improvement. In the case of of sdkconfigs. We can have two files : Setting different max log levels is just one low hanging fruit. Even if we don't change it up and only have one config file, we should include more settings ( out-commented ) like the different stack_size options for event_task etc / https /wss related / ( uart - usb serial related) and similar. This changes would not create a more or less complex cargo generate matrix. I can try to make a follow up PR with the related changes when this is finished here. |
I'm all for specifically putting some extra options in I do not agree that the purpose of the template is to automate labor intensive tasks and become a swiss army knife. Which is also the original purpose of |
(updated) @SergioGasquez Would appreciate your review. Summary of changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this huge work! Just left a few details in the comments.
Also, it would be good if we find a way to skip the run of impossible CI cases (eg: C6 with esp-idf v4.4) without complicating too much the CI files (ie: duplicating code or adding lots of ifs)
{% unless std -%} | ||
#![no_std] | ||
#![no_main] | ||
{% endunless -%} | ||
use esp_idf_sys as _; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported | ||
{%- if std and hal != "No" %} | ||
use log::*; | ||
{% endif %} | ||
|
||
{%- unless std %} | ||
{% endunless -%} | ||
{% unless std -%} | ||
#[no_mangle] | ||
{%- endunless %} | ||
{% endunless -%} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cant this conditions be joined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Don't want to touch it too much. biggest hurdle is to get the whitespacing right so cargo fmt
does not complain.
Co-authored-by: Sergio Gasquez Arcos <[email protected]>
I agree, good idea, but maybe next time? I barely managed to get this one working. |
Following changes:
esp-idf-*
cratesapp_main
no-op Rust crate with thecargo
drivercmake
driver which might be useful for Rust code which is purely computationalesp-idf-svc
,log
andembuild
(the last as a build dependency); no dependencies when the HAL option is not enabled