FastLED 3.10.6
Loading...
Searching...
No Matches

◆ write() [10/11]

fl::size fl::basic_string::write ( const u64 & val)

Definition at line 322 of file basic_string.cpp.hpp.

322 {
323 char buf[64] = {0};
324#if FL_PLATFORM_HAS_LARGE_MEMORY
325 int len = fl::utoa64(val, buf, 10);
326#else
327 // Low-memory gate per #3224 Tier 3G: route through the 32-bit utoa to
328 // avoid `__udivmoddi4` + `__clzdi2` (libgcc-nofp's 64-bit divmod cascade,
329 // ~1.5 KB on Cortex-M0+). Values larger than UINT32_MAX saturate.
330 int len = fl::utoa32(val > 0xFFFFFFFFull ? 0xFFFFFFFFu
331 : static_cast<fl::u32>(val),
332 buf, 10);
333#endif
334 return write(buf, len);
335}
fl::size write(const fl::u8 *data, fl::size n) FL_NO_EXCEPT
int utoa32(u32 value, char *sp, int radix)
Convert unsigned 32-bit integer to string buffer in given radix.
int utoa64(u64 value, char *sp, int radix)
Convert unsigned 64-bit integer to string buffer in given radix.