fix: update mp_obj_int_to_bytes implementation for correct byte conve… - #412
Closed
132xyz wants to merge 1 commit into
Closed
fix: update mp_obj_int_to_bytes implementation for correct byte conve…#412132xyz wants to merge 1 commit into
132xyz wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MicroPython commit
e00daa3a5replaced the internalmp_obj_int_to_bytes_impl()API withmp_obj_int_to_bytes().The binding generator still emits a call to the removed API, which causes
generated
lv_mp.cfiles to fail compilation against the current MicroPythonmasterbranch:This PR updates mp_obj_get_ull() to use the new API:
The last two arguments keep the conversion unsigned and preserve the previous
non-overflow-checking/truncation behavior. This is consistent with the migration
of the equivalent unsigned long long conversion in MicroPython's modffi.c.
MicroPython change:
micropython/micropython@e00daa3
Testing
Generated lv_mp.c with the updated binding generator.
Built the ESP32-S3 port against the current MicroPython master.
Confirmed that lv_mp.c no longer references
mp_obj_int_to_bytes_impl().
Summary by cubic
Switches the binding generator and example to
mp_obj_int_to_bytes()to match current MicroPython and fix build errors from the removedmp_obj_int_to_bytes_impl(). Keeps unsigned, truncating behavior and correct endianness; generated bindings compile again (tested on ESP32-S3).Written for commit 7ee268e. Summary will update on new commits.