AnsweredAssumed Answered

egui touch calibration

Question asked by Toe on Nov 22, 2011
Latest reply on Dec 1, 2011 by Petr Gargulak

I am a little confused by some things on a 240x320 screen.  Our display comes oriented in portrait mode, so the built in touch calibration is misleading when following the xr, xl, yu, yd inputs from the display.  Calibrating in portrait mode causes the x and y count per pixel to be divided by the wrong value.  The code is in d4d_low.c

 

snip:

...// Calculate number of (bits / pixel) * 16 for Xd4d_tchCalib.TouchScreenXBitsPerPixelx16 = (Word)((dX * 16)/(D4D_SCREEN_SIZE_LONGER_SIDE - D4DTCH_CALIB_CROSS_OFFSET * 2));// Does number of ADC bits per pixel in X seem reasonable?if (d4d_tchCalib.TouchScreenXBitsPerPixelx16 < ((16 * p_tchRawLimits->rawDataScale) / D4D_SCREEN_SIZE_LONGER_SIDE))        {    // Calculate number of (bits / pixel) * 16 for Y    d4d_tchCalib.TouchScreenYBitsPerPixelx16 = (Word)((dY * 16)/(D4D_SCREEN_SIZE_SHORTER_SIDE - D4DTCH_CALIB_CROSS_OFFSET * 2));    // Does number of ADC bits per pixel in Y seem reasonable?    if (d4d_tchCalib.TouchScreenYBitsPerPixelx16 < ((16 * p_tchRawLimits->rawDataScale) / D4D_SCREEN_SIZE_SHORTER_SIDE))...

 

Since this screen we are using defaults to "portrait" the x and y are reversed.  x is the shorter side and when displaying this during calibration the text would be reversed as well.

 

This isn't a hard fix, just commenting that it might be helpful to make this more configurable in the user_cfg.

Outcomes