In file included from /home/icelon/midro/hardware/Arduino_STM32-master/STM32F1/cores/maple/wirish.h:60:0,
from /home/icelon/midro/hardware/Arduino_STM32-master/STM32F1/cores/maple/Arduino.h:30,
from /home/icelon/midro/libraries/I2Cdev/I2Cdev.h:77,
from /home/icelon/midro/libraries/I2Cdev/I2Cdev.cpp:46:
/home/icelon/midro/libraries/I2Cdev/I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readBytes(uint8_t, uint8_t, uint8_t, uint8_t*, uint16_t)':
/home/icelon/midro/libraries/I2Cdev/I2Cdev.cpp:276:62: error: 'BUFFER_LENGTH' was not declared in this scope
for (uint8_t k = 0; k < length; k += min(length, BUFFER_LENGTH)) {
^
/home/icelon/midro/hardware/Arduino_STM32-master/STM32F1/cores/maple/wirish_math.h:107:39: note: in definition of macro 'min'
#define min(a,b) ((a)<(b)?(a):(b))
^
/home/icelon/midro/libraries/I2Cdev/I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readWords(uint8_t, uint8_t, uint8_t, uint16_t*, uint16_t)':
/home/icelon/midro/libraries/I2Cdev/I2Cdev.cpp:414:70: error: 'BUFFER_LENGTH' was not declared in this scope
for (uint8_t k = 0; k < length * 2; k += min(length * 2, BUFFER_LENGTH)) {
^
/home/icelon/midro/hardware/Arduino_STM32-master/STM32F1/cores/maple/wirish_math.h:107:39: note: in definition of macro 'min'
#define min(a,b) ((a)<(b)?(a):(b))
^
exit status 1
Error compilando para la tarjeta Maple Mini.
https://github.com/rogerclarkmelbourne/ … d44d874L60
In Wire.h BUFFER_LENGTH is no more defined.
As a workaround:
Change the include in the library I2Cdev from Wire.h to SoftWire.h
https://github.com/jrowberg/i2cdevlib/b … Cdev.h#L83
Or you can test to add in Wire.h:
#define BUFFER_LENGTH 32
http://www.i2cdevlib.com/ ? (approx 15secs)
in their forums i found i saw on the main i2cdevlib page that STM32 was a future target
it seems to have Due port though, might be be a good place to start.
look for another project with a Due and a STM32 ports, compare those to see what might need changing, timers, irq stuff
stephen
I think the original question is why it does not built anymore.
Edit: Tested with Arduino_Core_STM32 and it’s ok.
Maybe it should be fine to add the define for HardWire and this will be more compatible with Lib using this define.
I let @RogerClark check that point

It seems strange to define someone with a global name like BUFFER_LENGTH that does not describe what the buffer is associated with
I’ve seen what you tell me but I still do not give up, I’m modifying a firmware of a stm32f030 … Wemos controller type although I darn the possibility to use TLC5490 or a PCA9685 type hat ….
https://github.com/arduino/ArduinoCore- … NGTH&type=
and also for AVR
But not for SAMD
I can see its referenced in http://playground.arduino.cc/Main/WireL … dReference
But its not really part of the public API for Wire.
https://www.arduino.cc/en/Reference/Wire
Looking in libmaple, WireBase defines #define WIRE_BUFSIZ 32
I will change the definition to BUFFER_LENGTH = 32, Just for maximum compatibility.
But personally, I don’t think its good practice for any external libraries to use that define (as its not part of the public API)
[icelon – Fri Aug 25, 2017 7:53 am] –
thanks roger !!!!I’ve seen what you tell me but I still do not give up, I’m modifying a firmware of a stm32f030 … Wemos controller type although I darn the possibility to use TLC5490 or a PCA9685 type hat ….
Download the latest version.
I’ve updated Wirebase.h and Wirebase.cpp and also Softwire.h
BUFFER_LENGTH is now defined in Wirebase.h and removed from Software.h as Softwire.h includes Wirebase.h