kernel/os: Don't hang in os_time_delay() if !sched
If the OS scheduler is disabled (`!MYNEWT_VAL(OS_SCHEDULING)`), then turn
`os_time_delay()` into a no-op.
Prior to this commit, this function would hang forever when scheduling
is disabled.
@@ -98,13 +98,6 @@ os_time_advance(int ticks)
}
}
}
-#else
-void
-os_time_advance(int ticks)
-{
- g_os_time += ticks;
-}
-#endif
void
os_time_delay(os_time_t osticks)
@@ -119,6 +112,21 @@ os_time_delay(os_time_t osticks)
}
}
+#else
+
+void
+os_time_advance(int ticks)
+{
+ g_os_time += ticks;
+}
+
+void
+os_time_delay(os_time_t osticks)
+{
+}
+
+#endif
+
/**
* Searches the list of registered time change listeners for the specified
* entry.
