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

◆ memset_zero_word()

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

ISR-safe word-aligned memset (4-byte writes)

Parameters
destDestination pointer (must be 4-byte aligned)
countNumber of bytes to zero (will process in 4-byte chunks)
Note
Handles remainder bytes using byte writes

Definition at line 121 of file memcpy.h.

121 {
122 u32* dest32 = fl::bit_cast<u32*>(dest);
123 size_t count32 = count / 4;
124 size_t remainder = count % 4;
125
126 for (size_t i = 0; i < count32; i++) {
127 dest32[i] = 0;
128 }
129
130 if (remainder > 0) {
131 u8* remainder_ptr = dest + (count32 * 4);
132 memset_zero_byte(remainder_ptr, remainder);
133 }
134}
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
unsigned char u8
Definition stdint.h:131
To bit_cast(const From &from) FL_NOEXCEPT
Definition bit_cast.h:48

References fl::bit_cast(), and memset_zero_byte().

Referenced by memset_zero().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: