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

Only support ASCII strings in EEPROM #217

Merged
merged 9 commits into from
Jun 28, 2024
Merged

Only support ASCII strings in EEPROM #217

merged 9 commits into from
Jun 28, 2024

Conversation

jamwaffles
Copy link
Collaborator

The EtherCAT spec ETG1000.4 section 5.2.6 defines a "Visible String" as the characters 0x20 to 0x7E. To conform with the spec, as well as reduce code size a bit due to not having to validate UTF-8, this PR will now make EEPROM string reads fail if the string is not ASCII.

Code size reduction from master:

   text    data     bss     dec     hex filename
  99316     112   57800  157228   2662c ethercrab-stm32-embassy

To this branch:

   text    data     bss     dec     hex filename
  97496     112   57800  155408   25f10 ethercrab-stm32-embassy

   text    data     bss     dec     hex filename
  98812     112   57800  156724   26434 ethercrab-stm32-embassy
   text    data     bss     dec     hex filename
  98764     112   57800  156676   26404 ethercrab-stm32-embassy
Increases binary size for some reason - maybe more inlining?

   text    data     bss     dec     hex filename
  99812     112   57800  157724   2681c ethercrab-stm32-embassy
We only use them to calculate PDO bit length, so they don't need to be
stored.

   text    data     bss     dec     hex filename
  98856     112   57800  156768   26460 ethercrab-stm32-embassy
   text    data     bss     dec     hex filename
  97716     112   57800  155628   25fec ethercrab-stm32-embassy
   text    data     bss     dec     hex filename
  95852     112   57800  153764   258a4 ethercrab-stm32-embassy
   text    data     bss     dec     hex filename
  97496     112   57800  155408   25f10 ethercrab-stm32-embassy
No change in binary size, but nicer code
@jamwaffles jamwaffles enabled auto-merge (squash) June 28, 2024 13:15
@jamwaffles jamwaffles merged commit 4ae9d36 into master Jun 28, 2024
8 checks passed
@jamwaffles jamwaffles deleted the eeprom-opt branch June 28, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant