Skip to content

Commit

Permalink
Fix a bug in U8G2 HAL SPI initialize
Browse files Browse the repository at this point in the history
if we don't set bus_config to all zero, a wrong bus_config.flag may have some random bug
  • Loading branch information
aodzip authored Sep 23, 2018
1 parent 2b7d590 commit de865db
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hardware/displays/U8G2/u8g2_esp32_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ uint8_t u8g2_esp32_spi_byte_cb(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void
}

spi_bus_config_t bus_config;
memset(&bus_config, 0, sizeof(spi_bus_config_t));
bus_config.sclk_io_num = u8g2_esp32_hal.clk; // CLK
bus_config.mosi_io_num = u8g2_esp32_hal.mosi; // MOSI
bus_config.miso_io_num = -1; // MISO
Expand Down

0 comments on commit de865db

Please sign in to comment.