sparkfun / SparkFun_Qwiic_OpenLog_Arduino_Library

Control the I2C based Qwiic OpenLog with ease! This library makes reading, writing, and even arithmetic easy.
Other
17 stars 9 forks source link

Error while compiling for Due platform : const char subBuffer[I2C_BUFFER_LENGTH] #2

Closed dgirman closed 6 years ago

dgirman commented 6 years ago

line ~328 const char subBuffer[I2C_BUFFER_LENGTH];

Compiling library "SparkFun_Qwiic_OpenLog_Arduino_Library-master" "C:\Users\dgirm\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions .... ........... C:\Users\dgirm\Documents\Arduino\libraries\SparkFun_Qwiic_OpenLog_Arduino_Library-master\src\SparkFun_Qwiic_OpenLog_Arduino_Library.cpp:328:14: error: uninitialized const 'subBuffer' [-fpermissive]

const char subBuffer[I2C_BUFFER_LENGTH];

          ^

C:\Users\dgirm\Documents\Arduino\libraries\SparkFun_Qwiic_OpenLog_Arduino_Library-master\src\SparkFun_Qwiic_OpenLog_Arduino_Library.cpp:337:65: error: invalid conversion from 'const void' to 'void' [-fpermissive]

 memcpy(subBuffer, &buffer[startPoint], endPoint - startPoint);

                                                             ^

In file included from c:\users\dgirm\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\stdlib.h:11:0,

             from C:\Users\dgirm\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.11\cores\arduino/Arduino.h:24,

             from C:\Users\dgirm\Documents\Arduino\libraries\SparkFun_Qwiic_OpenLog_Arduino_Library-master\src\SparkFun_Qwiic_OpenLog_Arduino_Library.h:31,

             from C:\Users\dgirm\Documents\Arduino\libraries\SparkFun_Qwiic_OpenLog_Arduino_Library-master\src\SparkFun_Qwiic_OpenLog_Arduino_Library.cpp:28:

c:\users\dgirm\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\string.h:23:8: error: initializing argument 1 of 'void memcpy(void, const void*, size_t)' [-fpermissive]

_PTR _EXFUN(memcpy,(_PTR __restrict, const _PTR __restrict, size_t));

    ^

Multiple libraries were found for "SparkFun_Qwiic_OpenLog_Arduino_Library.h" Used: C:\Users\dgirm\Documents\Arduino\libraries\SparkFun_Qwiic_OpenLog_Arduino_Library-master Not used: C:\Users\dgirm\Documents\Arduino\libraries\SparkFun_Qwiic_OpenLog Using library Wire at version 1.0 in folder: C:\Users\dgirm\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.11\libraries\Wire Using library SparkFun_Qwiic_OpenLog_Arduino_Library-master at version 1.0.4 in folder: C:\Users\dgirm\Documents\Arduino\libraries\SparkFun_Qwiic_OpenLog_Arduino_Library-master exit status 1 Error compiling for board Arduino Due (Programming Port).

nseidle commented 6 years ago

I'm guessing we need a

#define __SAM3X8E__ 

in there. I'll see if I can fix it.

nseidle commented 6 years ago

I was wrong. There's a const array that then gets memcpy'd. The compiler options for the SAM series are stringent enough that this throws an error. Removing the const removes the error. Pushing new version to library manager. Please let me know if you continue to see issues.