Various improvements (#547)
- Fixed crash when returning to Setup app (from any of the steps) - Fixed crash when returning to TimeDateSettings app (after locale selection) - Fixed GuiService inconsistent behaviour: now always perform operations async (e.g. to show/hide apps). This fixes crashes in some onHide() calls where onHide() might be called before onShow() was called. - Fix for incorrect WebServService path - Remove CYD-4848S040C SD card functionality, but added a GPIO fix for releasing 3-wire SPI pin sharing. - Fix for saving/loading settings for various apps
This commit is contained in:
committed by
GitHub
parent
a323f8e148
commit
ecad2248d9
@@ -12,9 +12,25 @@
|
||||
#include <esp_lcd_panel_ops.h>
|
||||
#include <esp_lcd_panel_io_additions.h>
|
||||
#include <esp_lcd_st7701.h>
|
||||
#include <esp_rom_gpio.h>
|
||||
#include <soc/spi_periph.h>
|
||||
#include <driver/spi_master.h>
|
||||
|
||||
static const auto LOGGER = tt::Logger("St7701Display");
|
||||
|
||||
// GPIO47/48 are physically shared between this bit-banged 3-wire command bus
|
||||
// and the SD card's real SPI2 bus (no alternate pins exist on this PCB).
|
||||
// esp_lcd_new_panel_io_3wire_spi() reconfigures them as plain GPIO via
|
||||
// gpio_config(), severing their SPI2 matrix routing. Reconnect them here once
|
||||
// the vendor init sequence is done, so SD card reads/writes keep working.
|
||||
// Safe only because nothing else calls into the ST7701 IO handle after boot.
|
||||
static void reclaimSpiPinsForSdCard() {
|
||||
esp_rom_gpio_connect_out_signal(GPIO_NUM_47, spi_periph_signal[SPI2_HOST].spid_out, false, false);
|
||||
esp_rom_gpio_connect_out_signal(GPIO_NUM_48, spi_periph_signal[SPI2_HOST].spiclk_out, false, false);
|
||||
gpio_set_direction(GPIO_NUM_47, GPIO_MODE_OUTPUT);
|
||||
gpio_set_direction(GPIO_NUM_48, GPIO_MODE_OUTPUT);
|
||||
}
|
||||
|
||||
static const st7701_lcd_init_cmd_t st7701_lcd_init_cmds[] = {
|
||||
// {cmd, { data }, data_size, delay_ms}
|
||||
{0xFF, (uint8_t[]) {0x77, 0x01, 0x00, 0x00, 0x10}, 5, 0},
|
||||
@@ -181,6 +197,8 @@ bool St7701Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_lc
|
||||
return false;
|
||||
}
|
||||
|
||||
reclaimSpiPinsForSdCard();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user