Remix.run Logo
ocdtrekkie 3 days ago

I was troubleshooting some code of mine that talks to a product Adafruit has been selling for ten years. It turns out the documentation was just plain wrong. Thankfully Adafruit's source code was posted and I could quite confidently see the right way to do it, and submitted feedback on the documentation bug.

But I think this is a space where due to the relative ease and cheapness of putting out a product and often fixing it after the fact, there's less eyeballs on any given aspect of a board or the software loaded on it.

And a years younger me noticed the issue! But I worked around it instead of reporting it. This time I figured out the source of the problem... but the documentation has been wrong a long time in between. ;)

estimator7292 2 days ago | parent [-]

Adafruit's libraries are some of the worst code I've ever seen. And I recreationally dive into the low level esp-IDF code (I do not recommend if you value your sanity).

I found one just yesterday where the main entry point returns a byte value. It returns 'false' on error, and '0' on success. It may also sometimes return a non-zero error code. You can see why this design would be problematic.

elcritch 2 days ago | parent [-]

Yet they generally work.

In my experience all of the low level code on uC’s is just short of horrible. That’s ST, NXP, etc, are just full of terrible kludges. Then again some of the Linux kernel drivers can be rough too.

The only vendor I’ve heard has good code and documentation is Raspberry Pi Foundation on their silicon.