Skip to content

Commit

Permalink
Fixed configuration check as per Issue #130
Browse files Browse the repository at this point in the history
  • Loading branch information
pasetti committed Jul 25, 2018
1 parent f3d2d02 commit 1e100fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
15 changes: 3 additions & 12 deletions src/Aux/CrFwAux.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,7 @@ CrFwBool_t CrFwAuxOutFactoryConfigCheck() {
CrFwDiscriminant_t disc;
CrFwBool_t found;

if (CR_FW_OUTFACTORY_MAX_NOF_OUTCMP < 1)
return 0;

if (CR_FW_OUTCMP_NKINDS < 1)
if ((CR_FW_OUTFACTORY_MAX_NOF_OUTCMP < 1) && (CR_FW_OUTCMP_NKINDS > 0))
return 0;

for (i=0; i<(CR_FW_OUTCMP_NKINDS-1); i++) {
Expand Down Expand Up @@ -191,10 +188,7 @@ CrFwBool_t CrFwAuxOutFactoryConfigCheck() {
CrFwBool_t CrFwAuxInFactoryInCmdConfigCheck() {
CrFwCmdRepKindIndex_t i;

if (CR_FW_INFACTORY_MAX_NOF_INCMD < 1)
return 0;

if (CR_FW_OUTCMP_NKINDS < 1)
if ((CR_FW_INFACTORY_MAX_NOF_INCMD < 1) && (CR_FW_OUTCMP_NKINDS > 0))
return 0;

for (i=0; i<(CR_FW_INCMD_NKINDS-1); i++) {
Expand Down Expand Up @@ -229,10 +223,7 @@ CrFwBool_t CrFwAuxInFactoryInCmdConfigCheck() {
CrFwBool_t CrFwAuxInFactoryInRepConfigCheck() {
CrFwCmdRepKindIndex_t i;

if (CR_FW_INFACTORY_MAX_NOF_INREP < 1)
return 0;

if (CR_FW_INREP_NKINDS < 1)
if ((CR_FW_INFACTORY_MAX_NOF_INREP < 1) && (CR_FW_INREP_NKINDS > 0))
return 0;

for (i=0; i<(CR_FW_INREP_NKINDS-1); i++) {
Expand Down
9 changes: 3 additions & 6 deletions src/Aux/CrFwAux.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ CrFwBool_t CrFwAuxOutRegistryConfigCheck();
* Check the configuration of the OutFactory component.
* The following checks are performed on the configuration data in
* <code>CrFwOutFactoryUserPar.h</code>:
* - CR_FW_OUTFACTORY_MAX_NOF_OUTCMP is greater than zero
* - CR_FW_OUTCMP_NKINDS is greater than zero
* - CR_FW_OUTFACTORY_MAX_NOF_OUTCMP is greater than zero if CR_FW_OUTCMP_NKINDS is greater than zero
* - The service types are listed in increasing order in the service descriptor
* initializer (<code>CR_FW_OUTCMP_INIT_KIND_DESC</code>)
* - The service sub-types within a type are listed in increasing order in the service
Expand All @@ -114,8 +113,7 @@ CrFwBool_t CrFwAuxOutFactoryConfigCheck();
* Check the configuration of the InCommand part of the InFactory component.
* The following checks are performed on the configuration data in
* <code>CrFwInFactoryUserPar.h</code>:
* - CR_FW_INFACTORY_MAX_NOF_INCMD is greater than zero
* - CR_FW_INCMD_NKINDS is greater than zero
* - CR_FW_INFACTORY_MAX_NOF_INCMD is greater than zero if CR_FW_INCMD_NKINDS is greater than zero
* - The service types are listed in increasing order in the service descriptor
* initializer (<code>CR_FW_INCMD_INIT_KIND_DESC</code>)
* - The service sub-types within a type are listed in increasing order in the service
Expand All @@ -135,8 +133,7 @@ CrFwBool_t CrFwAuxInFactoryInCmdConfigCheck();
* Check the configuration of the InReport part of the InFactory component.
* The following checks are performed on the configuration data in
* <code>CrFwInFactoryUserPar.h</code>:
* - CR_FW_INFACTORY_MAX_NOF_INREP is greater than zero
* - CR_FW_INREP_NKINDS is greater than zero
* - CR_FW_INFACTORY_MAX_NOF_INREP is greater than zero if CR_FW_INREP_NKINDS is greater than zero
* - The service types are listed in increasing order in the service descriptor
* initializer (<code>CR_FW_INREP_INIT_KIND_DESC</code>)
* - The service sub-types within a type are listed in increasing order in the service
Expand Down

0 comments on commit 1e100fe

Please sign in to comment.