application: fix going to last channel

This commit is contained in:
King Kévin 2021-03-12 13:10:25 +01:00
parent 57bfbbecd1
commit 1946a5b40c
1 changed files with 3 additions and 3 deletions

View File

@ -257,7 +257,7 @@ static void command_voltages(void* argument)
float* voltages;
print_target(); // print target voltage (also sets measurement conditions)
puts("signal voltages:\n");
for (uint8_t i = channel_start; i < channel_stop; i++) {
for (uint8_t i = channel_start; i <= channel_stop; i++) {
puts("- ");
puts(channel_names[i]);
mux_select(i); // select the channel
@ -284,7 +284,7 @@ static void command_types(void* argument)
gpio_set(GPIO_PORT(SIGNAL_PU_PIN), GPIO_PIN(SIGNAL_PU_PIN)); // ensure pull-up is not active
gpio_set(GPIO_PORT(TARGET_EN), GPIO_PIN(TARGET_EN)); // ensure the level shifters pulling up the signals are not enabled
for (uint8_t i = channel_start; i < channel_stop; i++) {
for (uint8_t i = channel_start; i <= channel_stop; i++) {
puts(channel_names[i]);
puts(" ");
mux_select(i); // select the channel
@ -354,7 +354,7 @@ static void command_channel_start(void* argument)
{
if (argument) {
const uint32_t channel = *(uint32_t*)argument;
if (channel < CHANNEL_NUMBERS && channel < channel_start) {
if (channel < CHANNEL_NUMBERS && channel < channel_stop) {
channel_start = channel;
}
}