Since this library defines the Breakout object in its header file, it's a death sentence for users wanting to use the header file from two different .cpp files, as such is common in IDEs like PlatformIO + VSCode, since that causes multiple definition of errors.
Click for full report table
Board|`examples/BreakoutRTCGet` flash|%|`examples/BreakoutRTCGet` RAM for global variables|%|`examples/BreakoutRTCSet` flash|%|`examples/BreakoutRTCSet` RAM for global variables|%|`examples/BreakoutWebServer` flash|%|`examples/BreakoutWebServer` RAM for global variables|%|`examples/GpioManagement` flash|%|`examples/GpioManagement` RAM for global variables|%|`examples/LM75BTemperature` flash|%|`examples/LM75BTemperature` RAM for global variables|%|`examples/PDMRootMeanSquare` flash|%|`examples/PDMRootMeanSquare` RAM for global variables|%|`examples/analogRead` flash|%|`examples/analogRead` RAM for global variables|%|`examples/analogWrite` flash|%|`examples/analogWrite` RAM for global variables|%
-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-
`arduino:mbed_portenta:envie_m7`|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A
Click for full report CSV
```
Board,examples/BreakoutRTCGet flash,%,examples/BreakoutRTCGet RAM for global variables,%,examples/BreakoutRTCSet flash,%,examples/BreakoutRTCSet RAM for global variables,%,examples/BreakoutWebServer flash,%,examples/BreakoutWebServer RAM for global variables,%,examples/GpioManagement flash,%,examples/GpioManagement RAM for global variables,%,examples/LM75BTemperature flash,%,examples/LM75BTemperature RAM for global variables,%,examples/PDMRootMeanSquare flash,%,examples/PDMRootMeanSquare RAM for global variables,%,examples/analogRead flash,%,examples/analogRead RAM for global variables,%,examples/analogWrite flash,%,examples/analogWrite RAM for global variables,%
arduino:mbed_portenta:envie_m7,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A
```
Since this library defines the
Breakout
object in its header file, it's a death sentence for users wanting to use the header file from two different .cpp files, as such is common in IDEs like PlatformIO + VSCode, since that causesmultiple definition of
errors.Users are running into this error for example here.
This PR fixes this error by only declaring the breakout object to be
extern
and then adding a.cpp
file in which the object is then created once.