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

Incorrect display of values in the debug window for bit data

#pragma pack(push, 1)
typedef struct {
	signed Vin0				:10;
	signed Vin1 			:10;
	signed Vnoise0		:10;
	signed Vnoise1		:10;
} PackVin;
#pragma pack(pop)

typedef struct {
	State_Time StateTime;
	uint8_t		res[6];
  uint8_t 	Ia;			
  uint8_t 	Ib;
  uint8_t 	Ic;
  uint8_t 	VaRMS;		
  uint8_t 	VbRMS;
  uint8_t 	VcRMS;
  PackVin  	Va[FrameCount];
  PackVin  	Vb[FrameCount];
  PackVin  	Vc[FrameCount]; 
} TickDataFrame;

TickDataFrame TickFrame[10];

for(int i=0;i<1024;i++)
{
    for(BlkPos=0;BlkPos<10;BlkPos++)
    {
				TickFrame[0].Va[BlkPos].Vin0++;
				TickFrame[0].Va[BlkPos].Vin1++;
				TickFrame[0].Va[BlkPos].Vnoise0++;
				TickFrame[0].Va[BlkPos].Vnoise1++;
    }
}

Watch:

Memory:

96 58 62 89 25     96 58 62 89 25    96 58 62 89 25    96 58 62 89 25    

The contents in memory are correct, manually parsing the bits OR subtracting these values will produce the correct number (150).

The problem is in the display of values on the Watch panel - instead of 150/150/150/150 (by 4 positions) it shows 150/150/150/nonsense. Moreover, "nonsense" constantly changes sign and never coincides with other positions.