-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix multiplex sig unpack #34
base: main
Are you sure you want to change the base?
Conversation
…signals are in a CAN msg. Filter out bytes that have no signals in them.
… the expected multiplex values. In this case just encode all signals for the byte since none of them are technically valid as they don't correspond to the master multiplexor value.
… unpack depending on multiplexed master value.
I noticed in this old pull request #22 I think a command line option is good to enable this fix #33 and #31 but I don't think adding a protected special macro would really be necessary. These changes in my opinion are to fix a bug so it would be weird to have generated c code that has the incorrect multiplex signal Pack and Unpack code and then a protected special macro around this correct signal Pack and Unpack code. I think it would be clearer to either generate one way or the other based on a command line option you give c-coderdbc? |
… on multiplexor master signal values for multiplexed signals. By default it is off so this new code has no affect.
I added the command line option
I think this option should be on by default as it is fixes Unpack and Pack functions for multiplex signals but I guess this may break old code that upgrade c-coderdbc so maybe this is a bad idea. |
… in the Unpack body for the multiplex master signals. This is fixed now.
Fixes issues #33.
The generated code now only unpacks the correct multiplex signals associated with the mutliplex master value.
These changes do not affect CAN messages that have no mutliplex values. They also don't affect the decoding of unmultiplex signals or the multiplex master signal in a CAN message.
A comparison of decoding the following CAN msg below is shown:
Before this fix the following was generated.
After this fix it now generates this Unpack function: