diff --git a/platform/drivers/display/HX83XX_MDx.c b/platform/drivers/display/HX83XX_MDx.c index 165b0a5e..14bad57c 100644 --- a/platform/drivers/display/HX83XX_MDx.c +++ b/platform/drivers/display/HX83XX_MDx.c @@ -331,14 +331,15 @@ void display_renderRows(uint8_t startRow, uint8_t endRow) /* * Put screen data lines back to alternate function mode, since they are in * common with keyboard buttons and the keyboard driver sets them as inputs. - * Little HACK: we bypass GPIO API and write directly into GPIO control - * registers. */ - - GPIOD->MODER &= ~0xF000000F; /* Clear old values */ - GPIOE->MODER &= ~0x3FC000; - GPIOD->MODER |= 0xA000000A; /* Back to AF mode */ - GPIOE->MODER |= 0x2A8000; + gpio_setMode(LCD_D0, ALTERNATE); + gpio_setMode(LCD_D1, ALTERNATE); + gpio_setMode(LCD_D2, ALTERNATE); + gpio_setMode(LCD_D3, ALTERNATE); + gpio_setMode(LCD_D4, ALTERNATE); + gpio_setMode(LCD_D5, ALTERNATE); + gpio_setMode(LCD_D6, ALTERNATE); + gpio_setMode(LCD_D7, ALTERNATE); gpio_clearPin(LCD_CS); diff --git a/platform/drivers/keyboard/keyboard_MDx.c b/platform/drivers/keyboard/keyboard_MDx.c index 870775aa..00210780 100644 --- a/platform/drivers/keyboard/keyboard_MDx.c +++ b/platform/drivers/keyboard/keyboard_MDx.c @@ -54,14 +54,14 @@ keyboard_t kbd_getKeys() * with the display, their configuration can have been screwed up by display * driver among two subsequent calls of this function. */ - gpio_setMode(LCD_D0, INPUT); - gpio_setMode(LCD_D1, INPUT); - gpio_setMode(LCD_D2, INPUT); - gpio_setMode(LCD_D3, INPUT); - gpio_setMode(LCD_D4, INPUT); - gpio_setMode(LCD_D5, INPUT); - gpio_setMode(LCD_D6, INPUT); - gpio_setMode(LCD_D7, INPUT); + gpio_setMode(LCD_D0, INPUT_PULL_DOWN); + gpio_setMode(LCD_D1, INPUT_PULL_DOWN); + gpio_setMode(LCD_D2, INPUT_PULL_DOWN); + gpio_setMode(LCD_D3, INPUT_PULL_DOWN); + gpio_setMode(LCD_D4, INPUT_PULL_DOWN); + gpio_setMode(LCD_D5, INPUT_PULL_DOWN); + gpio_setMode(LCD_D6, INPUT_PULL_DOWN); + gpio_setMode(LCD_D7, INPUT_PULL_DOWN); /* * Scan keyboard by coloumns.