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

[Documentation Bug] Tap dance example 5, missing cases on switch #14836

Closed
cobac opened this issue Oct 15, 2021 · 3 comments
Closed

[Documentation Bug] Tap dance example 5, missing cases on switch #14836

cobac opened this issue Oct 15, 2021 · 3 comments

Comments

@cobac
Copy link

cobac commented Oct 15, 2021

Hey,

I've implemented the behaviour explained in the 5th example of the tap dance section, but the compiler threw the following errors:

error: enumeration value 'TD_NONE' not handled in switch
error: enumeration value 'TD_UNKNOWN' not handled in switch

I've fixed it adding

...	
			
case TD_NONE:
    break;
case TD_UNKNOWN:
    break;
	}
}

to both functions with a case switch.

void altlp_finished(qk_tap_dance_state_t *state, void *user_data) {

void altlp_reset(qk_tap_dance_state_t *state, void *user_data) {

I'm not submitting a PR because I can't write C and I don't know if my fix is a good solution.

Thanks for maintaining this package!

@ForsakenRei
Copy link
Contributor

ForsakenRei commented Oct 19, 2021

I think you can add

default:
    break;

instead of those two cases. I didn't try it for this example but I think I encountered somthing similar before. For the reset section, I didn't use the defult case and it works fine. I checked my keymap and it actually has the default case in both td_finished and td_reset section.

ForsakenRei added a commit to ForsakenRei/qmk_firmware that referenced this issue Oct 20, 2021
According to qmk#14836, example 5 need the default case to avoid compiling error.
@ForsakenRei
Copy link
Contributor

After checking the doc, in example 6 there is another solution:
ql_tap_state.state = TD_NONE;
I'm not sure what's the difference XD but it should also work.

@joukewitteveen
Copy link
Contributor

I believe this can be closed given that #14893 is merged.

@cobac cobac closed this as completed Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants