Saturday, January 02, 2010
Hacking on the code...?
Anyway, I've never really been able to publish anything worthwhile as it's either specific to my junk-strap, or it's so small it's pointless setting up a site, repository, whatever, and as a result I've not been able to "prove myself" worthy of the blessing that would be SVN access. ( wouldn't that be handy, hint, hint).
I constantly see requests in the forums for people saying "it'd be nice if..." or "can the firmware do X" and thinking to myself "I've written that, but how do properly *share* that: Sending a tarball of my firmware is bound to end in tears, as it's based the main firmware, but hacked up for my non-standard setup ( mega, gen2 electronics, DC extruder, graycode stepper drivers, etc )
So anyway, As my firmware has been getting further and further from the one-true-way, and it didn't support 5D ( a killer feature AFAIAC ) , I'm integrating the two, and sharing it all!
here it is, my integrated, feature-ful, experimental, probably-busted firmware code:
( a work-in-progress)
My added features:
- DC motor and encoder wheel support in the 5D firmware
- quadrature/graycode stepper control ( in addition to the step/direction controls)
- open-loop DC motor control of the Z axis ( well any axis really, but it's only slightly useful on a Z)
- support optional firmware "features" with #defs define which "features" apply to which motherboard/reprap types. include reasonable defaults for 4 different reprap types.
- mega support. ( not entirely by me )
- auto-shutdown on idle ( not by me )
- useful comments in the DDA code to un-confuse users. ( this code is unintuitive and complicated for the new user )
- I merged in recent mendel work too..
- removed assumptions about RS485 always being wanted, it's an optional "feature" now.
- and the added bugs of course!
Once "stable" (ie bugs removed) this firmware is aiming to be as close to a "universal" firmware as I've seen. ( ie it should support darwin,mendel,makerbot, custom, etc with a little extra effort).
Buzz.happy hacking 2010.
( patches encouraged/welcome)
I was going to try and implement into the extruder code for the extruder PCB control for a servo extruder, and being a totally separate entity from the stepper, but using similar function calls, so that you could just define #ifdef StepperControl and #ifdef ServoControl.
Even further to reduce code size, I had planned on adding, eg,
Because the #Anything is a preprocessor function before compilation you essentially enable smaller code size by not including everything, and include that which is needed.
Just a theory, I have not tried it.
If you're trying to make patches against a "canonical" source base, and you have several different features you wish to keep as separate patches, and the "canonical" source is a moving target, something like stgit is a godsend.
Don't know if it applies to what you're doing, but thought I'd mention it.
I've been fiddling myself, and re-inventing the wheel.
This could save us hours of time!
Links to this post: