mirror of https://github.com/arendst/Tasmota.git
fix epaper 29 non-universal display (#17999)
* make v1 configurable * fix ep29 v1
This commit is contained in:
parent
dcbf50a918
commit
c1dec03adb
|
@ -35,7 +35,6 @@
|
|||
|
||||
//#define BUSY_PIN 16
|
||||
|
||||
|
||||
Epd::Epd(int16_t width, int16_t height) :
|
||||
Paint(width,height) {
|
||||
}
|
||||
|
@ -87,7 +86,6 @@ void Epd::DisplayInit(int8_t p,int8_t size,int8_t rot,int8_t font) {
|
|||
setTextColor(WHITE,BLACK);
|
||||
setCursor(0,0);
|
||||
fillScreen(BLACK);
|
||||
|
||||
disp_bpp = 1;
|
||||
}
|
||||
|
||||
|
@ -102,7 +100,6 @@ void Epd::Begin(int16_t cs,int16_t mosi,int16_t sclk, int16_t rst, int16_t busy)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
void Epd::Init(int8_t p) {
|
||||
if (p == DISPLAY_INIT_PARTIAL) {
|
||||
Init(lut_partial_update);
|
||||
|
@ -119,20 +116,14 @@ void Epd::Init(int8_t p) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
int Epd::Init(const unsigned char* lut) {
|
||||
/* this calls the peripheral hardware interface, see epdif */
|
||||
/*if (IfInit() != 0) {
|
||||
return -1;
|
||||
}*/
|
||||
/*
|
||||
cs_pin=pin[GPIO_SSPI_CS];
|
||||
mosi_pin=pin[GPIO_SSPI_MOSI];
|
||||
sclk_pin=pin[GPIO_SSPI_SCLK];
|
||||
*/
|
||||
|
||||
if (framebuffer) {
|
||||
// free(framebuffer);
|
||||
if (iniz) {
|
||||
#ifndef EPD_29_V2
|
||||
this->lut = lut;
|
||||
SetLut(this->lut);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
framebuffer = (uint8_t*)malloc(EPD_WIDTH * EPD_HEIGHT / 8);
|
||||
if (!framebuffer) return -1;
|
||||
|
@ -207,6 +198,7 @@ int Epd::Init(const unsigned char* lut) {
|
|||
SetLut(this->lut);
|
||||
#endif
|
||||
/* EPD hardware init end */
|
||||
iniz = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -253,7 +245,9 @@ void Epd::Reset(void) {
|
|||
digitalWrite(rst_pin, HIGH);
|
||||
delay(200);
|
||||
} else {
|
||||
#ifdef EPD_29_V2
|
||||
SendCommand(0x12);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -109,6 +109,7 @@ private:
|
|||
unsigned int mosi_pin;
|
||||
unsigned int sclk_pin;
|
||||
unsigned char mode;
|
||||
uint8_t iniz = 0;
|
||||
void delay_busy(uint32_t wait);
|
||||
void SetLut(const unsigned char* lut);
|
||||
void SetMemoryArea(int x_start, int y_start, int x_end, int y_end);
|
||||
|
|
Loading…
Reference in New Issue