-
-
Notifications
You must be signed in to change notification settings - Fork 16
GIGA Display Shield: How to capture touch events? #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Quick note:
Note: if you hold your finger down at all, you will see a lot of messages like:
|
Edit: meant to add it to this issue instead of display library issue. Quick notes: It was unclear to me how I might adapt the Arduino_GigaDisplayTouch library to zephyr. There is a PT911 object As as soon as I touch the display I get lots of these messages in the monitor window:
I know that the PT911 class is looking for me to hook up a callback function. like some of the input samples show: The response I received:
My read of this is, that I would need to add the callback code into some place that is built into the loader, like maybe fixups.c |
Experiments update: Trying directly on zephyr: I put a copy of it up at: https://github.com/KurtE/zephyr_test_sketches/tree/master/print_touch_events
Which when I touch the display I get messages like:
With a reasonable response, although there is a delay for the release... Built on Ubuntu and Windows using west build... ArduinoCore-zephyr: I added similar code to the above into fixups.c and added entry to llext_exports.c Note: currently just an experiment and if actually works out, maybe should be conditional on if LVGL is defined for the build. Currently:
Added the callback, added semaphore, and had it init in the camera_ext_clock_enable. In the exports I added the callback in the section:
So far really really bad performance/latency!!!
Edit: test sketch with the touch code in it: Not sure if something blocking? threads? priorities? ... |
@iabdalkader @pillo79 @facchinm @mjs513 (and all) Quick update: One issue I had with my code was to have printk calls in the callback function mentioned in previous mentioned so I removed it. It still was still not working right. So I created another test sketch: up on my github.... zephyr_GIGA_shield_touch_only, where I started from the So wondering if the display update code is running long periods of time and that thread is being starved? Wondered if maybe increasing the size of the QUEUE might help, so tried:
Wondering what else to try? Like maybe have PT911 not be interrupt? in the config for GIGA under the shield it has Side note: I was curious about threads in sketches. So I hacked up our test sketch: GIGA_Display_first: I added a thread to the sketch, that blinks a pin and every n
And the sketch runs and when it reaches the end of main, the thread never runs again. However if I change loop to:
The issue is in cores\arduino\main.cpp:
There is nothing in the for loop calling loop() that yields or delays... So this logical thread never |
I am trying to understand how to have an Arduino sketch be able to use the touch events generated
by the GIGA Display shield.
If I look at the overlay file, that is defined for the giga in zephyr:
D:\github\zephyr\boards\shields\giga_display_shield\boards\arduino_giga_r1_m7.overlay
It has:
So it is using the gt911 input ... It has status of okay so it starts up. with IRQ on GPIO I1...
And it is probably using the code in zephyr\drivers\input\input_gt911.c
I found the zephyr example: samples\subsys\input\draw_touch_events, which I was curious if it would
build and run... So far did not build.
Thought I would try doing the same thing in a sketch, however I don't think this will work.
As I don't believe the INPUT_CALLBACK_DEFINE will work in a sketch?
Wondering best way to handle this?
Potentially, maybe define some callback within the ArduinoCore-zephyr code space.
Like maybe in loader\fixups.c ?
Turn off the interrupt? And try to poll it?
Suggestions?
The text was updated successfully, but these errors were encountered: