Fixed bug in MD3x keyboard driver causing the generation of an UP keypress at boot (#48)

pull/53/head
Silvano Seva 2021-11-10 19:29:34 +01:00
rodzic 691b388228
commit 38c6a7fee6
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -26,6 +26,8 @@
#include <interfaces/platform.h>
#include "hwconfig.h"
static int8_t old_pos = 0;
void kbd_init()
{
/* Set the two row lines as outputs */
@ -35,6 +37,9 @@ void kbd_init()
gpio_clearPin(KB_ROW1);
gpio_clearPin(KB_ROW2);
gpio_clearPin(KB_ROW3);
/* Initialise old position */
old_pos = platform_getChSelector();
}
void kbd_terminate()
@ -53,7 +58,6 @@ keyboard_t kbd_getKeys()
keyboard_t keys = 0;
/* Read channel knob to send KNOB_LEFT and KNOB_RIGHT events */
static int8_t old_pos = 0;
int8_t new_pos = platform_getChSelector();
if (old_pos != new_pos)
{