// FindOverExposure // Finds a suitable value of OverExposure for use with SetFlickerCtrl // Some calculation is required because this value changes with the brightness // set with SetColourParameters // // Parameters: Brightness - last brightness value set with SetColourParameters // // Returns: OverExposure value to use with SetFlickerCtrl // #define FLICKER_MAX_EXPOSURE 250 #define FLICKER_ALLOWABLE_OVER_EXPOSURE 146 #define FLICKER_BRIGHTNESS_CONSTANT 59 BYTE FindOverExposure( BYTE Brightness ) { BYTE MaxAllowableOverExposure, OverExposure; MaxAllowableOverExposure = FLICKER_MAX_EXPOSURE - Brightness - FLICKER_BRIGHTNESS_CONSTANT; if ( MaxAllowableOverExposure < FLICKER_ALLOWABLE_OVER_EXPOSURE) { OverExposure = MaxAllowableOverExposure; } else { OverExposure = FLICKER_ALLOWABLE_OVER_EXPOSURE; } return OverExposure; }