The items high-lighted below (7 of them) cause Error #28 -- interestingly, they are the only items that are declared as "const char *"
The non-const items seem fine but the compiler is flagging the const strings with
"error #28 expression must have a constant value". All the items in this area are constant items... they are pointers and are all resolved at link time. The only difference I can see is the ones being complained about will reside in code flash. The others land in ram, but I think that the address the items land in should be irrelevant. I've used the same code on IAR and Keil and both of those compilers work fine.
the constant expression "const char * szCompany ="MyCompany"; "
is declared as "extern const char * szCompany" in a header file included by the code below.
the expression "char * szSessionID = "0xxxxx" "
is declared as "extern char * szSessionID"
The const item generates error #28 and the item without const compiles fine. This seems to be a compiler issue. Suggestions?
///////////////////////////////////////////////////////////////////////////////
//
// MSP Get Attributes - Attributes Pointer Table
//
///////////////////////////////////////////////////////////////////////////////
const char* MWP_Attributes_Table[ ATTRIBUTE_ENTRY_COUNT ] =
{
{ NULL }, // spare00
{ &SetMyName[SHORT_NAME_OFFSET] }, // ShortName
{ szCompany }, // VendorName
{ szModel }, // VendorModel
{ szFirmwareRev }, // VendorVersion
{ szPlatform }, // PlatformModel
{ &szHwRevNo[13] }, // HardwareRevision
{ szPlatformRev }, // FirmwareRevision
{ szPlatformDate }, // FirmwareDate
{ &szSerialNo[4] }, // SerialNumber
{ szSessionID }, // SessionId
{ &szPatient[9] }, // PatientId
{ &szDOB[9] }, // PatientDOB
{ szDate }, // SessionDate
{ szTime }, // SessionTime
{ &szOperatingMode[12] }, // SessionType
{ &szRecLength[9] }, // SessionDuration
{ szCableType }, // CableType
{ szLeadText }, // LeadConfiguration
{ &szSampleRate[9] }, // SampleRate
{ &szResolution[11] }, // DataResolution
{ szPackType }, // DataFormat
{ NULL }, // EcgRecordingDuration (Integer in Hours)?
{ NULL }, // spare23
{ NULL }, // spare24
{ NULL }, // spare25
{ NULL }, // spare26
{ NULL }, // spare27
{ NULL }, // spare28
{ NULL }, // spare29
{ NULL }, // spare30
{ NULL } // spare31
};