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

[Bug]: Canned message pin configuration doesn't allow zero #5834

Closed
devinmartin opened this issue Jan 13, 2025 · 1 comment · Fixed by #5838
Closed

[Bug]: Canned message pin configuration doesn't allow zero #5834

devinmartin opened this issue Jan 13, 2025 · 1 comment · Fixed by #5838
Assignees
Labels
bug Something isn't working

Comments

@devinmartin
Copy link

Category

Other

Hardware

Heltec V3

Firmware Version

2.5.15

Description

The code in the scanAndSelect section of the canned message module does not allow GPIO zero to be configured. It considers a setting of zero to be undefined. This doesn't allow me to use the built in button on the heltec v3 for this function. The code in question is located in src/input/ScanAndSelect.cpp

    if (moduleConfig.canned_message.inputbroker_pin_press)
        pin = moduleConfig.canned_message.inputbroker_pin_press;
    else if (moduleConfig.canned_message.inputbroker_pin_a)
        pin = moduleConfig.canned_message.inputbroker_pin_a;
    else if (moduleConfig.canned_message.inputbroker_pin_b)
        pin = moduleConfig.canned_message.inputbroker_pin_b;
    else
        return false; // Short circuit: no button found

The intent here is good as it prevents unconfigured pins from being used. However the case where an actual value of zero needs to be used won't work.

Relevant log output

No response

@devinmartin
Copy link
Author

I pulled the commit hash for the proposed pull request and built and uploaded it to a heltec v3. I can confirm that the change works on a heltec v3 AND that if the user pin is configured to its default setting of GPIO0, that takes priority and the scan and select honors that and doesn't fight with the base functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants