# HG changeset patch # User Mychaela Falconia # Date 1523405390 0 # Node ID 1d8c499711f10c55fbeb8f275fc2bd1a07df263a # Parent 2e4f27ea7067156631a7778c8311e24970e66538 lcdtest PPM display: sending the picture all at once is much faster diff -r 2e4f27ea7067 -r 1d8c499711f1 lcdtest/showppm.c --- a/lcdtest/showppm.c Tue Apr 10 23:55:42 2018 +0000 +++ b/lcdtest/showppm.c Wed Apr 11 00:09:50 2018 +0000 @@ -139,6 +139,7 @@ { int rc; unsigned n; + u_char ftbuf[176*220*6+3], *dp; ppm_filename = argv[1]; ppmfile = fopen(ppm_filename, "r"); @@ -156,15 +157,28 @@ write_ir(0x21); write_dr(0); write_ir(0x22); + /* GPIO setup */ + dp = ftbuf; + *dp++ = 0x82; + *dp++ = 0x03; + *dp++ = 0x03; for (n = 0; n < 176*220; n++) { rc = ppm_get_rgb(); if (rc < 0) { fclose(ppmfile); return(-1); } - write_dr(rc); + /* upper byte */ + *dp++ = 0x92; + *dp++ = 0; /* dummy addr */ + *dp++ = rc >> 8; + /* lower byte */ + *dp++ = 0x92; + *dp++ = 0; /* dummy addr */ + *dp++ = rc; } fclose(ppmfile); + do_ftdi_write(ftbuf, sizeof ftbuf); return(0); }