Skip to content
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

Generate init code for co config t #257

Open
wants to merge 3 commits into
base: xdd
Choose a base branch
from
Open

Generate init code for co config t #257

wants to merge 3 commits into from

Conversation

cfr-mir
Copy link
Contributor

@cfr-mir cfr-mir commented May 28, 2021

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;\

@CANopenNode
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants