OpenRTX / openrtx.github.io

12 stars 15 forks source link

Fix mode lookup table on OBCF #26

Closed turnrye closed 1 year ago

turnrye commented 1 year ago

What

A couple of community members in M17 discord pointed out that the mode lookup table was misleadingly unexpanded given that the field had an entire byte. Fix this. I also discovered, more significantly, that the value of this table had an off-by-one error as a consequence of an inconsistency between the draft specification, which had included a typedef for this field, and the actual implementation in OpenRTX. Ill focus the rest of this PR explaining this.

Why

When researching how the native CPS is implemented in openrtx, I noticed that channel_t is shared with present day native CPS and openrtx codeplug formats. This is when I discovered that the enum opmode definition is the proper definition for this mode field, which specifies that 0 is OPMODE_NONE, not OPMODE_FM.

How

Next steps

I have not done this last step, as we may want to delay and bundle a number of fixes together in a single version to avoid churn. Leaving this consideration to the maintainers.