You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, playing around with the library I noticed that the temperature is returned as a float (as in other DS3231 libraries). If the method is used, this pulls in floating point code that would otherwise be unneeded.
The datasheet lists the temperature accuracy as +/-3° Celsius @ 3.3V, yet the temperature is internally represented in units of 0.25°. Given that, wouldn't it make sense to integer divide by 4/round and return an int8_t? In a small example, this resulted in upwards of 800 bytes less flash memory. The tradeoff is that tiny trends would only be detectable after a change of 0.5°, and that the interface would not totally show the internal status of the chip.
Not a big deal, given that the temperature method will probably not be widely used, just my 2 cents.
Edit: Such a version could be provided by means of an additional configuration switch ENABLE_*.
The text was updated successfully, but these errors were encountered:
Hi, playing around with the library I noticed that the temperature is returned as a float (as in other DS3231 libraries). If the method is used, this pulls in floating point code that would otherwise be unneeded.
The datasheet lists the temperature accuracy as +/-3° Celsius @ 3.3V, yet the temperature is internally represented in units of 0.25°. Given that, wouldn't it make sense to integer divide by 4/round and return an int8_t? In a small example, this resulted in upwards of 800 bytes less flash memory. The tradeoff is that tiny trends would only be detectable after a change of 0.5°, and that the interface would not totally show the internal status of the chip.
Not a big deal, given that the temperature method will probably not be widely used, just my 2 cents.
Edit: Such a version could be provided by means of an additional configuration switch ENABLE_*.
The text was updated successfully, but these errors were encountered: