1.1 --- a/stage2/tasks/keyscan.c Wed Jul 12 15:46:53 2017 +0200
1.2 +++ b/stage2/tasks/keyscan.c Sun Jul 23 17:44:24 2017 +0200
1.3 @@ -56,7 +56,7 @@
1.4 task_gpio_as_input(GPIO_KEYOUT_COL[pin]);
1.5 }
1.6
1.7 - task_gpio_as_input(GPIO_POWER);
1.8 + task_gpio_as_input(gpio_global_pin(GPIO_PORT_POWER, GPIO_POWER));
1.9 }
1.10
1.11 /* Tasks. */
1.12 @@ -74,9 +74,11 @@
1.13 for (column = 0; column < GPIO_KEYOUT_COUNT; column++)
1.14 {
1.15 task_gpio_as_output(GPIO_KEYOUT_COL[column]);
1.16 + task_gpio_clear_pin(GPIO_KEYOUT_COL[column]);
1.17 +
1.18 + /* Employ a delay to avoid catching the last column's reading. */
1.19
1.20 for (unsigned int delay = 0; delay < 1000; delay++)
1.21 - task_gpio_clear_pin(GPIO_KEYOUT_COL[column]);
1.22
1.23 value = 0;
1.24
1.25 @@ -92,7 +94,7 @@
1.26 task_gpio_as_input(GPIO_KEYOUT_COL[column]);
1.27 }
1.28
1.29 - plot_value(100, 110, 0, 80, task_gpio_get_pin(GPIO_POWER) ? 0xff : 0);
1.30 + plot_value(100, 110, 0, 80, task_gpio_get_pin(gpio_global_pin(GPIO_PORT_POWER, GPIO_POWER)) ? 0xff : 0);
1.31 }
1.32 }
1.33