lvgl_esp32_drivers: Display orientation doesn't change on ssd1306 on setting through menuconfig
Display doesn’t rotate on setting the option through menuconfig.
void ssd1306_init()
{
esp_err_t ret;
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
i2c_master_start(cmd);
i2c_master_write_byte(cmd, (OLED_I2C_ADDRESS << 1) | I2C_MASTER_WRITE, true);
i2c_master_write_byte(cmd, OLED_CONTROL_BYTE_CMD_STREAM, true);
i2c_master_write_byte(cmd, OLED_CMD_SET_CHARGE_PUMP, true);
i2c_master_write_byte(cmd, 0x14, true);
i2c_master_write_byte(cmd, 0xA0, true);
i2c_master_write_byte(cmd, 0xC0, true);
i2c_master_write_byte(cmd, OLED_CMD_SET_CONTRAST, true);
on changing init function as follows, the display rotates. Should I add the following feature through a PR ?
on line 150, in ssd1306.c, you have done this, there’s no use of the macro, both if/else have the same code written, should this be removed ?
#if defined CONFIG_LV_DISPLAY_ORIENTATION_LANDSCAPE
row1 = area->y1>>3;
row2 = area->y2>>3;
#else
row1 = area->y1>>3;
row2 = area->y2>>3;
#endif
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17
I can try adding a function to rotate in 180°, in 90° would be different.