diff options
author | jaseg <git@jaseg.net> | 2017-08-15 10:34:57 +0200 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2017-08-15 10:34:57 +0200 |
commit | 952f3c03ac2b24eb4804cb336c5a684903252da1 (patch) | |
tree | 05cc3e57052fd186d7e7c091e32fdfd87aa958cd /fw | |
parent | 71ad806c888027f90c5e0a149252263857b97bcc (diff) | |
download | 7seg-952f3c03ac2b24eb4804cb336c5a684903252da1.tar.gz 7seg-952f3c03ac2b24eb4804cb336c5a684903252da1.tar.bz2 7seg-952f3c03ac2b24eb4804cb336c5a684903252da1.zip |
Temporary for bit shuffling
Diffstat (limited to 'fw')
-rw-r--r-- | fw/main.c | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -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; + } } } } |