aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2017-08-15 10:34:57 +0200
committerjaseg <git@jaseg.net>2017-08-15 10:34:57 +0200
commit952f3c03ac2b24eb4804cb336c5a684903252da1 (patch)
tree05cc3e57052fd186d7e7c091e32fdfd87aa958cd
parent71ad806c888027f90c5e0a149252263857b97bcc (diff)
download7seg-952f3c03ac2b24eb4804cb336c5a684903252da1.tar.gz
7seg-952f3c03ac2b24eb4804cb336c5a684903252da1.tar.bz2
7seg-952f3c03ac2b24eb4804cb336c5a684903252da1.zip
Temporary for bit shuffling
-rw-r--r--fw/main.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/fw/main.c b/fw/main.c
index 3c10696..cdde804 100644
--- a/fw/main.c
+++ b/fw/main.c
@@ -83,17 +83,11 @@ void transpose_data(volatile uint8_t *rx_buf, volatile struct framebuf *out_fb)
};
};
struct data_format *rxp = (struct data_format *)rx_buf;
- for (unsigned int digit=0; digit<nrows*ncols; digit++, rxp++) {
- for (int segment=0; segment<8; segment++) {
- uint32_t *outp = out_fb->data;
- for (int bit=0x80; bit; bit>>=1, outp+=frame_size_words)
- outp[segment] |= !!(rxp->high[segment] & bit) << digit;
- }
- uint16_t low = rxp->low;
- for (int segment=0; segment<8; segment++) {
- uint32_t *outp = out_fb->data;
- for (int bit=0x8000; bit; bit>>=1, outp+=frame_size_words)
- outp[segment] |= !!(rxp->high[segment] & bit) << digit;
+ for (int bit=0; bit<8; bit++) {
+ for (int seg=0; seg<8; seg++) {
+ for (int digit=0; digit<32; digit++) {
+ out_fb[(bit+2)*frame_size_words + seg] |= !!(rxp[digit].high[seg] & (1<<bit)) << digit;
+ }
}
}
}