EXT UI08 CW_CCW;
#define CW_CCW P6.0
EXT union bit_def hall_data;
#define HALL_W hall_data.bi.b0;
#define HALL_V hall_data.bi.b1;
#define HALL_U hall_data.bi.b2;
#define read_hall() {\
EI();\
if(cw_ccw == 1){\
HALL_W = ~P3.0;\
HALL_V = ~P5.1;\
HALL_U = ~P5.0;\
}\
else {\
HALL_W = P3.0;\
HALL_V = P5.1;\
HALL_U = P5.0;\
}\
}