From 9fcebb17eda3721e1291cf911acd3ad820860ed6 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sat, 6 Nov 2021 09:37:40 +0100 Subject: [PATCH] Move LList to its own library --- lib/default/TasmotaLList/library.json | 14 ++++++++++++++ .../default/TasmotaLList/src/LList.h | 9 ++++++++- tasmota/tasmota.ino | 1 + tasmota/xdrv_23_zigbee_A_impl.ino | 4 ---- 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 lib/default/TasmotaLList/library.json rename tasmota/support_light_list.ino => lib/default/TasmotaLList/src/LList.h (97%) diff --git a/lib/default/TasmotaLList/library.json b/lib/default/TasmotaLList/library.json new file mode 100644 index 000000000..d49f03f71 --- /dev/null +++ b/lib/default/TasmotaLList/library.json @@ -0,0 +1,14 @@ +{ + "name": "TasmotaLList", + "version": "1.0", + "description": "Simple yet powerful linked-list", + "license": "MIT", + "homepage": "https://github.com/arendst/Tasmota", + "frameworks": "*", + "platforms": "*", + "authors": + { + "name": "Stephan Hadinger", + "maintainer": true + } + } diff --git a/tasmota/support_light_list.ino b/lib/default/TasmotaLList/src/LList.h similarity index 97% rename from tasmota/support_light_list.ino rename to lib/default/TasmotaLList/src/LList.h index eaaea1322..82653448b 100644 --- a/tasmota/support_light_list.ino +++ b/lib/default/TasmotaLList/src/LList.h @@ -1,5 +1,5 @@ /* - support_light_list.ino - Lightweight Linked List for simple objects - optimized for low code size and low memory + LList.h - Lightweight Linked List for simple objects - optimized for low code size and low memory Copyright (C) 2021 Theo Arends and Stephan Hadinger @@ -17,6 +17,11 @@ along with this program. If not, see . */ +#ifndef __LLIST__ +#define __LLIST__ + +#include + /*********************************************************************************************\ * * private class for Linked List element @@ -206,3 +211,5 @@ T & LList::addToLast(LList_elt * elt) { elt->_next = nullptr; return elt->_val; } + +#endif // __LLIST__ \ No newline at end of file diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 231eb03f0..f4008b93d 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -38,6 +38,7 @@ #include // Webserver, Updater #include #include +#include #include #include #ifdef USE_ARDUINO_OTA diff --git a/tasmota/xdrv_23_zigbee_A_impl.ino b/tasmota/xdrv_23_zigbee_A_impl.ino index 8f67c7dc8..6ba8535f7 100644 --- a/tasmota/xdrv_23_zigbee_A_impl.ino +++ b/tasmota/xdrv_23_zigbee_A_impl.ino @@ -68,10 +68,6 @@ void (* const ZigbeeCommand[])(void) PROGMEM = { // Initialize internal structures void ZigbeeInit(void) { -// #pragma GCC diagnostic push -// #pragma GCC diagnostic ignored "-Winvalid-offsetof" -// Serial.printf(">>> offset %d %d %d\n", Z_offset(Z_Data_Light, dimmer), Z_offset(Z_Data_Light, x), Z_offset(Z_Data_Thermo, temperature)); -// #pragma GCC diagnostic pop // Check if settings in Flash are set if (PinUsed(GPIO_ZIGBEE_RX) && PinUsed(GPIO_ZIGBEE_TX)) { if (0 == Settings->zb_channel) {