Compilation definitions refactorization

Issue #228 new
Kamil Drobienko created an issue

in file oc_i2c_lld.h:

  • compilation defines should be changed, because second part with outputing error is not active
  • additionaly oC_I2C_LLD_AVAILABLE should be defined only when it is available, define needs to be moved at the end of section.
  • under compilation all source files for drivers should be evaluated if lld is available and if not drivers should not be compile: #ifdef oC_I2C_LLD_AVAILABLE
  • above rules should be applied to all drivers;
  • drivergen should be adapt according to above rules;
#if oC_Channel_IsModuleDefined(I2C) && oC_ModulePinFunctions_IsModuleDefined(I2C) && oC_ModulePin_IsModuleDefined(I2C)
#define oC_I2C_LLD_AVAILABLE

#if oC_Channel_IsModuleDefined(I2C) == false
#error I2C module channels are not defined
#elif oC_ModulePinFunctions_IsModuleDefined(I2C) == false
#error  I2C module pin functions are not defined
#elif oC_ModulePin_IsModuleDefined(I2C) == false
#error  I2C module pins are not defined
#else

proposal

#if oC_Channel_IsModuleDefined(I2C) || oC_ModulePinFunctions_IsModuleDefined(I2C) || oC_ModulePin_IsModuleDefined(I2C)

#if oC_Channel_IsModuleDefined(I2C) == false
#error I2C module channels are not defined
#elif oC_ModulePinFunctions_IsModuleDefined(I2C) == false
#error  I2C module pin functions are not defined
#elif oC_ModulePin_IsModuleDefined(I2C) == false
#error  I2C module pins are not defined
#else

#define oC_I2C_LLD_AVAILABLE

Comments (5)

  1. Patryk Kubiak

    I think it should be "Compilation definitions refactorization" because "compilation" does not define anything xD :P

  2. Log in to comment