feat(cjson): Add function to encode json number when "sprintf" not support float

Newlib use nano mode as default. When enable nano mode, cjson use internal function to encode for float data.
Otherwise using "sprintf" to encode float data.
This commit is contained in:
Dong Heng
2018-10-11 20:17:52 +08:00
parent c4f2a58351
commit e5df03c277
3 changed files with 51 additions and 2 deletions

View File

@@ -4,3 +4,7 @@
COMPONENT_ADD_INCLUDEDIRS += cJSON
COMPONENT_SRCDIRS := cJSON
ifdef CONFIG_NEWLIB_LIBRARY_LEVEL_NORMAL
CFLAGS += -DCJSON_SPRINTF_FLOAT=1
endif