kopia lustrzana https://github.com/pimoroni/pimoroni-pico
fix dangling pointer error
rodzic
32dfdc6a20
commit
bfb6490ec8
|
@ -64,8 +64,8 @@ namespace pimoroni {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LTP305::set_character(uint8_t x, uint16_t ch) {
|
void LTP305::set_character(uint8_t x, uint16_t ch) {
|
||||||
uint8_t *data = nullptr;
|
const uint8_t *data = nullptr;
|
||||||
for(auto c : dotfont) {
|
for(const auto& c : dotfont) {
|
||||||
if(c.code == ch) {
|
if(c.code == ch) {
|
||||||
data = &c.data[0];
|
data = &c.data[0];
|
||||||
break;
|
break;
|
||||||
|
@ -128,4 +128,4 @@ namespace pimoroni {
|
||||||
i2c->reg_write_uint8(address, CMD_BRIGHTNESS, brightness);
|
i2c->reg_write_uint8(address, CMD_BRIGHTNESS, brightness);
|
||||||
i2c->reg_write_uint8(address, CMD_UPDATE, 0x01);
|
i2c->reg_write_uint8(address, CMD_UPDATE, 0x01);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue