This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Check of NVM size by #if directive

I've done the code below to control the size of my NVM during compile time:

.
.
.
typedef enum
{
NvmAddrStart = 0x0000
,NvmAddrFactory = (NvmAddrStart)
,NvmAddrFactoryEnd = (NvmAddrFactory + 10)
,NvmLastAddress = (NvmAddrFactoryEnd)
};

#if (NvmLastAddress >= 0x0800)
#error "MEMORY FULL"
#endif
.
.
.

What I would like to know is why the above check does not work?

See below the error message:

C51 COMPILER V7.01 - SN: C1S4P-B3602E
COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2002
*** WARNING C322 IN LINE 560 OF ../INC\APMS.H: unknown identifier

If I put the same check without using an enumerator, only #define directives, in this way it works properly.

Is there any limitation concernig the enumerator?

Regards

Thank you

0