I am using sysconfig to configure the basic HW on my system. But several times i come across that I was missing a define to allow me to have a named reference from the non-generated code.
Example:
I configured the ADC with 4 SOC's. Bound to different signals connected to the assigned CPU pin.
SOC0 is setup to read the Fan Feedback signal (FAN_FEEDBACK),
So when i want to read the FAN_FEEDBACKin my SW i still have to refer to ADC_SOC_NUMBER0 defined in the adc.h file.
So far so good, but this is a bad example of dual source for the same info. Meaning that if later the config in sysconfig is changed so now FAN_FEEDBACKis connected to SOC3. I must also remember to update that same connection in my SW.
If I was allowed to name the SOC in sysconfig, and sysconfig would then create a define in board.h like
#define FAN_FEEDBACKADC_SOC_NUMBER0
I could refer to this define in my calls to ADC_readResult() and a change in the allocated SOC would not alter my code, in other word one source for the same info.
Looking at the latest version of sysconfig is even appears that there is a variable that could be used for this, but appears to be unused, and un-editable.
"soc" + soci.toString() + "ModuleChannelName"
Besides the problems dual sources means for maintenance, it also hurts readability. I mean which of the to lines is fastest to greasp when reading the source.
value = ADC_readResult( ADC_RESULT_BASE, ADC_SOC_NUMBER0 ); value = ADC_readResult( ADC_RESULT_BASE, FAN_FEEDBACK )
(Note that the result base has a define based on the name I gave for the ADC instance)
#define ADC_RESULT_BASE ADCARESULT_BASE
The same problem occurs for assigning pins for different devices Like the UART or SPI, it would be very nice to either have a generic define pointing to UART_TX_PIN, SPI_MISO_PIN a.s.o. or even better be able to name them my self.
EDIT:
Forgot to mention that the examples above is from C200Ware 4.0.0.0/sysConfig1.10.0 and the f28002x support.