adafruit / Adafruit_LvGL_Glue

“Glue” library between LittlevGL and Adafruit GFX (SPITFT)
Other
35 stars 14 forks source link

Be able to overwrite the touchscreen define values #21

Open t08094a opened 1 year ago

t08094a commented 1 year ago

I have an Adafruit PyPortal Titano. Using the LvGL Glue component the touch points are shifted. So I have executed a callibration and the values of the ADC_* defines in Adafruit_LvGL_Glue.cpp divergate to the ones I need for my PyPortal Titano. Therefor I identified the following values:

#define ADC_XMIN 200
#define ADC_XMAX 870
#define ADC_YMIN 120
#define ADC_YMAX 920

So that there could be other touch devices with other values in the future, it would be great to be able to overwrite those defined values from external.

Therefor I would be appreciate, if those defines could be wrapped in ifndef constructs.

brentru commented 1 year ago

@t08094a Hi, two questions.

1) How did you execute a calibration? 2) Are the ADC_... #defines from the board definition? Where are they defined globally?

t08094a commented 1 year ago
  1. How did you execute a calibration?

I checked the touch point values while pointing in the edges of the display.

  1. Are the ADC_... #defines from the board definition? Where are they defined globally?

I have defined them as compiler arguments:

build_flags = 
    -DLV_CONF_INCLUDE_SIMPLE
    -DLV_LVGL_H_INCLUDE_SIMPLE
    -DADC_XMIN=200
    -DADC_XMAX=870
    -DADC_YMIN=120
    -DADC_YMAX=920
    -I ./include