From 0d4b4fc79e8b37739565ea11ca54668be126c134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Rivi=C3=A8re?= Date: Tue, 16 Oct 2012 19:18:38 +0000 Subject: [PATCH] Fixed FPGA initialization bit ordering. --- BaS_GNU/sources/init_fpga.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BaS_GNU/sources/init_fpga.c b/BaS_GNU/sources/init_fpga.c index c863776..066e1e5 100644 --- a/BaS_GNU/sources/init_fpga.c +++ b/BaS_GNU/sources/init_fpga.c @@ -61,10 +61,10 @@ void init_fpga(void) do { uint8_t value = *fpga_data++; - for (i = 0; i < 8; i++) + for (i = 0; i < 8; i++, value >>= 1) { - if ((value << i) & 0b10000000) + if (value & 1) { /* bit set -> toggle DATA0 to high */ MCF_GPIO_PODR_FEC1L |= FPGA_DATA0;