This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS320F280049: Misra-C #1483-D

Part Number: TMS320F280049
Other Parts Discussed in Thread: ADS1018

Tool/software: TI C/C++ Compiler

Dear Champs,

I am asking this for our customers.

The user uses MISRA-C:2004 to check and and is troubled with this

"#1483-D (MISRA-C:2004 12.6/A) Expressions that are effectively Boolean should not be used in operations with expressions that are not effectively Boolean"

in below two excerpts of codes.

On C28x

  1. Calculation_Parameter_A_I16 = Apm_Hvdc_Calibration_00_Str.Apm_Hvdc_Curr_Parm_A_I16;
  2. Apm_Lvdc_Cmd_00_Str.Apm_Lvdc_Curr_Cmd_U16 = Derating_Iout_Command_U16;
  3. Calculation_Data_Temp_1_I32  = (I32)(Iin_Adc_Avg_Data_U16);
  4. Calculation_Data_Temp_1_U32  = (U32)(Calculation_Data_Temp_1_U16);
  5. Ads1018_Rx_Data_U16 = Ads1018_Rx_Data_U16 >> 4;
  6. Ads1018_Rx_Data_U16 = SpibRegs.SPIRXBUF;

 

On CLA

  1. Hsfb_Cla_Temp_1_CLA_U16 = Hsfb_Cla_Temp_1_CLA_U16 >> 2;
  2. Hsfb_Cla_Temp_1_CLA_U16 = (CLA_U16)(AdcaResultRegs.ADCRESULT0);
  3. Hsfb_Voltage_Loop_Vars_CLA_STR.Ref = Hsfb_Voltage_Command_CPU_F32;
  4. Hsfb_Cla_Temp_2_CLA_F32 = Hsfb_Voltage_Command_CPU_F32 + Hsfb_Ctrl_Param_Vout_Delta_Adc_CPU_F32;
  5. Hsfb_Cla_Temp_1_CLA_F32 = Hsfb_Current_Loop_Vars_CLA_STR.Out * 65535.0;

Do you have any suggestion?

Wayne Huang