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

OTA_SIZE_UNKNOWN is u32 while esp_ota_begin now wants usize #217

Closed
faern opened this issue Jul 4, 2023 · 1 comment
Closed

OTA_SIZE_UNKNOWN is u32 while esp_ota_begin now wants usize #217

faern opened this issue Jul 4, 2023 · 1 comment

Comments

@faern
Copy link
Contributor

faern commented Jul 4, 2023

In esp-idf-sys 0.32.0 the argument image_size of esp_ota_begin became a usize rather than a u32. But the constant OTA_SIZE_UNKNOWN is still a u32. This means that the place where the constant is supposed to be used, it's not compatible. I can of course just cast it, but it would be more ergonomic if they had the same types.

@ivmarkov
Copy link
Collaborator

ivmarkov commented Oct 3, 2023

esp-idf-sys is really just raw bindings. Specifically OTA_SIZE_UKNOWN is probably a #define and as such the Rust bindgen utility does not really know its type, and arbitrary defines these as either i32 and u32.

Under some special circumstances, we can force bindgen - for selected C macros - to derive a different type, but this is a manual effort for each such constant, and as such, we only do it for constants which are used very often. I don't think OTA_SIZE_UNKNOWN can be justified to fall into this category.

@ivmarkov ivmarkov closed this as completed Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants