{"action":"created","issue":{"url":"https://api.github.com/repos/arduino/ArduinoCore-samd/issues/175","repository_url":"https://api.github.com/repos/arduino/ArduinoCore-samd","labels_url":"https://api.github.com/repos/arduino/ArduinoCore-samd/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/arduino/ArduinoCore-samd/issues/175/comments","events_url":"https://api.github.com/repos/arduino/ArduinoCore-samd/issues/175/events","html_url":"https://github.com/arduino/ArduinoCore-samd/issues/175","id":183743328,"number":175,"title":"Error compiling when using I2Cdevlib","user":{"login":"mundodisco8","id":8402707,"avatar_url":"https://avatars.githubusercontent.com/u/8402707?v=3","gravatar_id":"","url":"https://api.github.com/users/mundodisco8","html_url":"https://github.com/mundodisco8","followers_url":"https://api.github.com/users/mundodisco8/followers","following_url":"https://api.github.com/users/mundodisco8/following{/other_user}","gists_url":"https://api.github.com/users/mundodisco8/gists{/gist_id}","starred_url":"https://api.github.com/users/mundodisco8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mundodisco8/subscriptions","organizations_url":"https://api.github.com/users/mundodisco8/orgs","repos_url":"https://api.github.com/users/mundodisco8/repos","events_url":"https://api.github.com/users/mundodisco8/events{/privacy}","received_events_url":"https://api.github.com/users/mundodisco8/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-18T16:51:40Z","updated_at":"2016-10-20T13:52:42Z","closed_at":null,"body":"Hi, \r\n\r\nI'm facing issues when trying to use I2Cdevlib in my project for the arduino Zero. Apparently, their library is expecting a constant named BUFFER_LENGTH to be present in Wire.h. This constant is present in the AVR version of the library, but not on the SAMD version. The compiler throws the following message\r\n\r\n```\r\nD:\\Joel\\Desktop\\Dropbox\\Arduino\\libraries\\I2Cdev\\I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readBytes(uint8_t, uint8_t, uint8_t, uint8_t*, uint16_t)':\r\n\r\nD:\\Joel\\Desktop\\Dropbox\\Arduino\\libraries\\I2Cdev\\I2Cdev.cpp:276:62: error: 'BUFFER_LENGTH' was not declared in this scope\r\n\r\n             for (uint8_t k = 0; k < length; k += min(length, BUFFER_LENGTH)) {\r\n\r\n                                                              ^\r\n\r\nC:\\Users\\Joel\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\samd\\1.6.7\\cores\\arduino/Arduino.h:96:24: note: in definition of macro 'min'\r\n\r\n #define min(a,b) ((a)<(b)?(a):(b))\r\n```\r\n\r\nSome code that produces this output is the following:\r\n\r\n```\r\n#include<Wire.h>\r\n#include \"MPU6050_6Axis_MotionApps20.h\" // for the MPU6050\r\n\r\nvoid setup(){\r\n}\r\n\r\nvoid loop(){\r\n}\r\n````\r\n\r\nI have the latest versions of the library, the IDE (1.6.12) and the boards (1.6.8).\r\n\r\nI opened an issue on their repo (https://github.com/jrowberg/i2cdevlib/issues/271), but I think that it might be also relevant to post one here. If you think it is not, please feel free to close it. In any case, would you be able to suggest a value for BUFFER_LENGTH? Is there a reason why not to use 32 as in the AVR version? I'm trying to use a MPU6050 accelerometer, that has a 1024 bytes buffer, in case that BUFFER_LENGTH is related to the buffer length of the target device."},"comment":{"url":"https://api.github.com/repos/arduino/ArduinoCore-samd/issues/comments/255111896","html_url":"https://github.com/arduino/ArduinoCore-samd/issues/175#issuecomment-255111896","issue_url":"https://api.github.com/repos/arduino/ArduinoCore-samd/issues/175","id":255111896,"user":{"login":"facchinm","id":8843437,"avatar_url":"https://avatars.githubusercontent.com/u/8843437?v=3","gravatar_id":"","url":"https://api.github.com/users/facchinm","html_url":"https://github.com/facchinm","followers_url":"https://api.github.com/users/facchinm/followers","following_url":"https://api.github.com/users/facchinm/following{/other_user}","gists_url":"https://api.github.com/users/facchinm/gists{/gist_id}","starred_url":"https://api.github.com/users/facchinm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facchinm/subscriptions","organizations_url":"https://api.github.com/users/facchinm/orgs","repos_url":"https://api.github.com/users/facchinm/repos","events_url":"https://api.github.com/users/facchinm/events{/privacy}","received_events_url":"https://api.github.com/users/facchinm/received_events","type":"User","site_admin":false},"created_at":"2016-10-20T13:52:42Z","updated_at":"2016-10-20T13:52:42Z","body":"Oh well, `BUFFER_LENGTH` is a so common name I would avoid using it in anything outside the library itself. Unfortunately AVR's Wire define is there and someone is using it. Wire for SAMD uses a 64 bytes long ringbuffer, so you could use this value if the architecture you are targeting is more powerful than AVR. I'm closing this isue since it should be solved \"mainline\" by i2cdev devs"}}
{"actor":{"display_login":"facchinm"}}