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

Move Keyboard and Mouse object instantiation into a function to reduce user-part binary size #1224

Merged
merged 1 commit into from Jan 11, 2017

Conversation

@avtolstoy
Copy link
Member

commented Jan 1, 2017

Allows the compiler to garbage collect USBKeyboard and USBMouse implementations if they are not used in user code, saving flash space.

arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20141119 (release) [ARM/embedded-4_9-branch revision 218278]

Electron, 0.6.1-rc.1, app/blank:
   text	   data	    bss	    dec	    hex	filename
   5564	      8	   1640	   7212	   1c2c	../../../build/target/user-part/platform-10-m/blank.elf

Electron, this PR, app/blank:
   text	   data	    bss	    dec	    hex	filename
   4684	      8	   1572	   6264	   1878	../../../build/target/user-part/platform-10-m/blank.elf

Electron, this PR, app/blank + Mouse.begin() and Keyboard.begin():
   text	   data	    bss	    dec	    hex	filename
   5676	      8	   1652	   7336	   1ca8	../../../build/target/user-part/platform-10-m/blank.elf


Doneness:

  • Contributor has signed CLA
  • Problem and Solution clearly stated
  • Code peer reviewed
  • API tests compiled
  • Run unit/integration/application tests on device
  • Add documentation
  • Add to CHANGELOG.md after merging (add links to docs and issues)

Enhancement

  • [PR #1224] Allow the compiler to garbage collect USBKeyboard and USBMouse implementations if they are not used in user code, saving flash space.
Use functions that return reference to USBMouse and USBKeyboard objec…
…ts instead of global objects to reduce user-part binary size when Mouse and Keyboard are not used

@avtolstoy avtolstoy added this to the 0.6.1 milestone Jan 1, 2017

@technobly technobly merged commit d30e03f into develop Jan 11, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@technobly technobly deleted the feature/usb-user-part-size-optimizations branch Jan 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.