FastLED 3.9.15
Loading...
Searching...
No Matches

◆ memset_zero()

FL_OPTIMIZE_FUNCTION FL_IRAM FASTLED_FORCE_INLINE void fl::isr::memset_zero ( u8 * dest,
size_t count )

ISR-safe memset with alignment optimization.

Parameters
destDestination pointer
countNumber of bytes to zero
Note
Automatically selects word or byte writes based on alignment

Definition at line 141 of file memcpy.h.

141 {
142 uintptr_t address = fl::ptr_to_int(dest);
143
144 if ((address % 4 == 0) && (count >= 4)) {
145 memset_zero_word(dest, count);
146 } else {
147 memset_zero_byte(dest, count);
148 }
149}
FL_OPTIMIZE_FUNCTION FL_IRAM FASTLED_FORCE_INLINE void memset_zero_word(u8 *dest, size_t count)
ISR-safe word-aligned memset (4-byte writes)
Definition memcpy.h:121
FL_OPTIMIZE_FUNCTION FL_IRAM FASTLED_FORCE_INLINE void memset_zero_byte(u8 *dest, size_t count)
ISR-safe memset replacement (byte-by-byte zero)
Definition memcpy.h:110
uptr ptr_to_int(T *ptr) FL_NOEXCEPT
Definition bit_cast.h:71
fl::uptr uintptr_t
Definition s16x16x4.h:224

References memset_zero_byte(), memset_zero_word(), and fl::ptr_to_int().

+ Here is the call graph for this function: