-INLINE uint16_t htobe16(uint16_t n);
-INLINE uint16_t htobe16(uint16_t n)
-{
- if (CPU_BYTE_ORDER == CPU_LITTLE_ENDIAN)
- n = n << 8 | n >> 8;
-
- return n;
-}
-
-INLINE uint16_t htole16(uint16_t n);
-INLINE uint16_t htole16(uint16_t n)
-{
- if (CPU_BYTE_ORDER == CPU_BIG_ENDIAN)
- n = n << 8 | n >> 8;
-
- return n;
-}
+/*!
+ * \name SCHEDULER_IDLE
+ *
+ * \brief Invoked by the scheduler to stop the CPU when idle.
+ *
+ * This hook can be redefined to put the CPU in low-power mode, or to
+ * profile system load with an external strobe, or to save CPU cycles
+ * in hosted environments such as emulators.
+ */
+#ifndef SCHEDULER_IDLE
+ #if defined(ARCH_EMUL) && (ARCH & ARCH_EMUL)
+ /* This emulator hook should yeld the CPU to the host. */
+ EXTERN_C_BEGIN
+ void SchedulerIdle(void);
+ EXTERN_C_END
+ #else /* !ARCH_EMUL */
+ #define SCHEDULER_IDLE /* nothing */
+ #endif /* !ARCH_EMUL */
+#endif /* !SCHEDULER_IDLE */