1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-12-26 21:00:48 +02:00

ubb-patgen/ubb-patgen.c (send_buffer): use physmem_xlat_vec

This commit is contained in:
Werner Almesberger 2013-01-16 10:16:09 -03:00
parent 3161d5555b
commit 2de15b9aec

View File

@ -483,15 +483,24 @@ static void send_buffer(const struct mmcclk *clk,
const char *trigger, int debounce, const struct timespec *debounce_ns,
const struct timespec *wait_ns)
{
unsigned long phys;
struct physmem_vec vec;
int n;
if (physmem_flush(buf, nibbles)) {
perror("physmem_flush");
exit(1);
}
phys = physmem_xlat((void *) buf);
mmc_buffer(clk, buf[0] >> 4, phys, nibbles, mask,
n = physmem_xlat_vec((void *) buf, nibbles >> 1, &vec, 1);
if (n < 0) {
perror("physmem_xlat_vec");
exit(1);
}
if (n != 1) {
fprintf(stderr, "physmem_xlat_vec: expected 1, got %d\n", n);
exit(1);
}
mmc_buffer(clk, buf[0] >> 4, vec.addr, nibbles, mask,
trigger, debounce, debounce_ns, wait_ns);
}