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

Added SPLIT_HAPTIC_ENABLE to trigger haptic feedback on the slave keyboard half #16233

Closed
wants to merge 1 commit into from

Conversation

sffubs
Copy link

@sffubs sffubs commented Feb 5, 2022

For DRV2505L boards, this will send the feedback mode from master to slave. For solenoids, it will simply trigger
with the current settings - it is expected that the slave half sets its own solenoid settings.

Description

When a haptic event is triggered haptic_play() is invoked. When SPLIT_HAPTIC_ENABLE is set, a new global variable split_haptic_enable is set to the current play mode (for DRV2605L boards) or 1 (for solenoid). This then gets sent across to the slave half, where it triggers haptic_play(). split_haptic_enable is then reset to 0xFF, which is an unused waveform in the DRV2605L library, until the next haptic event.

I have tested this on my keyboard with DRV2605L boards, and it works as expected. I do not have a solenoid to test with.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

…board half.

For DRV2505L boards, this will send the feedback mode from master to slave. For solenoids, it will simply trigger
with the current settings - it is expected that the slave half sets its own solenoid settings.
uint8_t split_haptic_play = 0xFF;

static bool haptic_handlers_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) {
bool okay = transport_write(PUT_HAPTIC, &split_haptic_play, sizeof(split_haptic_play));
Copy link
Member

Choose a reason for hiding this comment

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

If anything, the entire haptic config structure should be synced over, not just the mode. Especially as the "enable" states isn't being synced.

Copy link
Author

Choose a reason for hiding this comment

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

Any concerns about the size of the haptic structure when sync'd? I guess it's only 8 bytes, but split transport seems sensitive to size of data being transported, at least from reading the docs.

As the patch is structured, it's not a concern that the enable state isn't sync'd, since haptic events are triggered by haptic_play(), which would only be invoked if enable status is true.

Copy link
Member

Choose a reason for hiding this comment

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

It should be fine. Mostly, it gets synced if there are changes, but that shouldn't be too often. And then forcibly synced on the forced timeout (defaults to 500ms).

So for the sync, it shouldn't be too much.

@stale
Copy link

stale bot commented Apr 16, 2022

Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.

@tzarc
Copy link
Member

tzarc commented May 15, 2022

Deferred to Q3 cycle due to conflicts and unaddressed concerns.

@github-actions
Copy link

Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with bug, awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.

@github-actions github-actions bot added the stale Issues or pull requests that have become inactive without resolution. label Jul 15, 2022
@github-actions github-actions bot removed the stale Issues or pull requests that have become inactive without resolution. label Jul 28, 2022
@tzarc tzarc added stale Issues or pull requests that have become inactive without resolution. breaking_change_2022q4 and removed breaking_change_2022q3 labels Aug 25, 2022
@github-actions
Copy link

Thank you for your contribution!
This pull request has been automatically closed because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, or re-open when it's ready.
// [stale-action-closed]

@github-actions github-actions bot closed this Sep 25, 2022
@shaunsingh
Copy link

Hi, was there any update on this? If not, is the only fix necessary to sync the whole haptic structure rather than the mode? I'm working on a split keyboard with haptics and would love to see this get finished/merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core documentation stale Issues or pull requests that have become inactive without resolution.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants