sparkfun / SparkFun_BME280_Arduino_Library

An Arduino library to control the BME280 humidity and pressure sensor.
https://www.sparkfun.com/products/14348
Other
119 stars 113 forks source link

Add _SPARKFUNBME280_NO_SPI and _SPARKFUNBME280_NO_I2C flag #44

Closed drhideg closed 4 years ago

drhideg commented 4 years ago

Added _SPARKFUNBME280_NO_SPI and _SPARKFUNBME280_NO_I2C compile flag for smaller binary size.

Example1_BasicReadings.ino
                        binary size | global consts
without flag                 275152 | 27660
with _SPARKFUNBME280_NO_SPI  273300 | 27616
difference                    -1852 |   -44

SPI/Example1_BasicReadings.ino
                        binary size | global consts
without flag                 275136 | 27660
with _SPARKFUNBME280_NO_I2C  271300 | 27180
difference                    -3836 |  -480
AndyEngland521 commented 4 years ago

@drhideg I like what you've done here, but we usually don't like customers having to fiddle about in the library's source files to enable or disable features. I understand that you have a default to I2C if the customer doesn't define anything, but this still means the customer has to go into the library to enable SPI. For now I don't think I can pull this request in, I'm sorry.

drhideg commented 4 years ago

I hope i dont make any wrong, therefor both I2C and SPI enabled by default. At least that was my intention. However i dont have any SPI device to try it on board.

-- Github stuffs is new for me. I need to close or delete my for to any of my new commits dont came here as part of a pull reqest? Because the global instances comes here :/

AndyEngland521 commented 4 years ago

@drhideg Oh I see what you're doing now, the double negatives had me thrown off for a second, can you please update the version number in library.properties to 2.0.9 and I will pull this in

drhideg commented 4 years ago

Bumped. But now its all wrong with the global intances things, which doesn't work yet, and i made a typo in the commit title :) Can I close this PR and open a new one from a newly forked library?

AndyEngland521 commented 4 years ago

Go right ahead!