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

◆ legacyLibcOnCrgb()

static void legacyLibcOnCrgb ( )
static
Examples
Test.ino.

Definition at line 15 of file Test.ino.

15 {
16 CRGB src[4] = {CRGB(1, 2, 3), CRGB(4, 5, 6), CRGB(7, 8, 9), CRGB(10, 11, 12)};
17 CRGB* dst = static_cast<CRGB*>(malloc(sizeof(CRGB) * 4)); // ok bare allocation
18 if (!dst) {
19 return;
20 }
21 memset(dst, 0, sizeof(CRGB) * 4);
22 memcpy(dst, src, sizeof(CRGB) * 4);
23 memmove(dst + 1, dst, sizeof(CRGB) * 3);
24 if (memcmp(dst, src, sizeof(CRGB)) != 0) {
25 Serial.println("legacy libc copy mismatch");
26 }
27 free(dst); // ok bare allocation
28}
fl::CRGB CRGB
Definition crgb.h:25
void free(void *ptr) FL_NO_EXCEPT
void * memset(void *s, int c, size_t n) FL_NO_EXCEPT
void * memcpy(void *dest, const void *src, size_t n) FL_NO_EXCEPT
int memcmp(const void *s1, const void *s2, size_t n) FL_NO_EXCEPT
void * memmove(void *dest, const void *src, size_t n) FL_NO_EXCEPT
void * malloc(size_t size) FL_NO_EXCEPT
#define Serial
Definition serial.h:309

References Serial.

Referenced by setup().

+ Here is the caller graph for this function: