View Single Post
  #2   Spotlight this post!  
Unread 02-02-2008, 12:03
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: p1_sw_aux data type

p1_sw_aux1 is really a macro

#define p1_sw_aux1 rxdata.oi_swA_byte.bitselect.bit2 // Aux input

bitselect is a member of a union and is of defined type 'bitid'

typedef struct
{
unsigned int bit0:1;
unsigned int bit1:1;
unsigned int bit2:1;
unsigned int bit3:1;
unsigned int bit4:1;
unsigned int bit5:1;
unsigned int bit6:1;
unsigned int bit7:1;
} bitid;

Thus, the 'type' of bit2 is a single bit, the value is always 0 or 1.

HTH