2 Replies Latest reply on May 5, 2020 6:23 PM by DaBa_1448511

    Compiler Problem?



      I'm running Windows 10 with Creator 4.3 and have a problem that doesn't seem like it's my code (I dare say!), as I've got it down to a very small bit of logic that causes the problem. My hardware has CY8C4246AZI-L423 talking through SPI to four 8x8 LED matrices (MAX7221 drivers). Recently I added text scrolling, which is where I'm seeing the problem and hoped you might be able to help. I stripped down the project to something that just demonstrates the issue and attempted to upload, but it’s still too large. It is uploaded to here: https://1drv.ms/u/s!AhyfeBQ6yeGBpF1o9PF4jRsEuv-q?e=SxRAKA


      At line 235 the program creates the final byte sets to be sent out to each display, with a shift factor affecting each. The characters are 4 bits wide, so two are contained in each byte set. That is intended to look like this:


      dcbytes[0][i]=(a<<SH) || (b>>(4-SH));

      dcbytes[1][i]=(b<<SH) || (c>>(4-SH));

      dcbytes[2][i]=(c<<SH) || (d>>(4-SH));

      dcbytes[3][i]=(d<<SH) || (e>>(4-SH));


      However, including the code on the right side of the OR turns it into garbage, where all that is displayed is a single vertical line at the right of each matrix. If I comment off that right side, I get roughly what is intended, albeit missing some of the dots in some of the characters as they scroll.


      for clarity:  (below works but with some "distortion" of the characters)

      dcbytes[0][i]=(a<<SH);  // || (b>>(4-SH));

      dcbytes[1][i]=(b<<SH);  // || (c>>(4-SH));

      dcbytes[2][i]=(c<<SH);  // || (d>>(4-SH));

      dcbytes[3][i]=(d<<SH);  // || (e>>(4-SH));


      Any help would be much appreciated.