Other Parts Discussed in Thread: MSP430FR59471
I am using the msp430 header files for c, specifically the msp430fr5738.h and msp430fr59471.h. Running the code through a MISRA code inspection test results in some violations due to #defines in these header files. Especially in register access. The register is defined as an unsigned integer but the bit settings are defined as signed integers. This causes a violation due to the mismatch in datatypes.
For example, in your example projects, the first line is generally as follows:
WDTCTL = WDTPW + WDTHOLD;
WDTCTL is defined as SFR_16BIT(WDTCTL)
where: #define SFR_16BIT(address) extern volatile unsigned int address
WDTPW is defined as (0x5A00)
WDTHOLD is defined as (0x0080)
So WDTCTL is an unsigned integer, whilst WDTPW and WDTHOLD are defined as signed integers.
Do TI provide a version of these header files with the correct definitions for register assignments? WDTPW as (0x5A00U) for example? As this really should be done to pass the MISRA software standard which is very commonly used in industry.
Thanks,
Matt