PARITY enumeration rankles

I’ve been serialising some of my uart settings into JSON and I see that even though PARITY_NONE == 0 (sensible, natural) , surprisingly PARITY_EVEN == 1 and PARITY_ODD == 2! That sends my OCD into overdrive.

The Windows OS Device Control Block has the enumeration such that PARITY_EVEN=2 and PARITY_ODD=1 which is a better fit for your OCD :))

This is why we use enumeration and not visible numbers :wink:

If it makes you feel any better, consider that our PARITY_EVEN and PARITY_ODD are in numerical order when they’re in alphabetical order :slight_smile: