Skip to content

Add _SPARKFUNBME280_NO_SPI and _SPARKFUNBME280_NO_I2C flag #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed

Add _SPARKFUNBME280_NO_SPI and _SPARKFUNBME280_NO_I2C flag #44

wants to merge 4 commits into from

Conversation

drhideg
Copy link

@drhideg drhideg commented Apr 1, 2020

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

drhideg added 3 commits April 1, 2020 12:27
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
Remove unnecessary and wrong build flag check before settings.commInterface = SPI_MODE
@AndyEngland521
Copy link
Contributor

@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
Copy link
Author

drhideg commented Apr 10, 2020

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
Copy link
Contributor

@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
Copy link
Author

drhideg commented Apr 10, 2020

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
Copy link
Contributor

Go right ahead!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants