FastLED 3.10.8
Loading...
Searching...
No Matches

◆ accept() [7/10]

void fl::SerializerVisitor::accept ( const float & f)
inline

Definition at line 1207 of file json.cpp.hpp.

1207 {
1208#if FL_PLATFORM_HAS_LARGE_MEMORY
1209 // Integer-only bits -> decimal (FastLED #3022 phase 2). Default 3-digit
1210 // precision matches the previous `num_str.append(f, 3)` contract.
1212#else
1213 // Low-memory targets gate the float decimal codec to drop
1214 // `ieee754_format_decimal` (594 B) + `kPow10Mant` LUT (824 B) from the
1215 // link. The integer-only RPC contract on LPC8xx / AVR-class targets
1216 // never serializes float values; this writes a stub for the rare cases
1217 // where a `json(float)` round-trip happens to be exercised in test
1218 // code that also runs on Low-memory. See FastLED #3082.
1219 (void)f;
1220 append_str(fl::string("0"));
1221#endif
1222 }
To bit_cast(const From &from) FL_NO_EXCEPT
Definition bit_cast.h:48
fl::string ieee754_format_decimal(u32 bits, int precision) FL_NO_EXCEPT
Format IEEE 754 single-precision bits as decimal text.
void append_str(const fl::string &str) FL_NO_EXCEPT

References append_str(), fl::bit_cast(), fl::FL_NO_EXCEPT, and fl::ieee754_format_decimal().

+ Here is the call graph for this function: