/* Change Logs: Date Author Notes  bernard the first version  */
int em_init(void)
/* Change Logs: Date Author Notes  bernard the first version  */
int em_init(void)
{
    int count = 5;
    char *em_cmd = "/services/em.elf &";
    while (count --)
    {
        int fd;
        fd = open("/services/em.elf", O_RDONLY);
        if (fd >= 0)
        {
            close(fd);
            msh_exec(em_cmd, rt_strlen(em_cmd) + 1);
            return 0;
        }
        else
        {
            rt_thread_mdelay(500);
        }
    }
    if (count <= 0)
    {
        printf("open em failed!\n");
    }
    return -1;
}