Skip to content

Commit

Permalink
Merge pull request #711 from pimoroni/patch-jpegdec-filename
Browse files Browse the repository at this point in the history
MicroPython: Avoid heap allocations in all C++ modules.
  • Loading branch information
Gadgetoid authored Mar 17, 2023
2 parents d0e2425 + 587588d commit cb5db1d
Show file tree
Hide file tree
Showing 76 changed files with 1,084 additions and 1,029 deletions.
172 changes: 0 additions & 172 deletions .github/workflows/micropython-badger2040.yml

This file was deleted.

164 changes: 0 additions & 164 deletions .github/workflows/micropython-badger2040w.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/micropython-picow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
types: [created]

env:
MICROPYTHON_VERSION: 294098d28e2bad0ac0aad0d72595d11a82798096
MICROPYTHON_VERSION: 05bb26010e4a466a82cfed179f8d8d0b406a78ca

jobs:
deps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/micropython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
types: [created]

env:
MICROPYTHON_VERSION: 294098d28e2bad0ac0aad0d72595d11a82798096
MICROPYTHON_VERSION: 05bb26010e4a466a82cfed179f8d8d0b406a78ca

jobs:
deps:
Expand Down
5 changes: 4 additions & 1 deletion drivers/bme280/bme280.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ namespace pimoroni {
gpio_pull_up(interrupt);
}

device.intf_ptr = new i2c_intf_ptr{.i2c = i2c, .address = address};
i2c_interface.i2c = i2c;
i2c_interface.address = address;

device.intf_ptr = &i2c_interface;
device.intf = bme280_intf::BME280_I2C_INTF;
device.read = (bme280_read_fptr_t)&read_bytes;
device.write = (bme280_write_fptr_t)&write_bytes;
Expand Down
2 changes: 2 additions & 0 deletions drivers/bme280/bme280.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ namespace pimoroni {
bool status;
};

i2c_intf_ptr i2c_interface;

bool debug = false;

bool init();
Expand Down
4 changes: 3 additions & 1 deletion drivers/bme68x/bme68x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ namespace pimoroni {
gpio_pull_up(interrupt);
}

device.intf_ptr = new i2c_intf_ptr{.i2c = i2c, .address = address};
i2c_interface.i2c = i2c;
i2c_interface.address = address;

device.intf_ptr = &i2c_interface;
device.intf = bme68x_intf::BME68X_I2C_INTF;
device.read = (bme68x_read_fptr_t)&read_bytes;
device.write = (bme68x_write_fptr_t)&write_bytes;
Expand Down
2 changes: 2 additions & 0 deletions drivers/bme68x/bme68x.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ namespace pimoroni {
int8_t address;
};

i2c_intf_ptr i2c_interface;

bool debug = true;

bool init();
Expand Down
Loading

0 comments on commit cb5db1d

Please sign in to comment.