Closed matthijskooijman closed 11 years ago
I reviewed my code this morning and made a few minor changes (really only moving some code and commits around). I've force-pushed the new version, which is shown above.
Ok; let me know when you're finished cleaning up your code. I briefly looked into your changes, and they appear ok to me. If all current unit tests still run, I think that this patch can be merged in...
Thanks for your contribution!
Ah, test cases, good point! I disabled them at some point to save time and forgot to enable them again when I finished the patches :-)
I added one commit to update the UART testcases to the changed UART analysis API and results, and modified the last three commits to also tell the DMX analyzer about the new API :-)
All tests pass again now and the code is ready to merge as far as I'm concerned.
Thanks for the patch!
Here's a series of improvements and cleanups for the UART decoder.
Most important part of these are the handling of baudrates. The decoding is now a lot more robust when the sample rate is lower (even works somewhat when the sampling rate is only twice the baudrate, for example) and the rounding errors of a sampling rate that is not an exact multiple of the baudrate are reduced.
In addition, I made the inversion/inverting options a bit more clear and complete.
I've tried to conform to your coding style as far as possible, but it's not my usual style, so I will probably have missed a few spots. I've tried to make the commits as small and well-documented as possible, I hope that makes review easy (even though the number of commits might seem daunting at first....).
Finally, I think this series of patches is finished, but I haven't done a complete review of them before creating this pullrequest. I'll try to do that tomorrow, but I didn't want to keep you from having a look at the commits already. I have an idea for a easy optimization of the findEdge function, but I'll send that over separately if I get around to it.