Skip to content

Preliminary Giga Touch support on Zephyr #14

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 2, 2025

Zephyr: Added in our preliminary support for touch on the display

In ArduinoCore-zephyr added a callback to register with the input class. When set it simply forwards the callbacks to this function.

Then added some support. We still don't have things like gestures as I don't think the zephyr input class has support for it.

Have a simple touch paint sketch (now supporting multiple touches, that appears to work

Depends on:

@per1234 per1234 added the enhancement New feature or request label Aug 2, 2025
@KurtE
Copy link
Author

KurtE commented Aug 2, 2025

@per1234 @leonardocavagnis and all...

Not sure what to do with this clang format failure? Looks like you added this something like two years ago, and
no one ever actually ran it on the existing code and examples and updated github.

Not sure that is something that should be done as part of this PR? As for example, I have not touched any of your
examples.

Thanks
Kurt

Copy link
Contributor

@iabdalkader iabdalkader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested this yet but I think we should move this to a separate file? For example src/Arduino_GigaDisplayTouchZephyr.cpp and then move the old one to src/Arduino_GigaDisplayTouchMbed.cpp

Also, please fix your formatting. For example:

  • Please pick a style:
Arduino_GigaDisplayTouch::~Arduino_GigaDisplayTouch()
{
}

bool Arduino_GigaDisplayTouch::begin() {
  • Fix indentation:
void Arduino_GigaDisplayTouch::end()
{
        registerGigaTouchCallback(nullptr);
}
  • Remove empty lines such as:
uint8_t Arduino_GigaDisplayTouch::getTouchPoints(GDTpoint_t* points, uint32_t timeout) {

    // First wait to see if we get any events.    
  • Remove empty spaces at end of lines:
    // First wait to see if we get any events.    

@KurtE KurtE force-pushed the zephyr branch 2 times, most recently from c25db92 to 9ca5d22 Compare August 12, 2025 18:27
@KurtE
Copy link
Author

KurtE commented Aug 12, 2025

@iabdalkader - I did a combination, where I tried to merge the two sections of the header file into one.
I then split out the zephyr implementation into it's own .cpp file.

Everything was run through the clang-format
I built both examples on MBED. Fixed that they both gave warnings on order of initialization.

Both run. However the IRQ version dies in MBED after a few touches.

++ MbedOS Error Info ++
Error Status: 0x80FF0144 Code: 324 Module: 255
Error Message: Assertion failed: id
Location: 0x8048FE1
File: Event.h+207
Error Value: 0x0
Current Thread: main Id: 0x24003200 Entry: 0x80451AD StackSize: 0x8000 StackMem: 0x24004698 SP: 0x2407FEEC
For more info, visit: https://mbed.com/s/error?error=0x80FF0144&osver=61700&core=0x411FC271&comp=2&ver=90200&tgt=GIGA
-- MbedOS Error Info --

Not related to any changes I made as did not change anything, except the order as I mentioned and it
failed before that change as well.

Let me know what you think.

@KurtE KurtE requested a review from iabdalkader August 12, 2025 18:44
@KurtE
Copy link
Author

KurtE commented Aug 12, 2025

Here is a test sketch that can do the touchpaint that I am showing in the ArduinoCore-zephyr PR. I modified it such that
it now works on both MBED and zephyr.

zephyr_GIGA_shield_touchpaint-250812a.zip

Copy link
Contributor

@iabdalkader iabdalkader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I had many comments on the cpp file, so I thought it would just be easier to send you an updated file. See the attached file.

  • Again, please use the name suggested in my first review:
    Arduino_GigaDisplayTouchZephyr.cpp

  • I've already formatted the library and renamed the mbed implementation in #15, so please revert any unrelated changes to minimize your diff.

Arduino_GigaDisplayTouchZephyr.cpp.txt

@KurtE KurtE force-pushed the zephyr branch 2 times, most recently from cbcc030 to 54bd49c Compare August 13, 2025 15:49
@KurtE
Copy link
Author

KurtE commented Aug 13, 2025

I believe I have all of your changes pulled in now. I rebased off of your updated main branch, and then
add in your changes. Had to do a few fixes, like #ifdef MBED in the mbed version so that it
would not build on zephyr.

I have also updated to your changes on the ArduinoCore-zephyr rebuilt and ran with this updated version

Zephyr: Added in our preliminary support for touch on the display

In ArduinoCore-zephyr added a callback to register with the
input class.  When set it simply forwards the callbacks to
this function.

Then added some support.  We still don't have things like
gestures as I don't think the zephyr input class has support
for it.

Have a simple touch paint sketch (now supporting multiple
touches, that appears to work

Edit: The header file now combines the two different
versions of the class into one.

Added #ifdef __MBED__ in the mbed implementation file so that
the code would not compile when we are doing zephyr builds

clang-format -i of Arduino_GigaDisplayTouchZephyr.cpp

clang-format -i Arduino_GigaDisplayTouch.h
@iabdalkader
Copy link
Contributor

Please fix the formatting issues, see https://github.com/arduino-libraries/Arduino_GigaDisplayTouch/actions/runs/16943340161/job/48017964802?pr=14

Otherwise, looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants