Please find attached a first Alpha of my port of the Microchip CDC Demo.
Unzip into the root of C: (Has directories of course).
I have no hardware to try it on at this time!
So it does not work for sure
It will be a good starting point for anybodys efforts.
Post feedback into this thread.
I have all the compile problems fixed now so there are no real differences between the PICC18 and C18 builds.
The sizes are within 1% and they both use code very faithful to the original source. The text had to be heavly modified to build but the code should be the same.
The problem with the first version I posted was simply the use of the far qualifier is different in Hitech to Microchip so the far should not be used on PICC18. This is all handled with a simple macro.
I have also implemented Garth's suggestion to arrange the Enpoint structures into an array. Great idea and much simpler than the orginal Microchip version.
I still have no hardware yet so it will not work. I have the hardware on order now so it's only a matter of time before this baby hums.
I will be passing it to Microchip to base their future app notes on. I will post any fixes I find here.
Note the Serial port and Temperature bits are very rough in the Hitech build. They are only for the demo. The USB bit should be OK.
Enjoy, and post success and failure here, and no naughty trying to get me to write your application code for you
-------------------- ================================================
FordP, from the Garden of England