3 ms·
This is much cleaner than TI's reference implementation.
by throwanem 10y ago
This is much cleaner than TI's reference implementation.
- jimmyswimmy 10y agoIt may be so, but it doesn't implement an interrupt solution, which is a really bad way to program a microcontroller. Also I found these types particularly amusing. None of that code can be copy pasted without editing: while ((err == 0) && (nbytes > 0)) But since it doesn't support interrupts, I think not being able to copy paste this code is generally a good thing.
- throwanem 10y agoI'd tend to agree! But for those of us totally unfamiliar with how I2C works, and barely familiar with embedded dev at all, a somewhat gentler introduction to the relevant concepts, that requires close experience with fewer priors than TI's reference example, is no bad thing to have.