File tree 1 file changed +11
-43
lines changed
1 file changed +11
-43
lines changed Original file line number Diff line number Diff line change @@ -168,59 +168,27 @@ class AlarmMatch {
168
168
};
169
169
170
170
class RTClock {
171
- private:
171
+ private:
172
172
bool is_initialized;
173
173
174
- public:
175
- inline RTClock () : is_initialized(false ) {}
176
- inline ~RTClock () {}
177
-
178
- inline bool begin () {
179
- if (openRtc ()) {
180
- is_initialized = true ;
181
- } else {
182
- is_initialized = false ;
183
- }
184
- return is_initialized;
185
- }
186
-
187
- inline bool getTime (RTCTime &t) {
188
- struct tm present;
189
- if (is_initialized) {
190
- if ( getRtcTime (present) ) {
191
- t.setTM (present);
192
- return true ;
193
- }
194
- }
195
- return false ;
196
- }
174
+ public:
175
+ RTClock ();
176
+ ~RTClock ();
177
+
178
+ bool begin ();
179
+
180
+ bool getTime (RTCTime &t);
197
181
198
182
bool setPeriodicCallback (rtc_cbk_t fnc, Period p);
199
183
bool setAlarmCallback (rtc_cbk_t fnc, RTCTime &t, AlarmMatch &m);
200
-
201
- inline bool setAlarm (RTCTime &t, AlarmMatch &m) {
202
- return setAlarmCallback (nullptr , t, m);
203
- }
204
-
205
- inline bool isRunning () {
206
- return isRtcRunning ();
207
- }
184
+ bool setAlarm (RTCTime &t, AlarmMatch &m);
208
185
186
+ bool isRunning ();
209
187
bool setTime (RTCTime &t);
188
+ bool setTimeIfNotRunning (RTCTime &t);
210
189
211
- inline bool setTimeIfNotRunning (RTCTime &t) {
212
- if (!isRunning ()) {
213
- return setTime (t);
214
- }
215
- return false ;
216
- }
217
190
};
218
191
219
-
220
- #if RTC_HOWMANY > 0
221
- extern RTClock RTC;
222
- #endif
223
-
224
192
extern RTClock RTC;
225
193
226
194
#endif
You can’t perform that action at this time.
0 commit comments