Hello,
In the fill colour function you are using memset to set the colour but memset will set the memory to only the first byte, if for example you try green, in 565 it's 0x07E0, it will set each memory element in the array with E0, use this instead:
static void memset_pattern2(void b, const void pattern2, size_t len)
{
char start = (char )b;
char p = (char )b;
while ((start + len) - p >= 2) {
memmove(p, pattern2, 2);
p += 2;
}
if ((start + len) - p != 0) {
memmove(p, pattern2, (start + len) - p);
}
}
and in the fill colour function :
memset_pattern2(disp_buf, &color, sizeof(disp_buf));
Hello, In the fill colour function you are using memset to set the colour but memset will set the memory to only the first byte, if for example you try green, in 565 it's 0x07E0, it will set each memory element in the array with E0, use this instead:
static void memset_pattern2(void b, const void pattern2, size_t len) { char start = (char )b; char p = (char )b; while ((start + len) - p >= 2) { memmove(p, pattern2, 2); p += 2; } if ((start + len) - p != 0) { memmove(p, pattern2, (start + len) - p); } }
and in the fill colour function : memset_pattern2(disp_buf, &color, sizeof(disp_buf));
kind regards Vlad