mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-02 16:14:19 +01:00
Moved float tables to PROGMEM
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <ArduinoJson/Namespace.hpp>
|
||||
#include <ArduinoJson/Polyfills/preprocessor.hpp>
|
||||
#include <ArduinoJson/Polyfills/static_array.hpp>
|
||||
|
||||
#if ARDUINOJSON_ENABLE_STD_STREAM
|
||||
#include <ostream>
|
||||
@@ -86,22 +88,20 @@ class DeserializationError {
|
||||
return messages[_code];
|
||||
}
|
||||
|
||||
#define ARDUINOJSON_EXPAND7(a, b, c, d, e, f, g) a, b, c, d, e, f, g
|
||||
|
||||
#if ARDUINOJSON_ENABLE_PROGMEM
|
||||
const __FlashStringHelper* f_str() const {
|
||||
ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s0, "Ok");
|
||||
ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s1, "EmptyInput");
|
||||
ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s2, "IncompleteInput");
|
||||
ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s3, "InvalidInput");
|
||||
ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s4, "NoMemory");
|
||||
ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s5, "NotSupported");
|
||||
ARDUINOJSON_DEFINE_PROGMEM_ARRAY(char, s6, "TooDeep");
|
||||
ARDUINOJSON_DEFINE_PROGMEM_ARRAY(
|
||||
ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s0, "Ok");
|
||||
ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s1, "EmptyInput");
|
||||
ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s2, "IncompleteInput");
|
||||
ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s3, "InvalidInput");
|
||||
ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s4, "NoMemory");
|
||||
ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s5, "NotSupported");
|
||||
ARDUINOJSON_DEFINE_STATIC_ARRAY(char, s6, "TooDeep");
|
||||
ARDUINOJSON_DEFINE_STATIC_ARRAY(
|
||||
const char*, messages,
|
||||
ARDUINOJSON_EXPAND7({s0, s1, s2, s3, s4, s5, s6}));
|
||||
return reinterpret_cast<const __FlashStringHelper*>(
|
||||
pgm_read_ptr(messages + _code));
|
||||
return ARDUINOJSON_READ_STATIC_ARRAY(const __FlashStringHelper*, messages,
|
||||
_code);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user