Increased default nesting limit to 50 when compiled for a computer (issue #349)

This commit is contained in:
Benoit Blanchon
2016-09-21 22:11:38 +02:00
parent bb805e93cb
commit e6f55b1f6f
4 changed files with 33 additions and 8 deletions

View File

@@ -42,6 +42,11 @@
#endif
#endif
// low value to prevent stack overflow
#ifndef ARDUINOJSON_DEFAULT_NESTING_LIMIT
#define ARDUINOJSON_DEFAULT_NESTING_LIMIT 10
#endif
#else // assume this is a computer
// on a computer we have plenty of memory so we can use doubles
@@ -82,6 +87,11 @@
#define ARDUINOJSON_ENABLE_ALIGNMENT 1
#endif
// on a computer, we should have a lot of space on the stack
#ifndef ARDUINOJSON_DEFAULT_NESTING_LIMIT
#define ARDUINOJSON_DEFAULT_NESTING_LIMIT 50
#endif
#endif
#if ARDUINOJSON_USE_LONG_LONG && ARDUINOJSON_USE_INT64