-
Notifications
You must be signed in to change notification settings - Fork 76
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
Introduce cdc_shell_write_string() function for zero-terminated strings #18
Conversation
This makes programming less error prone and saves 140 bytes of flash. Also, replace some const pointers to const strings with just const strings.
@borisxm Looks good, thank you for this. I will test your pull-request and let you know the results. |
Tested with pvs-studio, looks OK. |
I confirm code size improvement. |
Tested, looks good. @borisxm if you don't mind, I'm going to merge your PR and tag to v2.2.1. Thoughts? |
Sounds fine. |
@borisxm Thank you! |
@borisxm One more thing, almost overlooked it, but I believe cdc_shell_write_string should live in cdc_shell.c. cdc_shell_write is a generic write callback that knows about usb_cdc internals. On the other hand, all its wrappers should live outside usb_cdc.c because they have nothing to do with usb_cdc itself. Can you fix that? |
This makes programming less error prone and saves 140 bytes of flash. Also, replace some const pointers to const strings with just const strings.
…ill-serial-monster into shell-write-string
Sure, slightly reworked the patch, now it saves even more space. |
…ill-serial-monster into shell-write-string
…ill-serial-monster into shell-write-string
@borisxm I will have a look later today and let you know! Thank you! |
@borisxm Looks good now, I'm going to merge the PR. Thank you for your contribution. |
This makes programming less error prone and saves 140 bytes of flash.
Also, replace some const pointers to const strings with just const strings.