From 3a67b4d6d262d708888af71f78a49b3d5614cb24 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 28 Sep 2016 13:37:05 +0200 Subject: [PATCH] enable hw reset of display --- extmod/modtrezorui/display-stmhal.h | 19 +++++++++++-------- vendor/micropython | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/extmod/modtrezorui/display-stmhal.h b/extmod/modtrezorui/display-stmhal.h index 8ed8f7f7e..964c93f7d 100644 --- a/extmod/modtrezorui/display-stmhal.h +++ b/extmod/modtrezorui/display-stmhal.h @@ -25,17 +25,15 @@ void display_sram_init(void) { __TIM1_CLK_ENABLE(); __FSMC_CLK_ENABLE(); -/* - // LCD_RST/PA3 - GPIO_InitStructure.Pin = GPIO_PIN_3; + GPIO_InitTypeDef GPIO_InitStructure; + + // LCD_RST/PC14 + GPIO_InitStructure.Pin = GPIO_PIN_14; GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStructure.Pull = GPIO_PULLUP; GPIO_InitStructure.Speed = GPIO_SPEED_HIGH; - HAL_GPIO_Init(GPIOA, &GPIO_InitStructure); - HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, GPIO_PIN_SET); -*/ - - GPIO_InitTypeDef GPIO_InitStructure; + HAL_GPIO_Init(GPIOC, &GPIO_InitStructure); + HAL_GPIO_WritePin(GPIOC, GPIO_PIN_14, GPIO_PIN_SET); GPIO_InitStructure.Mode = GPIO_MODE_AF_PP; GPIO_InitStructure.Pull = GPIO_NOPULL; @@ -197,6 +195,11 @@ int display_orientation(int degrees) void display_init(void) { display_sram_init(); + // hardware reset + HAL_GPIO_WritePin(GPIOC, GPIO_PIN_14, GPIO_PIN_RESET); + HAL_Delay(20); + HAL_GPIO_WritePin(GPIOC, GPIO_PIN_14, GPIO_PIN_SET); + HAL_Delay(5); #if DISPLAY_ILI9341V || DISPLAY_ST7789V CMD(0x01); // software reset HAL_Delay(20); diff --git a/vendor/micropython b/vendor/micropython index b4f524ee5..26604dc1a 160000 --- a/vendor/micropython +++ b/vendor/micropython @@ -1 +1 @@ -Subproject commit b4f524ee5837b7ae25c2796ff2673f3bd8764d68 +Subproject commit 26604dc1ac41b432e617f56f5a35cb53820e70a4