kopia lustrzana https://github.com/pimoroni/pimoroni-pico
PCF85063A: Remove static keyword.
The use of "static" in `set_datetime` meant that "data" was only getting set to the correct values *once.*pull/702/head
rodzic
9e120995b2
commit
cb39d5c0f3
|
@ -54,7 +54,7 @@ namespace pimoroni {
|
||||||
}
|
}
|
||||||
|
|
||||||
datetime_t PCF85063A::get_datetime() {
|
datetime_t PCF85063A::get_datetime() {
|
||||||
static uint8_t result[7] = {0};
|
uint8_t result[7] = {0};
|
||||||
|
|
||||||
i2c->read_bytes(address, Registers::SECONDS, result, 7);
|
i2c->read_bytes(address, Registers::SECONDS, result, 7);
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ namespace pimoroni {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PCF85063A::set_datetime(datetime_t *t) {
|
void PCF85063A::set_datetime(datetime_t *t) {
|
||||||
static uint8_t data[7] = {
|
uint8_t data[7] = {
|
||||||
bcd_encode((uint)t->sec),
|
bcd_encode((uint)t->sec),
|
||||||
bcd_encode((uint)t->min),
|
bcd_encode((uint)t->min),
|
||||||
bcd_encode((uint)t->hour),
|
bcd_encode((uint)t->hour),
|
||||||
|
|
Ładowanie…
Reference in New Issue