Code: Select all
#define OVERFLOW_MASK 0x7BDF // OverFlow가 발생할 위치를 미리클리어.
추가로....코드중에 아래부분은
Code: Select all
if (p2 & B_OVERFLOW_FLAG)// B 에 OverFlow 발생
p2 |= B_MAX;
if (p2 & G_OVERFLOW_FLAG)// G 에 OverFlow 발생
p2 |= G_MAX;
if (p2 & R_OVERFLOW_FLAG)// R 에 OverFlow 발생
p2 |= R_MAX;
Code: Select all
int overflow = p2 & 0x8420;
p2 |= ( overflow - (overflow>>5) );