typedef unsigned char bool;
union
{
struct
{
bool pumptimer1:1; /*using the bits to flag if */
bool pumptimer2:1; /*a run timer is in use*/
bool pumptimer3:1;
bool pumptimer4:1;
bool pumptimer5:1;
bool pumptimer6:1;
bool pumptimer7:1;
bool pumptimer8:1;
};
}pmptmr; //pump timer status
++bb;
timer 0x01 <<bb; //bit shift to the left "bb" times
if (pmptmr && timer &= On)
{
I2C1_MasterRead(*pdata,3,RTCC,*pflag);
}
I am setting up a timer to start and stop a pump. The RTC has 240x8 bytes that I am using in five byte blocks. I am using the above struct to flag which timers are in use. I am tring to mask pmptmr with timer (and bit shifting) to pick out which are active but I need help to get it to work