application: minor, improve channel selection
This commit is contained in:
parent
baaa435de8
commit
89f8c80093
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue