|
Updated usb_interface class |
|
|
|
|
Written by Evan
|
|
Thursday, 14 February 2008 |
|
I've finally gotten around to one project I've been meaning to do for quite a long time now - updating the usb_interface class used in my PIC USB interfacing code to implement marshalling so that there is no longer any 'unsafe' code. While I'm at it, I'm also trying to clean up the code significantly, so that it's easier to read and follow, since its purpose is to be example code anyway. And, I'm also now compiling the core code as a DLL file which can be used in other programs, rather than making a copy of the class each time, so that I can keep all of the core code standardized between all my projects. I have already gotten the DLL finished, using all safe code, and have successfully tested it in the USB Demo application. No code changes were required, except adding the DLL as a reference, adding a 'using' directive, and of course removing the old usb_interface.cs class file from the assembly. So, the DLL should be a pretty painless upgrade for existing projects. My next tasks are to implement the bootloader class and the asynchronous class with the new code. Previously these were both built by starting with the core code and editing it for each task, but I would like to refactor it so that the base code DLL stays intact and these two special applications simply extend the base class. This should make things a lot more modular and logical, and hopefully easier to follow. I will update when I've made some more progress. The basic USB Demo article should be the first to get revised.
|