mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 12:46:34 +00:00
fix ili9342
This commit is contained in:
parent
e56c8b1845
commit
b3788a5f8d
@ -175,7 +175,7 @@ void ILI9341_2::writecmd(uint8_t d) {
|
|||||||
void ILI9341_2::init(uint16_t width, uint16_t height) {
|
void ILI9341_2::init(uint16_t width, uint16_t height) {
|
||||||
//sspi2 = SPISettings(2500000, MSBFIRST, SPI_MODE3);
|
//sspi2 = SPISettings(2500000, MSBFIRST, SPI_MODE3);
|
||||||
|
|
||||||
if (_hwspi == 2) {
|
if (_hwspi >= 2) {
|
||||||
iwidth = ILI9341_TFTWIDTH;
|
iwidth = ILI9341_TFTWIDTH;
|
||||||
iheight = ILI9341_TFTHEIGHT;
|
iheight = ILI9341_TFTHEIGHT;
|
||||||
} else {
|
} else {
|
||||||
@ -187,8 +187,11 @@ void ILI9341_2::init(uint16_t width, uint16_t height) {
|
|||||||
|
|
||||||
sspi2 = SPISettings(40000000, MSBFIRST, SPI_MODE0);
|
sspi2 = SPISettings(40000000, MSBFIRST, SPI_MODE0);
|
||||||
|
|
||||||
if (_hwspi==2) {
|
if (_hwspi >= 2) {
|
||||||
spi2 = &SPI;
|
spi2 = &SPI;
|
||||||
|
if (_hwspi > 2) {
|
||||||
|
spi2->begin(_sclk, _miso, _mosi, -1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
#ifdef ESP32
|
#ifdef ESP32
|
||||||
if (_spibus == 2) {
|
if (_spibus == 2) {
|
||||||
@ -522,7 +525,7 @@ void ili9342_bpwr(uint8_t on);
|
|||||||
|
|
||||||
void ILI9341_2::DisplayOnff(int8_t on) {
|
void ILI9341_2::DisplayOnff(int8_t on) {
|
||||||
|
|
||||||
if (_hwspi==2) {
|
if (_hwspi>=2) {
|
||||||
ili9342_bpwr(on);
|
ili9342_bpwr(on);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,7 +575,7 @@ void ILI9341_2::dim(uint8_t dim) {
|
|||||||
if (_bp>=0) {
|
if (_bp>=0) {
|
||||||
ledcWrite(ESP32_PWM_CHANNEL,dimmer);
|
ledcWrite(ESP32_PWM_CHANNEL,dimmer);
|
||||||
} else {
|
} else {
|
||||||
if (_hwspi==2) {
|
if (_hwspi>=2) {
|
||||||
ili9342_dimm(dim);
|
ili9342_dimm(dim);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ void ILI9341_InitDriver()
|
|||||||
#ifdef USE_DISPLAY_ILI9341
|
#ifdef USE_DISPLAY_ILI9341
|
||||||
uint8_t dtype = 1;
|
uint8_t dtype = 1;
|
||||||
#else
|
#else
|
||||||
uint8_t dtype = 2;
|
uint8_t dtype = 3; // sign ili9342 with variable spi pins
|
||||||
#endif // USE_DISPLAY_ILI9341
|
#endif // USE_DISPLAY_ILI9341
|
||||||
|
|
||||||
// default colors
|
// default colors
|
||||||
|
Loading…
x
Reference in New Issue
Block a user