@@ -13,7 +13,7 @@ KIND, either express or implied. See the Licence for the
13
13
specific language governing permissions and limitations
14
14
under the Licence.
15
15
16
- Author(s) / Copyright (s): Damon Hart-Davis 2015--2016
16
+ Author(s) / Copyright (s): Damon Hart-Davis 2015--2018
17
17
Deniz Erbilgin 2017
18
18
*/
19
19
@@ -172,16 +172,17 @@ constexpr uint32_t F_CPU = 19000000; // XXX Where should this go?
172
172
// This may be extended by interrupts, etc, so must not be regarded as very precise.
173
173
inline void delay_ms (uint_fast8_t ms) { while (ms-- > 0 ) { OTV0P2BASE_busy_spin_delayLong ((uint32_t )1e6 / (delayLoopTimeInNS * 9 )); /* busy spin takes ~945 us, loop overhead insignificant. */ } }
174
174
175
-
176
175
#endif // ARDUINO_ARCH_AVR
177
176
178
177
179
178
// Sleep with BOD disabled in power-save mode; will wake on any interrupt.
180
- // This particular API is not guaranteed to be maintained: please use sleepUntilInt() instead.
181
- void sleepPwrSaveWithBODDisabled (); // TODO
179
+ // This particular API is not guaranteed to be maintained:
180
+ // please use sleepUntilInt() instead.
181
+ void sleepPwrSaveWithBODDisabled ();
182
182
183
183
// Sleep indefinitely in as lower-power mode as possible until a specified watchdog time expires, or another interrupt.
184
- // May be useful to call minimsePowerWithoutSleep() first, when not needing any modules left on.
184
+ // May be useful to call minimsePowerWithoutSleep() first,
185
+ // when not needing any modules left on.
185
186
inline void sleepUntilInt () { sleepPwrSaveWithBODDisabled (); }
186
187
187
188
#ifdef ARDUINO_ARCH_AVR
@@ -200,18 +201,18 @@ inline void sleepUntilInt() { sleepPwrSaveWithBODDisabled(); }
200
201
// * watchdogSleep is one of the WDTO_XX values from <avr/wdt.h>
201
202
// May be useful to call minimsePowerWithoutSleep() first, when not needing any modules left on.
202
203
// NOTE: will stop clocks for UART, etc.
203
- void nap (int_fast8_t watchdogSleep); // TODO
204
+ void nap (int_fast8_t watchdogSleep);
204
205
205
206
// Sleep briefly in as lower-power mode as possible until the specified (watchdog) time expires, or another interrupt.
206
207
// * watchdogSleep is one of the WDTO_XX values from <avr/wdt.h>
207
208
// * allowPrematureWakeup if true then if woken before watchdog fires return false
208
209
// Returns false if the watchdog timer did not go off, true if it did.
209
210
// May be useful to call minimsePowerWithoutSleep() first, when not needing any modules left on.
210
211
// NOTE: will stop clocks for UART, etc.
211
- bool nap (int_fast8_t watchdogSleep, bool allowPrematureWakeup); // TODO
212
+ bool nap (int_fast8_t watchdogSleep, bool allowPrematureWakeup);
212
213
213
214
214
- #ifdef ARDUINO_ARCH_AVR // TODO
215
+ #ifdef ARDUINO_ARCH_AVR
215
216
// If CPU clock is 1MHz then *assume* that it is the 8MHz internal RC clock prescaled by 8 unless DEFAULT_CPU_PRESCALE is defined.
216
217
#if F_CPU == 1000000L
217
218
static const uint8_t DEFAULT_CPU_PRESCALE = 3 ;
@@ -228,7 +229,7 @@ bool nap(int_fast8_t watchdogSleep, bool allowPrematureWakeup); // TODO
228
229
#endif // F_CPU > 16000000L
229
230
#endif // ARDUINO_ARCH_AVR
230
231
231
- #ifdef ARDUINO_ARCH_AVR // TODO
232
+ #ifdef ARDUINO_ARCH_AVR
232
233
// Sleep for specified number of _delay_loop2() loops at minimum available CPU speed.
233
234
// Each loop takes 4 cycles at that minimum speed, but entry and exit overheads may take the equivalent of a loop or two.
234
235
// Note: inlining is prevented so as to avoid migrating anything into the section where the CPU is running slowly.
0 commit comments