adafruit / Adafruit_CircuitPython_Register

Python data descriptor classes to represent hardware registers on I2C devices.
MIT License
47 stars 21 forks source link

Mask registers in BCDDateTimeRegister #40

Closed AdamCummick closed 3 years ago

AdamCummick commented 3 years ago

Corrects for issue where x bits on the RTC do not return 0. I ran into an error when using the PCF8563 RTC, though the issue is not present on the PCF8523 RTC. This change creates a default masking list that corrects the error. I ran through the simpletest example on both the PCF8523 and PCF8563 for several minutes and did not see an issue.

AdamCummick commented 3 years ago

Changed to bytearray as suggested. Tested for about 15 minutes on each of the NXP RTC chips.