Content originally posted in LPCWare by MarcVonWindscooting on Tue Feb 16 14:07:13 MST 2016
Sorry: No.
I believe, the true bug of this function is the type of uid which pretends to point to a 32-bit value, but actually is a uint32_t uid[4] and had better be a structure or union. The result is 128bits, but the API fooled you into believing it's 32bit only!
Next flaw: does command have to be a uint32_t[5] and a uint32_t[1] is really not sufficient?? ;-)
One function, two reasons to stop looking at 'typical' embedded programmers' code...
Marc