Skip to content

Commit 1021789

Browse files
committed
updated license
1 parent 11abfc0 commit 1021789

File tree

4 files changed

+40
-16
lines changed

4 files changed

+40
-16
lines changed

License

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
ESP32-yaml
1+
YAMLDuino
22
-------------------------------------------------------------------------------
33
Project Page: https://github.com/tobozo/YAMLDuino
44
Copyright 2022 tobozo http://github.com/tobozo
55

66
Permission is hereby granted, free of charge, to any person
77
obtaining a copy of this software and associated documentation
8-
files ("ESP32-yaml"), to deal in the Software without
8+
files ("YAMLDuino"), to deal in the Software without
99
restriction, including without limitation the rights to use,
1010
copy, modify, merge, publish, distribute, sublicense, and/or
1111
sell copies of the Software, and to permit persons to whom the
@@ -26,7 +26,7 @@ OTHER DEALINGS IN THE SOFTWARE.
2626

2727

2828
-------------------------------------------------------------------------------
29-
ESP32-yaml is bundled with libyaml and cJSON
29+
YAMLDuino is bundled with libyaml and cJSON
3030
-------------------------------------------------------------------------------
3131

3232

src/ArduinoYaml.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
/*
1+
/*\
22
*
3-
* ESP32-yaml
3+
* YAMLDuino
44
* Project Page: https://github.com/tobozo/YAMLDuino
55
*
66
* Copyright 2022 tobozo http://github.com/tobozo
77
*
88
* Permission is hereby granted, free of charge, to any person
99
* obtaining a copy of this software and associated documentation
10-
* files ("ESP32-yaml"), to deal in the Software without
10+
* files ("YAMLDuino"), to deal in the Software without
1111
* restriction, including without limitation the rights to use,
1212
* copy, modify, merge, publish, distribute, sublicense, and/or
1313
* sell copies of the Software, and to permit persons to whom the
@@ -26,7 +26,7 @@
2626
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2727
* OTHER DEALINGS IN THE SOFTWARE.
2828
*
29-
*/
29+
\*/
3030

3131
#include "ArduinoYaml.hpp"
3232

src/ArduinoYaml.hpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#pragma once
2-
/*
2+
/*\
33
*
4-
* ESP32-yaml
4+
* YAMLDuino
55
* Project Page: https://github.com/tobozo/YAMLDuino
66
*
77
* Copyright 2022 tobozo http://github.com/tobozo
88
*
99
* Permission is hereby granted, free of charge, to any person
1010
* obtaining a copy of this software and associated documentation
11-
* files ("ESP32-yaml"), to deal in the Software without
11+
* files ("YAMLDuino"), to deal in the Software without
1212
* restriction, including without limitation the rights to use,
1313
* copy, modify, merge, publish, distribute, sublicense, and/or
1414
* sell copies of the Software, and to permit persons to whom the
@@ -27,7 +27,7 @@
2727
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2828
* OTHER DEALINGS IN THE SOFTWARE.
2929
*
30-
*/
30+
\*/
3131

3232

3333
#include "logger.hpp"
@@ -173,6 +173,18 @@ size_t serializeYml( Stream &json_src_stream, Stream &yml_dest_stream, OutputFor
173173

174174
#include <ArduinoJson.h>
175175

176+
// recursion helpers for json variant
177+
// https://github.com/bblanchon/ArduinoJson/issues/1505#issuecomment-782825946
178+
template <typename Key>
179+
JsonVariantConst resolvePath(JsonVariantConst variant, Key key) {
180+
return variant[key];
181+
}
182+
183+
template <typename Key, typename... Tail>
184+
JsonVariantConst resolvePath(JsonVariantConst variant, Key key, Tail... tail) {
185+
return resolvePath(variant[key], tail...);
186+
}
187+
176188
// default name for the topmost temporary JsonObject
177189
#define ROOT_NODE "_root_"
178190
// deconstructors

src/logger.hpp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#pragma once
2-
/*
2+
/*\
33
*
4-
* ESP32-yaml
4+
* YAMLDuino
55
* Project Page: https://github.com/tobozo/YAMLDuino
66
*
77
* Copyright 2022 tobozo http://github.com/tobozo
88
*
99
* Permission is hereby granted, free of charge, to any person
1010
* obtaining a copy of this software and associated documentation
11-
* files ("ESP32-yaml"), to deal in the Software without
11+
* files ("YAMLDuino"), to deal in the Software without
1212
* restriction, including without limitation the rights to use,
1313
* copy, modify, merge, publish, distribute, sublicense, and/or
1414
* sell copies of the Software, and to permit persons to whom the
@@ -27,7 +27,7 @@
2727
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2828
* OTHER DEALINGS IN THE SOFTWARE.
2929
*
30-
*/
30+
\*/
3131

3232
// Emit logs in arduino style at software level rather than firmware level
3333

@@ -59,6 +59,18 @@
5959
#include <Arduino.h>
6060
#define LOG_PRINTF Serial.printf
6161
#define HEAP_AVAILABLE() rp2040.getFreeHeap()
62+
#elif defined CORE_TEENSY
63+
#include <stdarg.h>
64+
#include <Arduino.h>
65+
#define LOG_PRINTF Serial.printf
66+
extern unsigned long _heap_start;
67+
extern unsigned long _heap_end;
68+
extern char *__brkval;
69+
static int getFreeRam()
70+
{
71+
return (char *)&_heap_end - __brkval;
72+
}
73+
#define HEAP_AVAILABLE() getFreeRam()
6274
#elif defined ARDUINO_ARCH_SAMD
6375
#include <stdarg.h>
6476
#include <Arduino.h>
@@ -74,7 +86,7 @@
7486
char top;
7587
#ifdef __arm__
7688
return &top - reinterpret_cast<char*>(sbrk(0));
77-
#elif defined(CORE_TEENSY) || (ARDUINO > 103 && ARDUINO != 151)
89+
#elif (ARDUINO > 103 && ARDUINO != 151)
7890
return &top - __brkval;
7991
#else // __arm__
8092
return __brkval ? &top - __brkval : &top - __malloc_heap_start;

0 commit comments

Comments
 (0)