Generate init code for co config t#257
Open
cfr-mir wants to merge 3 commits intorobincornelius:xddfrom
cfr-mir:generate_init_code_for_CO_config_t
Open
Generate init code for co config t#257cfr-mir wants to merge 3 commits intorobincornelius:xddfrom cfr-mir:generate_init_code_for_CO_config_t
cfr-mir wants to merge 3 commits intorobincornelius:xddfrom
cfr-mir:generate_init_code_for_CO_config_t
Conversation
Only nessesary if CO_MULTIPLE_OD is defined.
Contributor
|
This PR is now included in https://github.com/CANopenNode/CANopenEditor. I also added some other features, see CANopenNode/CANopenNode#314. This PR is not relevant here any more. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds generation of a C macro, which is able to initialize a CO_config_t structure.
So you can write:
CO_config_t myConfig;
xxx_OD_INIT_CONFIG(myConfig)
Below are a small sample of the macro in our project:
#define CO_PowerBoard_OD_INIT_CONFIG(config) {\ (config).CNT_NMT=1;\ (config).ENTRY_H1017=CO_PowerBoard_OD_ENTRY_H1017_producerHeartbeatTime;\ (config).CNT_HB_CONS=16;\ (config).ENTRY_H1016=CO_PowerBoard_OD_ENTRY_H1016_consumerHeartbeatTime;\ (config).CNT_EM=1;\ (config).ENTRY_H1001=CO_PowerBoard_OD_ENTRY_H1001_errorRegister;\ (config).ENTRY_H1014=CO_PowerBoard_OD_ENTRY_H1014_emcyCOBID;\ (config).ENTRY_H1015=CO_PowerBoard_OD_ENTRY_H1015_inhibitTimeEMCY;\ (config).ENTRY_H1003=CO_PowerBoard_OD_ENTRY_H1003_pre_definedErrorField;\ (config).CNT_SDO_SRV=1;\ (config).ENTRY_H1200=CO_PowerBoard_OD_ENTRY_H1200_serverSDO_Parameter;\ (config).CNT_SDO_CLI=6;\ (config).ENTRY_H1280=CO_PowerBoard_OD_ENTRY_H1280_clientSDO_1_Parameter;\ (config).CNT_TIME=0;\ (config).ENTRY_H1012=NULL;\ (config).CNT_SYNC=1;\