I'm having some problems testing bit 0 of a variable to see if it's a 1. Here's the snippet of the code:
if ((bWork && 0x01)==1) bTemp = bTemp|0x01; else bTemp = bTemp & 0xFE;
&& is logical and. & is bitwise and. The given snippet will take the if path whenever bWork is "true" (non-zero). (The other operand, "0x01", is always true, so it only depends on bWork.) You probably want:
if ((bWork & 0x01) == 1)