adafruit / Adafruit_BMP280_Library

Arduino Library for BMP280 sensors
250 stars 187 forks source link

Tweak memory alloc and cleanup #58

Closed caternuson closed 2 years ago

caternuson commented 2 years ago

Motivated by #57, but not necessarily trying to "fix" that use case. But some amount of checking and cleanup is a good idea.

Torture test sketch run on Qt PY M0:

#include <Adafruit_BMP280.h>

Adafruit_BMP280 bmp;

void setup() {
  Serial.begin(9600);
  while (!Serial);
  Serial.println(F("BMP280 multiple begin() call test"));         
}

void loop() {
  if (!bmp.begin()) {
    Serial.println(F("Could not find a valid BMP280 sensor, check wiring or "
                      "try a different address!"));
    while (1) delay(10);
  }

  Serial.print(F("Pressure = "));
  Serial.print(bmp.readPressure());
  Serial.println(" Pa");

  delay(1000);
}

At first run: Screenshot from 2021-08-23 15-47-30

and still ticking after almost an hour of running: Screenshot from 2021-08-23 16-41-31

caternuson commented 2 years ago

heh. looks like i left this sitting here running. so even more further time longer run however many math hours later this is: Screenshot from 2021-08-24 07-29-19