sparkfun / SparkFun_DS3234_RTC_Arduino_Library

Implements all time-keeping, setting, and alarming functions of the DS3234 RTC module.
Other
5 stars 12 forks source link

Permissive uint8_t type conversion #14

Closed Wetherman closed 2 years ago

Wetherman commented 3 years ago

The SPI register address in the DS3234 has type 'enum DS3234_registers' Arduino IDE 1.18.12 compiler will not convert uint8_t to that type. The first parameter of calls to DS3234::writeToRegister() and DS3234::readFromRegister() are type DS3234_registers

SparkFunDS3234RTC.h lines 222, 223 should be void writeToRegister(DS3234_registers address, uint8_t data); uint8_t readFromRegister(DS3234_registers address); SparkFunDS3234RTC.cpp lines 698, 703 should be void DS3234::writeToRegister(DS3234_registers address, uint8_t data) uint8_t DS3234::readFromRegister(DS3234_registers address)

Koxx3 commented 2 years ago

any fix on that ?

Wetherman commented 2 years ago

any fix on that ?

I haven't a clue. I discovered the mistake, reported it in the message above, and that's as far as I go. I don't know how to fix it without breaking something else, so I described a way for an ordinary person like me to fix it locally. Can you fix it ? (rhetorical)

nseidle commented 2 years ago

Ah, fails on ESP32. Fix in place. Added issue template as well. Releasing shortly.