#include #include #include #include #include _task_handle_t run_command(const char *path) { uint8_t dn; path = remove_prefix(path, &dn); for (const char *ptr = path; *ptr; ++ptr) if (*ptr == ' ') { char *new_path = get_block(ptr - path + 1); blockcpy(new_path, path, ptr - path); new_path[ptr - path] = '\0'; bool succeded = _start_task(dn, new_path, ptr + 1); free_block(new_path); return succeded; } return _start_task(dn, path, ""); } bool try_run_command_blocking(const char *path) { _task_handle_t handle = run_command(path); if (!handle) return false; _wait_for_task(handle); _yield_task(); return true; } void yield_task() { _yield_task(); }