From 8ccca7eebb14d7d0c83a013ba5b0c276f5a93a2b Mon Sep 17 00:00:00 2001 From: mikep1998 <44448320+mikep1998@users.noreply.github.com> Date: Thu, 13 May 2021 11:39:29 -0700 Subject: [PATCH] Move DSP_ROM_DESC into user configurable #define. --- tasmota/displaydesc/readme.md | 32 ++++++++++++++++++++++++++++++-- tasmota/xdsp_17_universal.ino | 28 +--------------------------- 2 files changed, 31 insertions(+), 29 deletions(-) diff --git a/tasmota/displaydesc/readme.md b/tasmota/displaydesc/readme.md index 62a1b8227..9cf2b3223 100644 --- a/tasmota/displaydesc/readme.md +++ b/tasmota/displaydesc/readme.md @@ -10,8 +10,36 @@ Display Descriptor files for use with universal display driver. copy descriptor to rule buffer number 3 but do not enable rule 3 (descriptor may not contain ANY spaces in this mode) (4.) compile the descriptor into driver. - convert the file to a const char array and place into source xdsp_universal.ino - and replace the example array there + #define DSP_ROM_DESC + convert the file to a string and place it into your user_config.h file using #define + + Example: + #define DSP_ROM_DESC \ +":H,SH1106,128,64,1,I2C,3c,*,*,*\n" \ +":S,0,1,1,0,40,20\n" \ +":I\n" \ +"AE\n" \ +"D5,80\n" \ +"A8,3f\n" \ +"D3,00\n" \ +"40\n" \ +"8D,14\n" \ +"20,00\n" \ +"A1\n" \ +"C8\n" \ +"DA,12\n" \ +"81,CF\n" \ +"D9F1\n" \ +"DB,40\n" \ +"A4\n" \ +"A6\n" \ +"AF\n" \ +":o,AE\n" \ +":O,AF\n" \ +":A,00,10,40,00,02\n" \ +":i,A6,A7\n" \ +"#\n" + + for further info about display descriptors read the tasmota docs display part. diff --git a/tasmota/xdsp_17_universal.ino b/tasmota/xdsp_17_universal.ino index 968b483e1..f872fe1a5 100644 --- a/tasmota/xdsp_17_universal.ino +++ b/tasmota/xdsp_17_universal.ino @@ -59,33 +59,7 @@ void Core2DisplayDim(uint8_t dim); /*********************************************************************************************/ #ifdef DSP_ROM_DESC -/* sample descriptor */ -const char DSP_SAMPLE_DESC[] PROGMEM = -":H,SH1106,128,64,1,I2C,3c,*,*,*\n" -":S,0,1,1,0,40,20\n" -":I\n" -"AE\n" -"D5,80\n" -"A8,3f\n" -"D3,00\n" -"40\n" -"8D,14\n" -"20,00\n" -"A1\n" -"C8\n" -"DA,12\n" -"81,CF\n" -"D9F1\n" -"DB,40\n" -"A4\n" -"A6\n" -"AF\n" -":o,AE\n" -":O,AF\n" -":A,00,10,40,00,02\n" -":i,A6,A7\n" -"#\n"; - +const char DSP_SAMPLE_DESC[] PROGMEM = DSP_ROM_DESC #endif // DSP_ROM_DESC /*********************************************************************************************/ Renderer *Init_uDisplay(const char *desc, int8_t cs) {