Other Parts Discussed in Thread: CONTROLSUITE
Platform: C2000
Codegen: 6.1.0
I have the following, where DIVSEL is a bitfield with the type Uint16
if (SysCtrlRegs.PLLSTS.bit.DIVSEL != 0) // line 151
{
EALLOW;
SysCtrlRegs.PLLSTS.bit.DIVSEL = 0; // line 154
EDIS;
}
Both line 151 and 154 issue the same MISRA warnings (below) but I am not able to get line 151 to go away.
I've tried using a U suffix for unsigned ( 0U ) and I've also tried casting to Uint16 (i.e. (Uint16)0 )
Both solutions remove the error for the assignment on line 154. Neither remove the warning for the comparison on line 151.
Is there something I'm missing?
Misra warnings:
"C:/ti/controlSUITE/device_support/f2833x/v133/DSP2833x_common/source/DSP2833x_SysCtrl.c", line 151: warning:
(MISRA-C:2004 10.1/R) The value of an expression of integer type
shall not be implicitly converted to a different underlying type if
it is not a conversion to a wider integer type of the same signedness
if (SysCtrlRegs.PLLSTS.bit.DIVSEL != 0)
^
"C:/ti/controlSUITE/device_support/f2833x/v133/DSP2833x_common/source/DSP2833x_SysCtrl.c", line 154: warning:
(MISRA-C:2004 10.1/R) The value of an expression of integer type
shall not be implicitly converted to a different underlying type if
it is not a conversion to a wider integer type of the same signedness
SysCtrlRegs.PLLSTS.bit.DIVSEL = 0;
^