application: minor, improve channel selection

This commit is contained in:
King Kévin 2021-03-11 14:22:59 +01:00
parent baaa435de8
commit 89f8c80093
1 changed files with 1 additions and 1 deletions

View File

@ -190,7 +190,7 @@ static void print_target(void)
static void mux_select(int8_t channel)
{
gpio_set(GPIO_PORT(MUX_EN_PIN), GPIO_PIN(MUX_EN_PIN)); // disable multiplexer while we are switching
if (channel < 0 || channel > 15) {
if (channel < 0 || channel > 15 || (channel > CHANNEL_NUMBERS - 1)) {
return; // no channel to select
}
// select channel using bit pattern