Bit declirations and changing values

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bit declirations and changing values

1,714 Views
NZ_Design
Contributor I
I have a bit array set up of about 66 bits. Mem map says 9 bytes.

decleared as below.

typedef struct _B
{
  unsigned bSizerStatus:1;                  // sizer status - running,stopped
  unsigned bSizerStatusChg:1;              // sizer status - running,stopped
  unsigned bSizerDataUpdate:1;
  unsigned bDiagDataUpdate:1;              // sizer status - running,stopped
  unsigned bSizerSpeed:1;                  // speed update flag
  ........
  ........
  unsigned bWghReq:1;
  unsigned bBkLightTimerReset:1;
  unsigned bAllCupReq:1;
  unsigned bTestAll:1;
  unsigned bTestSingleLane:1;
} FLAGS;

I have a routine that calls an other and in that routine it sets one ofr these bits upon returning it tests that bit to see if it is set and carries on.

The problem is it sets the bit but by the time it comes to test it it is cleared.

Why???

If define it as "uchar x; ie a unsigned byte which is a waste of memory it works fine.

Labels (1)
0 Kudos
Reply
1 Reply

356 Views
CrasyCat
Specialist III
Hello
 
I think you need to get a support engineer to look at this one.
The code generated actually depends on the source code and it is not possible to
investigate something like that from the forum..
 
I would recommend you to submit a service request for that.

Click here to submit a service request.

Make sure to attach a reproducible project and installed product information to the service request.
To generate the required information:
- Start CodeWarrior
- Open the project
- Select "Help" -> "Pack and Go" and follow instructions on the screen.

Attach the generated .zip file to the SR.
 
CrasyCat
0 Kudos
Reply