Skip to content

Commit a7e535a

Browse files
committed
Improvements based on review
1 parent 069c9c7 commit a7e535a

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

adafruit_ds3231.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -124,25 +124,26 @@ def temperature(self):
124124
only every 64 seconds, or when a conversion is forced."""
125125
return self._temperature / 4
126126

127-
def force_conversion(self):
127+
def force_temperature_conversion(self):
128128
"""Forces a conversion and returns the new temperature"""
129129
while self._busy:
130-
pass
130+
pass # Wait for any normal in-progress conversion to complete
131131
self._conv = True
132-
while self._busy:
133-
pass
132+
while self._conv:
133+
pass # Wait for manual conversion request to complete
134134
return self.temperature
135135

136136
@property
137137
def calibration(self):
138-
"""Calibration values range from -128 to 127; each step is
139-
approximately 0.1ppm, and positive values decrease the frequency
140-
(increase the period). When set, a temperature conversion is forced so
141-
the result of calibration can be seen directly at the 32kHz pin after
142-
the next temperature conversion."""
138+
"""Calibrate the frequency of the crystal oscillator by adding or
139+
removing capacitance. The datasheet calls this the Aging Offset.
140+
Calibration values range from -128 to 127; each step is approximately
141+
0.1ppm, and positive values decrease the frequency (increase the
142+
period). When set, a temperature conversion is forced so the result of
143+
calibration can be seen directly at the 32kHz pin immediately"""
143144
return self._calibration
144145

145146
@calibration.setter
146147
def calibration(self, value):
147148
self._calibration = value
148-
self.force_conversion()
149+
self.force_temperature_conversion()

0 commit comments

Comments
 (0)