From cb39d5c0f3b8b2beef32eef551e4591cee6b2185 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Thu, 2 Mar 2023 15:38:06 +0000 Subject: [PATCH] PCF85063A: Remove static keyword. The use of "static" in `set_datetime` meant that "data" was only getting set to the correct values *once.* --- drivers/pcf85063a/pcf85063a.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pcf85063a/pcf85063a.cpp b/drivers/pcf85063a/pcf85063a.cpp index 134851dc..6a87c82d 100644 --- a/drivers/pcf85063a/pcf85063a.cpp +++ b/drivers/pcf85063a/pcf85063a.cpp @@ -54,7 +54,7 @@ namespace pimoroni { } datetime_t PCF85063A::get_datetime() { - static uint8_t result[7] = {0}; + uint8_t result[7] = {0}; i2c->read_bytes(address, Registers::SECONDS, result, 7); @@ -72,7 +72,7 @@ namespace pimoroni { } 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->min), bcd_encode((uint)t->hour),