adafruit / Adafruit-SSD1351-library

Adafruit library for the 1.27" and 1.5" color OLEDs in the shop
http://www.adafruit.com/products/1431
Other
112 stars 50 forks source link

Arduino Zero errors #16

Closed emaneric closed 5 years ago

emaneric commented 7 years ago

When trying to compile the "test" example code on my Arduino Zero, I get some errors. The main one being "error: cannot convert 'volatile uint32_t {aka volatile long unsigned int}' to 'PortReg {aka volatile unsigned char}' in assignment". The code compiles fine if I select Arduino Uno.

`Arduino: 1.8.5 (Windows Store 1.8.10.0) (Windows 10), Board: "Arduino/Genuino Zero (Native USB Port)"

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\examples\test\test.ino: In function 'void setup()':

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\examples\test\test.ino:99:390: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", WHITE);

                                                                                                                                                                                                                                                                                                                                                                                                  ^

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\examples\test\test.ino: In function 'void lcdTestPattern()':

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\examples\test\test.ino:332:49: warning: large integer implicitly truncated to unsigned type [-Woverflow]

     tft.writeData(RED>>8); tft.writeData(RED);

                                             ^

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\examples\test\test.ino:335:54: warning: large integer implicitly truncated to unsigned type [-Woverflow]

     tft.writeData(YELLOW>>8);tft.writeData(YELLOW);

                                                  ^

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\examples\test\test.ino:337:64: warning: large integer implicitly truncated to unsigned type [-Woverflow]

   else if(i<48){tft.writeData(GREEN>>8);tft.writeData(GREEN);}

                                                            ^

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\examples\test\test.ino:338:62: warning: large integer implicitly truncated to unsigned type [-Woverflow]

   else if(i<64){tft.writeData(CYAN>>8);tft.writeData(CYAN);}

                                                          ^

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\examples\test\test.ino:340:68: warning: large integer implicitly truncated to unsigned type [-Woverflow]

   else if(i<96){tft.writeData(MAGENTA>>8);tft.writeData(MAGENTA);}

                                                                ^

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\examples\test\test.ino:344:28: warning: large integer implicitly truncated to unsigned type [-Woverflow]

     tft.writeData(WHITE);

                        ^

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\Adafruit_SSD1351.cpp: In constructor 'Adafruit_SSD1351::Adafruit_SSD1351(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)':

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\Adafruit_SSD1351.cpp:465:17: error: cannot convert 'volatile uint32_t {aka volatile long unsigned int}' to 'PortReg {aka volatile unsigned char}' in assignment

 csport      = portOutputRegister(digitalPinToPort(cs));

             ^

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\Adafruit_SSD1351.cpp:468:17: error: cannot convert 'volatile uint32_t {aka volatile long unsigned int}' to 'PortReg {aka volatile unsigned char}' in assignment

 rsport      = portOutputRegister(digitalPinToPort(rs));

             ^

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\Adafruit_SSD1351.cpp:471:18: error: cannot convert 'volatile uint32_t {aka volatile long unsigned int}' to 'PortReg {aka volatile unsigned char}' in assignment

 sidport      = portOutputRegister(digitalPinToPort(sid));

              ^

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\Adafruit_SSD1351.cpp:474:19: error: cannot convert 'volatile uint32_t {aka volatile long unsigned int}' to 'PortReg {aka volatile unsigned char}' in assignment

 sclkport      = portOutputRegister(digitalPinToPort(sclk));

               ^

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\Adafruit_SSD1351.cpp: In constructor 'Adafruit_SSD1351::Adafruit_SSD1351(uint8_t, uint8_t, uint8_t)':

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\Adafruit_SSD1351.cpp:486:17: error: cannot convert 'volatile uint32_t {aka volatile long unsigned int}' to 'PortReg {aka volatile unsigned char}' in assignment

 csport      = portOutputRegister(digitalPinToPort(cs));

             ^

C:\Users\ericn\Documents\Arduino\libraries\Adafruit_SSD1351_library\Adafruit_SSD1351.cpp:489:17: error: cannot convert 'volatile uint32_t {aka volatile long unsigned int}' to 'PortReg {aka volatile unsigned char}' in assignment

 rsport      = portOutputRegister(digitalPinToPort(rs));

             ^

exit status 1 Error compiling for board Arduino/Genuino Zero (Native USB Port).

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences. `

ladyada commented 5 years ago

hiya this library has been refactored and no longer has this code here, and it should be all fixed