diff --git a/examples/ymodem/echo.c b/examples/ymodem/echo.c index 5ffa5ff4178248f611d9c7f31835fdd148152155..5cb807f519aeb7b8eaf997b807eb3b05b325e053 100644 --- a/examples/ymodem/echo.c +++ b/examples/ymodem/echo.c @@ -25,8 +25,8 @@ rt_err_t rym_cat_to_dev(rt_device_t idev, rt_device_t odev) rt_kprintf("open output device error: 0x%x", -res); return res; } - res = rym_recv_on_device(&rctx, idev, - RT_NULL, _rym_echo_data, RT_NULL, 1000); + res = rym_recv_on_device(&rctx, idev, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_INT_RX, + RT_NULL, _rym_echo_data, RT_NULL, 1000); rt_device_close(_odev); rt_kprintf("leaving RYM mode with code %X\n", res); return res; diff --git a/examples/ymodem/null.c b/examples/ymodem/null.c index 5e3baa9870bc19b1ff51a2ddcf16d86b962ebb8f..c72ea064f8cc063d05cf2f095446f922fb26b517 100644 --- a/examples/ymodem/null.c +++ b/examples/ymodem/null.c @@ -20,8 +20,8 @@ rt_err_t rym_null(char *devname) return -1; } - return rym_recv_on_device(&rctx, dev, - RT_NULL, _rym_dummy_write, RT_NULL, 1000); + return rym_recv_on_device(&rctx, dev, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_INT_RX, + RT_NULL, _rym_dummy_write, RT_NULL, 1000); } FINSH_FUNCTION_EXPORT(rym_null, dump data to null); #endif diff --git a/examples/ymodem/tofile.c b/examples/ymodem/tofile.c index 2deef73c2cd45b6df6e42199c8528b0caa17892d..4a3705ede79961e0fab1c15752074c32b252dce2 100644 --- a/examples/ymodem/tofile.c +++ b/examples/ymodem/tofile.c @@ -21,7 +21,7 @@ static enum rym_code _rym_bg( struct custom_ctx *cctx = (struct custom_ctx*)ctx; cctx->fpath[0] = '/'; /* the buf should be the file name */ - strcpy(&(cctx->fpath[1]), buf); + strcpy(&(cctx->fpath[1]), (const char*)buf); cctx->fd = open(cctx->fpath, O_CREAT | O_WRONLY | O_TRUNC, 0); if (cctx->fd < 0) { @@ -31,7 +31,7 @@ static enum rym_code _rym_bg( return RYM_CODE_CAN; } - cctx->flen = atoi(buf+strlen(buf)+1); + cctx->flen = atoi((const char*)buf+strlen((const char*)buf)+1); if (cctx->flen == 0) cctx->flen = -1; return RYM_CODE_ACK; @@ -80,8 +80,8 @@ rt_err_t rym_write_to_file(rt_device_t idev) rt_kprintf("entering RYM mode\n"); - res = rym_recv_on_device(&ctx->parent, idev, - _rym_bg, _rym_tof, _rym_end, 1000); + res = rym_recv_on_device(&ctx->parent, idev, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_INT_RX, + _rym_bg, _rym_tof, _rym_end, 1000); /* there is no Ymodem traffic on the line so print out info. */ rt_kprintf("leaving RYM mode with code %d\n", res);