libwebsockets/minimal-examples/embedded/esp32/esp-wrover-kit/rgb565/rgb565.c
Andy Green 63c1e8ba00 esp32-wrover-kit
Add lws_display and minimal example support for esp32-wrover to match wsp32-heltec-wb32

Since no usable buttons that don't affect something else on wrover kit, assumes
a button to 0V on GPIO14.
2020-06-30 19:35:41 +01:00

26 lines
427 B
C

/*
* gcc /tmp/q.c && convert cat-565.png -depth 8 rgb:- | ./a.out > cat-565.h
*/
#include <stdio.h>
int main()
{
int r, g, b, w, m = 0;
while (1) {
r = getchar();
g = getchar();
b = getchar();
if (r == EOF || g == EOF || b == EOF)
return r == EOF;
w = (b >> 3) | ((g >> 2) << 5) | ((r >> 3) << 11);
printf("0x%02X, 0x%02X, ", (w >> 8) & 0xFF, w & 0xFF);
if (((++m) & 3) == 0)
printf("\n");
}
}