GithubHelp home page GithubHelp logo

Comments (7)

jeremyjh avatar jeremyjh commented on June 11, 2024

Good catch. So basically right now the demo won't ever enable the touch controller. @C47D did we actually need to only conditionally include those headers? Was there a warning that this resolved?

from lv_port_esp32.

C47D avatar C47D commented on June 11, 2024

Hi,

I actually used it to avoid registering lv_indev_drv_t indev_drv when using the ESP32-WroverKit v4.1 (which soesn't include the touch controller).
https://github.com/littlevgl/lv_port_esp32_ili9341/blob/d797cb40dcf57d357fd530c9e8a40fd5872b3bd9/main/main.c#L54-L60

Should we apply the following patch?

diff --git a/main/main.c b/main/main.c
index 35d47ef..cabb2ec 100644                                                                                        --- a/main/main.c
+++ b/main/main.c
@@ -21,10 +21,8 @@
 #include "disp_spi.h"
 #include "ili9341.h"

-#if ENABLE_TOUCH_INPUT
 #include "tp_spi.h"
 #include "xpt2046.h"                                                                                                
-#endif

 static void IRAM_ATTR lv_tick_task(void);

@@ -51,7 +49,7 @@ void app_main()
        disp_drv.buffer = &disp_buf;
        lv_disp_drv_register(&disp_drv);

-#if ENABLE_TOUCH_INPUT
+#if (ENABLE_TOUCH_INPUT == 1)
     lv_indev_drv_t indev_drv;
     lv_indev_drv_init(&indev_drv);
     indev_drv.read_cb = xpt2046_read;

from lv_port_esp32.

jeremyjh avatar jeremyjh commented on June 11, 2024

The #ifdef related to the driver registration in line 53 was already there, the patch in question only made the #includes conditional, but they are conditional on a macro set in that same include file, so basically it will never be defined and the touch panel will never be registered. I don't think we need the includes to be conditional.

from lv_port_esp32.

jeremyjh avatar jeremyjh commented on June 11, 2024

Sorry I kind of talked past your comment; yes your patch will fix it but line 54 is fine as it was I think.

from lv_port_esp32.

C47D avatar C47D commented on June 11, 2024

If we compare the value of ENABLE_TOUCH_INPUT to 0 or 1 the code surrounded by the #if will only be active if the user enables the touch input, otherwise (the #if alone) that code will always be enabled, with touch input enabled or not. Please let me know if I'm wrong (just returned to work after a long weekend :P).

from lv_port_esp32.

jeremyjh avatar jeremyjh commented on June 11, 2024

#if will include the block if the value of the expression is non-zero. If ENABLE_TOUCH_INPUT is 0, the code is not included, otherwise it is. I added this code in an earlier PR because on the M5 if you enable the touchpad driver with default settings there is a GPIO conflict and you'll never even see anything appear on the screen.

from lv_port_esp32.

C47D avatar C47D commented on June 11, 2024

Sorry, didn't knew that, just submitted a PR trying to solve the issue, please let me know if it does.

from lv_port_esp32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.