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

Updated auto sleep functionality and added user interrupt #12

Merged
merged 2 commits into from
Oct 27, 2024

Conversation

georgemclaughlin
Copy link
Contributor

Summary

This PR introduces improvements to the CST816S library by refining power management options and adding support for user-defined interrupt handling.

Key Changes

  1. Auto Sleep Management:

    • Added disable_auto_sleep(), enable_auto_sleep(), and set_auto_sleep_time(int seconds) methods for improved control over the auto-sleep feature, allowing users to customize power-saving behavior.
  2. User-Defined Interrupt Support:

    • Added attachUserInterrupt(std::function<void(void)> callback), allowing users to attach a custom interrupt handler for touch events. This enables application-specific handling, such as waking from sleep modes or gesture-based logic.
  3. Code Cleanup:

    • Removed enable_auto_standby(uint16_t milliseconds), streamlining the interface and focusing on the new auto-sleep methods.

These updates provide finer control over power modes and offer flexibility in handling touch events, making the library more versatile for power-sensitive applications.

@fbiego fbiego merged commit 03e28b7 into fbiego:main Oct 27, 2024
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.

2 participants