Skip to content

Commit 1b95f81

Browse files
committed
small tidyup
1 parent 1724867 commit 1b95f81

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

content/OTRadioLink/utility/OTV0P2BASE_Sleep.h

+10-9
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ KIND, either express or implied. See the Licence for the
1313
specific language governing permissions and limitations
1414
under the Licence.
1515
16-
Author(s) / Copyright (s): Damon Hart-Davis 2015--2016
16+
Author(s) / Copyright (s): Damon Hart-Davis 2015--2018
1717
Deniz Erbilgin 2017
1818
*/
1919

@@ -172,16 +172,17 @@ constexpr uint32_t F_CPU = 19000000; // XXX Where should this go?
172172
// This may be extended by interrupts, etc, so must not be regarded as very precise.
173173
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. */ } }
174174

175-
176175
#endif // ARDUINO_ARCH_AVR
177176

178177

179178
// 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();
182182

183183
// 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.
185186
inline void sleepUntilInt() { sleepPwrSaveWithBODDisabled(); }
186187

187188
#ifdef ARDUINO_ARCH_AVR
@@ -200,18 +201,18 @@ inline void sleepUntilInt() { sleepPwrSaveWithBODDisabled(); }
200201
// * watchdogSleep is one of the WDTO_XX values from <avr/wdt.h>
201202
// May be useful to call minimsePowerWithoutSleep() first, when not needing any modules left on.
202203
// NOTE: will stop clocks for UART, etc.
203-
void nap(int_fast8_t watchdogSleep); // TODO
204+
void nap(int_fast8_t watchdogSleep);
204205

205206
// Sleep briefly in as lower-power mode as possible until the specified (watchdog) time expires, or another interrupt.
206207
// * watchdogSleep is one of the WDTO_XX values from <avr/wdt.h>
207208
// * allowPrematureWakeup if true then if woken before watchdog fires return false
208209
// Returns false if the watchdog timer did not go off, true if it did.
209210
// May be useful to call minimsePowerWithoutSleep() first, when not needing any modules left on.
210211
// 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);
212213

213214

214-
#ifdef ARDUINO_ARCH_AVR // TODO
215+
#ifdef ARDUINO_ARCH_AVR
215216
// If CPU clock is 1MHz then *assume* that it is the 8MHz internal RC clock prescaled by 8 unless DEFAULT_CPU_PRESCALE is defined.
216217
#if F_CPU == 1000000L
217218
static const uint8_t DEFAULT_CPU_PRESCALE = 3;
@@ -228,7 +229,7 @@ bool nap(int_fast8_t watchdogSleep, bool allowPrematureWakeup); // TODO
228229
#endif // F_CPU > 16000000L
229230
#endif // ARDUINO_ARCH_AVR
230231

231-
#ifdef ARDUINO_ARCH_AVR // TODO
232+
#ifdef ARDUINO_ARCH_AVR
232233
// Sleep for specified number of _delay_loop2() loops at minimum available CPU speed.
233234
// Each loop takes 4 cycles at that minimum speed, but entry and exit overheads may take the equivalent of a loop or two.
234235
// Note: inlining is prevented so as to avoid migrating anything into the section where the CPU is running slowly.

0 commit comments

Comments
 (0)