O'Reilly logo
  • Jor Fei Wong thinks this is interesting:

tmp = (((1 << 10) - adcLPS)*(BSP_SCREEN_HEIGHT - 2)) >> 10;

Note

The ADC output is 10-bit (0 - 1023). 1 - 1023 will produce tmp <= BSP_SCREEN_HEIGHT - 3, consistent with the DOS version. 0 will produce tmp = BSP_SCREEN_HEIGHT - 2, inconsistent with the DOS version.