arduino-libraries / Arduino_LSM6DS3

LSM6DS3 Library for Arduino
GNU Lesser General Public License v2.1
30 stars 31 forks source link

Enable inheritance #27

Closed pu239ppy closed 2 years ago

pu239ppy commented 2 years ago

Recently I attempted to subclass LSM6DS3Class in order to add additional functionality in my sketch, I discovered that many of the defines I expected to work such as register addresses and LSM6DS3_ADDRESS are defined in the LSM6DS3.cpp file and including Arduino_LSM6DS3.h will not be enough. A simple fix and also a good practice would be to move these defines in the to the LSM6DS3.h.

In addition in order to enable inheritance private methods are now declared as protected

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

github-actions[bot] commented 2 years ago

Memory usage change @ d708571cc2fa6c2618d49d29fc424a97473ee33f

Board flash % RAM for global variables %
arduino:megaavr:uno2018 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table Board|examples/SimpleAccelerometer
flash|%|examples/SimpleAccelerometer
RAM for global variables|%|examples/SimpleGyroscope
flash|%|examples/SimpleGyroscope
RAM for global variables|% -|-|-|-|-|-|-|-|- arduino:megaavr:uno2018|0|0.0|0|0.0|0|0.0|0|0.0 arduino:samd:nano_33_iot|0|0.0|0|0.0|0|0.0|0|0.0
Click for full report CSV ``` Board,examples/SimpleAccelerometer
flash,%,examples/SimpleAccelerometer
RAM for global variables,%,examples/SimpleGyroscope
flash,%,examples/SimpleGyroscope
RAM for global variables,% arduino:megaavr:uno2018,0,0.0,0,0.0,0,0.0,0,0.0 arduino:samd:nano_33_iot,0,0.0,0,0.0,0,0.0,0,0.0 ```
github-actions[bot] commented 2 years ago

Memory usage change @ 0bfb4983f1f28df90022714f597e7817876cad4b

Board flash % RAM for global variables %
arduino:megaavr:uno2018 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table Board|examples/SimpleAccelerometer
flash|%|examples/SimpleAccelerometer
RAM for global variables|%|examples/SimpleGyroscope
flash|%|examples/SimpleGyroscope
RAM for global variables|% -|-|-|-|-|-|-|-|- arduino:megaavr:uno2018|0|0.0|0|0.0|0|0.0|0|0.0 arduino:samd:nano_33_iot|0|0.0|0|0.0|0|0.0|0|0.0
Click for full report CSV ``` Board,examples/SimpleAccelerometer
flash,%,examples/SimpleAccelerometer
RAM for global variables,%,examples/SimpleGyroscope
flash,%,examples/SimpleGyroscope
RAM for global variables,% arduino:megaavr:uno2018,0,0.0,0,0.0,0,0.0,0,0.0 arduino:samd:nano_33_iot,0,0.0,0,0.0,0,0.0,0,0.0 ```
pu239ppy commented 2 years ago

👋 ping

facchinm commented 2 years ago

LGTM!