-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add device name environment variable for web workflow #7846
Conversation
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 the PR! One comment on memory allocation.
@@ -329,7 +335,8 @@ void supervisor_start_web_workflow(void) { | |||
mdns_server_construct(&mdns, true); | |||
mdns.base.type = &mdns_server_type; | |||
if (!common_hal_mdns_server_deinited(&mdns)) { | |||
common_hal_mdns_server_set_instance_name(&mdns, MICROPY_HW_BOARD_NAME); | |||
char *instance_name = strndup(web_instance_name, strlen(web_instance_name)); |
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.
I don't think this will work right because we don't usually use malloc()
directly. Instead, I'd just add a static variable to hold the data. Memory allocation is tricky because it can happen via the MP heap or via supervisor.
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, Scott!
Didn't think of the static variable.
Just updated the PR. I tested again with the ESP32-S3. Please let me know if this would work.
Thanks!
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.
Looks good to me now. Thanks!
Thank you! |
Hi,
This PR tries to resolve #7511
settings.toml
template that would need to be updated.cp/version.json
with aadafruit_feather_esp32s3_nopsram
cp/devices.json
because I only have one board with WIFI. It would be great if someone could help testing!Thanks in adnvance!