rt_err_t ry(char *dname)
{
    rt_err_t res;

    rt_device_t dev = rt_device_find(dname);
    if (!dev)
    {
        rt_kprintf("could not find device:%s\n", dname);
        return -RT_ERROR;
    }

    res = rym_write_to_file(dev);

    return res;
}
Exemplo n.º 2
0
int main(int argc, char** argv)
{
    rt_err_t res;

    if (argc != 2)
    {
        rt_kprintf("Usage: ymodem device\n");
        return 0;
    }

    rt_device_t dev = rt_device_find(argv[1]);
    if (!dev)
    {
        rt_kprintf("could not find device:%s\n", argv[1]);
        return -RT_ERROR;
    }

    res = rym_write_to_file(dev);

    return res;
}