Big changes are afoot

I’m a busy little bee. Along with some rain in my drought-stricken country of Australia comes a few big changes to MyUSB.

First up, the Java helper applications have been deleted. I originally wrote the apps in Java for cross-compatibility, but as Denver Gingerich (man behind the Keyboard demo application) pointed out, not everyone *has* Java.

However, one thing that everyone should have is an installation of WinAVR, or a Unix shell. Denver was kind enough to help me out with a few of Unix’s tools that I’ve not had much experience in, and the new solution is a single (if complex) line in the makefile completely replacing the Java monstrosity I had coded up.

But that’s not all. I’ve finally got around to properly separating the device and host portions of the library. You can now omit the compiling of the host-specific files when only using the device mode, and vice-versa. The selection of what parts to include is done by two new macros, which are passed to each file as it is compiled in the makefile via AVR-GCC’s -D switch. Passing USB_DEVICE_ONLY when compiling will remove all host-related code, and USB_HOST_ONLY will do the same for the device code (not passing either enables both as was the previous behavior). Everything still works the same unless the USB system is initialized into a mode that has not been compiled in, whereupon the power on error event will fire with a POWERON_ERROR_UnavailableUSBModeSpecified error code.

The MyUSB keyboard and host demo applications now pass in USB_DEVICE_ONLY on the command line, which currently saves a little over a kilobyte of space in the final binary.

The side-effect of seperating the library components is that when one of the USB_X_ONLY tokens are defined, only the events applicable to that mode are available. That removes the noise from the unhooked events output on the build output.

 

Comments

No comments so far.

Leave a Reply

 
(will not be published)
 
 
Comment
 
 

 

Vital Stats

  • 35 Years Old
  • Australian
  • Lover of embedded systems
  • Firmware engineer
  • Self-Proclaimed Geek

Latest Blog Posts

RSS