Merge pull request #13585 from s-hadinger/move_llist

Move LList to its own library
This commit is contained in:
s-hadinger 2021-11-06 10:23:31 +01:00 committed by GitHub
commit 8a74841d71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 5 deletions

View File

@ -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
}
}

View File

@ -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 Copyright (C) 2021 Theo Arends and Stephan Hadinger
@ -17,6 +17,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __LLIST__
#define __LLIST__
#include <cstddef>
/*********************************************************************************************\ /*********************************************************************************************\
* *
* private class for Linked List element * private class for Linked List element
@ -206,3 +211,5 @@ T & LList<T>::addToLast(LList_elt<T> * elt) {
elt->_next = nullptr; elt->_next = nullptr;
return elt->_val; return elt->_val;
} }
#endif // __LLIST__

View File

@ -38,6 +38,7 @@
#include <StreamString.h> // Webserver, Updater #include <StreamString.h> // Webserver, Updater
#include <ext_printf.h> #include <ext_printf.h>
#include <SBuffer.hpp> #include <SBuffer.hpp>
#include <LList.h>
#include <JsonParser.h> #include <JsonParser.h>
#include <JsonGenerator.h> #include <JsonGenerator.h>
#ifdef USE_ARDUINO_OTA #ifdef USE_ARDUINO_OTA

View File

@ -68,10 +68,6 @@ void (* const ZigbeeCommand[])(void) PROGMEM = {
// Initialize internal structures // Initialize internal structures
void ZigbeeInit(void) 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 // Check if settings in Flash are set
if (PinUsed(GPIO_ZIGBEE_RX) && PinUsed(GPIO_ZIGBEE_TX)) { if (PinUsed(GPIO_ZIGBEE_RX) && PinUsed(GPIO_ZIGBEE_TX)) {
if (0 == Settings->zb_channel) { if (0 == Settings->zb_channel) {