EI_IMPULSE_ERROR ei_sleep(int32_t time_ms);
Brief: Cancellable sleep, can be triggered with signal from other thread
Blocking: Depends on user implementation
ei_sleep()is declared internally in the Edge Impulse SDK library, and the function must be defined by the user.
This function should allow the processor or thread to sleep or block for the given time.
time_ms- [input] Number of milliseconds the processor or current thread should sleep for.
Returns: Error code as defined by
EI_IMPULSE_ERRORenum. Will be
EI_IMPULSE_OKif the function completed successfully.
Example: The following examples demonstrate possible implementations of this function for various platforms. Note the
__attribute__((weak))in most of the definitions, which means that a user could override the implementation elsewhere in the program: