Skip to content
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

lcd_touch_ft5x06: Fixed missing reset. #216

Merged
merged 3 commits into from
Sep 8, 2023
Merged

Conversation

espzav
Copy link
Collaborator

@espzav espzav commented Aug 30, 2023

ESP-BSP Pull Request checklist

  • Version of modified component bumped
  • CI passing

Change description

Fixed missing reset call in esp_lcd_touch_ft5x06.
Fixed interrupt level in all touch drivers.
Closes #211

@espzav espzav force-pushed the fix/lcd_touch_ft5x06_reset branch from 5204c0e to d60faf6 Compare August 30, 2023 06:56
@espzav espzav force-pushed the fix/lcd_touch_ft5x06_reset branch from d60faf6 to aee920d Compare August 30, 2023 07:01
@espzav espzav requested review from igrr and tore-espressif August 30, 2023 07:35
@espzav espzav force-pushed the fix/lcd_touch_ft5x06_reset branch from 94b083b to 5a4a565 Compare September 5, 2023 08:27
@Lzw655
Copy link
Collaborator

Lzw655 commented Sep 6, 2023

@espzav Oh, there is one more thing. We should remove the ISR handler in del() like below:

    if (tp->config.rst_gpio_num != GPIO_NUM_NC) {
        gpio_reset_pin(tp->config.rst_gpio_num);
        if (tp->config.interrupt_callback) {
            gpio_isr_handler_remove(tp->config.int_gpio_num);
        }
    }

Copy link
Collaborator

@tore-espressif tore-espressif left a comment

Choose a reason for hiding this comment

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

Overall LGTM.

But I agree with @Lzw655 that we could use this PR for fixing the 'delete' behavior.

Moreover, I'd suggest moving the 'delete' function to the base component esp_lcd_touch.
So the esp_lcd_touch would deregister the ISR and reset all pins to default. What do you think @espzav ?

Becasue this section of code

/* Reset GPIO pin settings */
    if (tp->config.int_gpio_num != GPIO_NUM_NC) {
        gpio_reset_pin(tp->config.int_gpio_num);
    }

    /* Reset GPIO pin settings */
    if (tp->config.rst_gpio_num != GPIO_NUM_NC) {
        gpio_reset_pin(tp->config.rst_gpio_num);
    }

is called from every touch driver, but the base esp_lcd_touch can do it, too

@espzav
Copy link
Collaborator Author

espzav commented Sep 7, 2023

Moreover, I'd suggest moving the 'delete' function to the base component esp_lcd_touch.
So the esp_lcd_touch would deregister the ISR and reset all pins to default. What do you think @espzav ?

I partially agree, but it wouldn't be consistent, because initialization will be in end driver ( esp_lcd_touch_xxx), but removing in esp_lcd_touch. Are you sure, that it is good solution?

@tore-espressif
Copy link
Collaborator

I partially agree, but it wouldn't be consistent, because initialization will be in end driver ( esp_lcd_touch_xxx), but removing in esp_lcd_touch. Are you sure, that it is good solution?

True, unless we can move the initialization to the base esp_lcd_touch too, we can leave it as it is

@espzav espzav force-pushed the fix/lcd_touch_ft5x06_reset branch from 5a4a565 to dfea0ed Compare September 7, 2023 06:49
@espzav espzav force-pushed the fix/lcd_touch_ft5x06_reset branch from dfea0ed to 7f3f266 Compare September 8, 2023 05:58
@espzav
Copy link
Collaborator Author

espzav commented Sep 8, 2023

@tore-espressif and @Lzw655 Thank you for review. All changes done.

@tore-espressif Could we merge it?

Copy link
Collaborator

@tore-espressif tore-espressif left a comment

Choose a reason for hiding this comment

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

LGTM!

@espzav espzav merged commit ceb77a4 into master Sep 8, 2023
@espzav espzav deleted the fix/lcd_touch_ft5x06_reset branch September 8, 2023 08:21
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.

no reset signal on reset pin (BSP-370)
3 participants