1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 14:28:07 +00:00

fix(core): adjust T2B1 display SPI baudrate

[no changelog]
This commit is contained in:
tychovrahe 2023-10-02 12:36:04 +02:00 committed by TychoVrahe
parent 07fb451048
commit e39ab74949

View File

@ -141,7 +141,8 @@ static inline void spi_send(const uint8_t *data, int len) {
void display_handle_init(void) { void display_handle_init(void) {
spi_handle.Instance = OLED_SPI; spi_handle.Instance = OLED_SPI;
spi_handle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8; spi_handle.State = HAL_SPI_STATE_RESET;
spi_handle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16;
spi_handle.Init.Direction = SPI_DIRECTION_2LINES; spi_handle.Init.Direction = SPI_DIRECTION_2LINES;
spi_handle.Init.CLKPhase = SPI_PHASE_1EDGE; spi_handle.Init.CLKPhase = SPI_PHASE_1EDGE;
spi_handle.Init.CLKPolarity = SPI_POLARITY_LOW; spi_handle.Init.CLKPolarity = SPI_POLARITY_LOW;
@ -241,7 +242,10 @@ void display_init(void) {
display_refresh(); display_refresh();
} }
void display_reinit(void) { display_handle_init(); } void display_reinit(void) {
display_handle_init();
HAL_SPI_Init(&spi_handle);
}
static inline uint8_t reverse_byte(uint8_t b) { static inline uint8_t reverse_byte(uint8_t b) {
b = (b & 0xF0) >> 4 | (b & 0x0F) << 4; b = (b & 0xF0) >> 4 | (b & 0x0F) << 4;