Introduced tasmota_options.h for libs

This commit is contained in:
Stephan Hadinger 2021-05-04 19:28:51 +02:00
parent c398ce7364
commit 63c7e5f7bf
12 changed files with 88 additions and 14 deletions

26
include/tasmota_options.h Normal file
View File

@ -0,0 +1,26 @@
/*
tasmota_include.h - header to be included in libs for external configuration via Tasmota ifdefs
Copyright (C) 2021 Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __TASMOTA_INCLUDE__
#define __TASMOTA_INCLUDE__
#include "../tasmota/my_user_config.h"
#include "../tasmota/tasmota_configurations.h"
#endif // __TASMOTA_INCLUDE__

View File

@ -0,0 +1,17 @@
{
"name": "Display renderer",
"version": "1.0",
"description": "ESP8266 ESP32 library for Tasmota displays",
"license": "MIT",
"homepage": "https://github.com/arendst/Tasmota",
"frameworks": "*",
"platforms": "*",
"authors":
{
"name": "Gerhard Mutz",
"maintainer": true
},
"build": {
"flags": [ "-I$PROJECT_DIR/include" ]
}
}

View File

@ -629,7 +629,7 @@ LVGL_PARAMS *Renderer::lvgl_pars(void) {
} }
#ifndef LVGL_RENDERER #ifndef USE_DISPLAY_LVGL_ONLY
void VButton::xdrawButton(bool inverted) { void VButton::xdrawButton(bool inverted) {
wr_redir=1; wr_redir=1;
@ -726,7 +726,7 @@ uint16_t VButton::UpdateSlider(int16_t x, int16_t y) {
} }
} }
#endif // LVGL_RENDERER #endif // USE_DISPLAY_LVGL_ONLY

View File

@ -4,6 +4,7 @@
#include <Adafruit_GFX.h> #include <Adafruit_GFX.h>
#include "fonts.h" #include "fonts.h"
#include "tasmota_options.h"
#define BLACK 0 #define BLACK 0
#define WHITE 1 #define WHITE 1
@ -17,9 +18,9 @@
#define MAX_INDEXCOLORS 32 #define MAX_INDEXCOLORS 32
//#define LVGL_RENDERER //#define USE_DISPLAY_LVGL_ONLY
#ifdef LVGL_RENDERER #ifdef USE_DISPLAY_LVGL_ONLY
#undef USE_EPD_FONTS #undef USE_EPD_FONTS
#endif #endif
@ -134,7 +135,7 @@ struct Slider {
uint16_t barcol; uint16_t barcol;
}; };
#ifndef LVGL_RENDERER #ifndef USE_DISPLAY_LVGL_ONLY
class VButton : public Adafruit_GFX_Button { class VButton : public Adafruit_GFX_Button {
public: public:
TButton_State vpower; TButton_State vpower;
@ -145,7 +146,7 @@ class VButton : public Adafruit_GFX_Button {
uint16_t UpdateSlider(int16_t x, int16_t y); uint16_t UpdateSlider(int16_t x, int16_t y);
void SliderInit(Renderer *rend, uint16_t xp, uint16_t yp, uint16_t xs, uint16_t ys, uint16_t nelem, uint16_t bgcol, uint16_t frcol, uint16_t barcol); void SliderInit(Renderer *rend, uint16_t xp, uint16_t yp, uint16_t xs, uint16_t ys, uint16_t nelem, uint16_t bgcol, uint16_t frcol, uint16_t barcol);
}; };
#endif // LVGL_RENDERER #endif // USE_DISPLAY_LVGL_ONLY
#endif #endif

View File

@ -0,0 +1,17 @@
{
"name": "universal display Library",
"version": "0.1",
"description": "This is a library a couple of displays.",
"license": "MIT",
"homepage": "https://github.com/arendst/Tasmota",
"frameworks": "*",
"platforms": "*",
"authors":
{
"name": "Gerhard Mutz",
"maintainer": true
},
"build": {
"flags": [ "-I$PROJECT_DIR/include" ]
}
}

View File

@ -0,0 +1,17 @@
{
"name": "TLS mini client derived from Arduino",
"version": "1.0",
"description": "TLS mini client derived from Arduino",
"license": "MIT",
"homepage": "https://github.com/arendst/Tasmota",
"frameworks": "*",
"platforms": "*",
"authors":
{
"name": "Stephan Hadinger",
"maintainer": true
},
"build": {
"flags": [ "-I$PROJECT_DIR/include" ]
}
}

View File

@ -25,8 +25,7 @@
Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling) Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling)
*/ */
#include "my_user_config.h" #include "tasmota_options.h"
#include "tasmota_configurations.h"
#if defined(ESP8266) && defined(USE_TLS) #if defined(ESP8266) && defined(USE_TLS)
#include <stdint.h> #include <stdint.h>

View File

@ -20,8 +20,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "my_user_config.h" #include "tasmota_options.h"
#include "tasmota_configurations.h"
#if defined(USE_TLS) #if defined(USE_TLS)
// #define DEBUG_TLS // #define DEBUG_TLS

View File

@ -21,7 +21,7 @@
#if defined(USE_FT5206) || defined(USE_XPT2046) || defined(USE_LILYGO47) #if defined(USE_FT5206) || defined(USE_XPT2046) || defined(USE_LILYGO47)
#ifdef LVGL_RENDERER #ifdef USE_DISPLAY_LVGL_ONLY
#undef USE_TOUCH_BUTTONS #undef USE_TOUCH_BUTTONS
#endif #endif

View File

@ -18,7 +18,7 @@
*/ */
#if defined(USE_DISPLAY) || defined(LVGL_RENDERER) #if defined(USE_DISPLAY)
#ifdef USE_UNIVERSAL_DISPLAY #ifdef USE_UNIVERSAL_DISPLAY
#define XDSP_17 17 #define XDSP_17 17
@ -462,7 +462,6 @@ void UDISP_Refresh(void) // Every second
* Interface * Interface
\*********************************************************************************************/ \*********************************************************************************************/
#ifndef LVGL_RENDERER
bool Xdsp17(uint8_t function) { bool Xdsp17(uint8_t function) {
bool result = false; bool result = false;
@ -493,7 +492,6 @@ bool Xdsp17(uint8_t function) {
} }
return result; return result;
} }
#endif // !LVGL_RENDERER
#endif // USE_UNIVERSAL_DISPLAY #endif // USE_UNIVERSAL_DISPLAY
#endif // USE_DISPLAY #endif // USE_DISPLAY