Before, we were hiding the I/O pin in the LED code (creating a hierarchy of functions that depend only on the lower levels). With dependency injection, we’ll remove the dependency of LED code upon the I/O pin by passing an I/O handler as a parameter to the LED initialization code. The I/O handler will know which pin to change and how to change it, but the LED code will know only how to call the I/O handler.
Some example code would be nice here! One assumes that it will come further down - but not.
Lets see if we can provide some example: ... ran out of mem, see this gist
Share this highlighthttp://www.safaribooksonline.com/a/making-embedded-systems/8931219/