Skip to content

Add support for receiving input callback in sketches. #165

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KurtE
Copy link

@KurtE KurtE commented Aug 4, 2025

Add a callback function for the touch device
within the fixups for the GIGA. This callback
simply remembers the last touch that happened and
sets a semaphore.

There is also a function added to retrieve this data.

Needed to add the callback function into the exports file.

EDIT: As I mentioned in
#92

This is maybe not a complete setup yet. Currently the zephyr touch device is configured for only one touch
Where it believe is supposed to support up to 5. Also with it only doing one touch, it does not support
gestures. I will integrate our WIP touch code into the Arduino_GIGATouch library such that it is all
available for us or others to fill this in.

This is a replacement for #134
...
See that one for more details, like, I have an open PR for the touch library to work on zephyr...
arduino-libraries/Arduino_GigaDisplayTouch#14

image

@KurtE KurtE force-pushed the giga_display_callback_yet_again branch from e7a6779 to 0d8730c Compare August 4, 2025 15:24
@KurtE
Copy link
Author

KurtE commented Aug 4, 2025

Oh Joy... Looks like now trying to make PRs about as fun as doing them for Zephyr...

Now deciding if worth...

@KurtE KurtE force-pushed the giga_display_callback_yet_again branch 2 times, most recently from 7b2d2eb to 124e759 Compare August 4, 2025 16:24
@pillo79
Copy link

pillo79 commented Aug 4, 2025

@KurtE apologies for the issues, I was in a rush to complete the next release and cut some corners with disastrous consequences. 💥
The current CI issues in this PR are caused by a wrong commit on main that has since been fixed. Please rebase your PR over the latest commit, and all should be fine.

@KurtE KurtE force-pushed the giga_display_callback_yet_again branch 3 times, most recently from b6d6e20 to f3fc6a3 Compare August 4, 2025 19:34
@KurtE
Copy link
Author

KurtE commented Aug 4, 2025

@KurtE apologies for the issues, I was in a rush to complete the next release and cut some corners with disastrous consequences. 💥 The current CI issues in this PR are caused by a wrong commit on main that has since been fixed. Please rebase your PR over the latest commit, and all should be fine.

Not a problem:

Done. Also other blinky-blink changes, like making sure no comment line in commit > 75 characters.

Question: Should we close out the PR this replaces? I am guessing yes, but.

P.S - I don't like this signoff stuff! I purposely did not have my full name and email address public on Github, but those
are required for all PRs...

And the checkpatch stuff is a PIA. Especially some styling things like:
It now errors out on:

a)
if (a != nullptr) (a)();

b)

if (a != nullptr) {
    (a)();
}

It only accepts:
c)

if (a != nullptr)
    (a)();

Whereas I believe zephyr requires b)

Sorry...

@iabdalkader iabdalkader changed the title GiGA Touch - Allow us to define a callback function and add a forward… Add support for receiving input callback in sketches. Aug 13, 2025
@KurtE KurtE force-pushed the giga_display_callback_yet_again branch from 677f7c8 to c20d473 Compare August 13, 2025 19:54
@KurtE KurtE force-pushed the giga_display_callback_yet_again branch from c20d473 to cc653be Compare August 14, 2025 13:00
Register a callback function to be called by the zephyr input system.

This new code is only there if it is a GIGA and
CONFIG_INPUT_GT911_INTERRUPT is defined.

This includes adding a callback function that is linked in to the
zephyr build,  and export a function to call to allow us to register
 our own.

Added an init variant to GIGA that if the touch interrupt is enabled,
then it will clear out the old user defined callback if any.

Signed-off-by: Kurt Eckhardt  <kurte@rockisland.com>
@KurtE KurtE force-pushed the giga_display_callback_yet_again branch from cc653be to 2a17a7a Compare August 14, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants