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

AP_Scripting: Add filesystem crc32 binding #26211

Merged
merged 2 commits into from
Feb 14, 2024

Conversation

IamPete1
Copy link
Member

@IamPete1 IamPete1 commented Feb 13, 2024

#26157 made me realize that we only apply our checksum to the loaded scripts, those scripts could then be using modules that could be incorrectly versioned. This adds a binding for the same crc32 function we use for the scripting check sum, this allows scripts to checksum there modules if they want to.

However, I was unable to get the correct checksum because we were not initializing the pass by reference values, so the checksum did not start with 0 and the crc32 function does not zero it. This is possibly a issue else where but we have not noticed....

@IamPete1
Copy link
Member Author

IamPete1 commented Feb 13, 2024

The brace initialization has minimal flash cost, this is the total for the PR:

Binary Name      Text [B]        Data [B]     BSS (B)        Total Flash Change [B] (%)      Flash Free After PR (B)
---------------  --------------  -----------  -------------  ----------------------------  -------------------------
ardurover        420 (+0.0258%)  0 (0.0000%)  -4 (-0.0015%)  420 (+0.0258%)                                   337180
blimp            412 (+0.0307%)  0 (0.0000%)  4 (+0.0015%)   412 (+0.0307%)                                   622744
arducopter       424 (+0.0240%)  0 (0.0000%)  0 (0.0000%)    424 (+0.0239%)                                   192820
arduplane        424 (+0.0241%)  0 (0.0000%)  0 (0.0000%)    424 (+0.0240%)                                   201136
ardusub          412 (+0.0264%)  0 (0.0000%)  4 (+0.0015%)   412 (+0.0263%)                                   400456
antennatracker   412 (+0.0313%)  0 (0.0000%)  -4 (-0.0015%)  412 (+0.0312%)                                   645620
arducopter-heli  424 (+0.0239%)  0 (0.0000%)  0 (0.0000%)    424 (+0.0238%)                                   186652

@tridge tridge removed the DevCallEU label Feb 14, 2024
@IamPete1 IamPete1 force-pushed the scripting_crc_binding branch from 83d1646 to 3f0a952 Compare February 14, 2024 11:16
@IamPete1 IamPete1 changed the title AP_Scripting: Add filesystem crc32 binding and ensure pass by reference values are initialized AP_Scripting: Add filesystem crc32 binding Feb 14, 2024
@tridge tridge merged commit c48759f into ArduPilot:master Feb 14, 2024
93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 4.5.0-beta3
Development

Successfully merging this pull request may close these issues.

2 participants