-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
TCA9548::disableChannel(uint8_t channel) is not working as expected #20
Comments
Thank you for catching, |
Thanks for the quick response. |
Oops wrong button. |
Good idea, would simplify code a bit. |
Propose code bool TCA9548::enableChannel(uint8_t channel)
{
if (channel >= _channels) return false;
return setChannelMask(_mask | (0x01 << channel));
}
bool TCA9548::disableChannel(uint8_t channel)
{
if (channel >= _channels) return false;
return setChannelMask(_mask & ~(0x01 << channel));
} |
@pghj |
Looks good. Can you also make it return the result of setChannelMask when calling selectChannel? |
Will check after lunch |
done |
@pghj |
@pghj Again thanks for reporting the issue! |
I think disableChannel was copy-pasted from enableChannel, but the condition !isEnabled(channel) was not inverted by mistake.
The text was updated successfully, but these errors were encountered: